Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not package examples and specs in builds #1190

Closed
wants to merge 1 commit into from

Conversation

nbibler
Copy link
Contributor

@nbibler nbibler commented Oct 20, 2020

Description

It's common practice to only include production code in Rubygem builds. The default behavior of Bundler, for example, is to ignore "test|spec|features" when capturing files to include in the builds.

After the #1183 PR in the 1.1.0 release, I noticed this was not being done – not that the PR changed the previous behavior, mind you – and that test files are being unnecessarily included in the released builds.

This PR removes examples and spec files from the Rubygems build.

@olleolleolle
Copy link
Member

The reason it now lives in the gem: the adapter test suite is borrowed by gems implementing adapters. Compare the faraday-http gem.

Perhaps there are other great ways of getting that.

@iMacTia
Copy link
Member

iMacTia commented Oct 20, 2020

@nbibler thanks for raising this. Under normal circumstances, you'd be totally right and I'd completely agree with you.
In our case, as @olleolleolle already mentioned, this is actually a feature to allow adapters to share tests with Faraday and ensure they are "compliant" with its rules. You can see an example in the link he provided.

Indeed there's no way you could know that because we haven't properly documented this thing 🙈, so totally not your fault.
I'll consider adding a comment or a section in the README to clarify this.

I'm going to close this PR for now, but if you think there's a better way to achieve the same result then we're more than happy to listen 👍!

@iMacTia iMacTia closed this Oct 20, 2020
@nbibler nbibler deleted the slim-gem branch October 20, 2020 14:53
@nbibler
Copy link
Contributor Author

nbibler commented Oct 20, 2020

Not a problem. I just saw the gemspec and it flagged something in my head as a problem with a quick fix. If it's there by design, then I have no issue with it.

@iMacTia: If you're planning on documenting it, I'd probably suggest an inline comment around that line in the gemspec. It wouldn't cross my mind to check a README for why there's an odd behavior in a gemspec file. Something more localized to the "that's weird, but on purpose" makes more sense to me.

@iMacTia
Copy link
Member

iMacTia commented Oct 20, 2020

Totally agree, thanks for the feedback and for caring about Faraday ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants