-
Notifications
You must be signed in to change notification settings - Fork 631
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
Use a less error-prone way of specifying gem files #662
Conversation
Before, whenever a new file is added to `lib`, the contributor or maintainer has to remember to explicitly add it to the gemspec. If this step is forgotten, it results in a broken release, like ctran#657. This commit makes this process less error prone by using `git ls-files` to automatically include all appropriate files in the gem. This is in line with what is advocated by Bundler's gem template: https://github.com/bundler/bundler/blob/2a4d88a7044528209321fd4441e995ec66f604b9/lib/bundler/templates/newgem/newgem.gemspec.tt#L26
@mattbrictson oh wow this is neat, thanks for the PR. Having this would have definitely prevented an issue like #657. Two things:
|
Nice catch, I'll add it.
I assume that if you run the code on a Windows machine then the line ending will not be Alternatively you could |
Gotcha thanks for the explanation, I learned something 🙂. |
Before, whenever a new file is added to `lib`, the contributor or maintainer has to remember to explicitly add it to the gemspec. If this step is forgotten, it results in a broken release, like ctran#657. This commit makes this process less error prone by using `git ls-files` to automatically include all appropriate files in the gem. This is in line with what is advocated by Bundler's gem template: https://github.com/bundler/bundler/blob/2a4d88a7044528209321fd4441e995ec66f604b9/lib/bundler/templates/newgem/newgem.gemspec.tt#L26
Before, whenever a new file is added to `lib`, the contributor or maintainer has to remember to explicitly add it to the gemspec. If this step is forgotten, it results in a broken release, like ctran#657. This commit makes this process less error prone by using `git ls-files` to automatically include all appropriate files in the gem. This is in line with what is advocated by Bundler's gem template: https://github.com/bundler/bundler/blob/2a4d88a7044528209321fd4441e995ec66f604b9/lib/bundler/templates/newgem/newgem.gemspec.tt#L26
Before, whenever a new file is added to
lib
, the contributor or maintainer has to remember to explicitly add it to the gemspec. If this step is forgotten, it results in a broken release, like #657.This commit makes this process less error prone by using
git ls-files
to automatically include all appropriate files in the gem. This is in line with what is advocated by Bundler's gem template:https://github.com/bundler/bundler/blob/2a4d88a7044528209321fd4441e995ec66f604b9/lib/bundler/templates/newgem/newgem.gemspec.tt#L26
To test this PR I ran
rake gem
and verified that the list of files included in the gem is the same as before: