Use a less error-prone way of specifying gem files (#662)
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
Showing
... | @@ -14,29 +14,7 @@ Gem::Specification.new do |s| | ... | @@ -14,29 +14,7 @@ Gem::Specification.new do |s| |
s.email = ['alex@stinky.com', 'cuong.tran@gmail.com', 'x@nofxx.com', 'turadg@aleahmad.net', 'jon@cloudability.com'] | s.email = ['alex@stinky.com', 'cuong.tran@gmail.com', 'x@nofxx.com', 'turadg@aleahmad.net', 'jon@cloudability.com'] | ||
s.executables = ['annotate'] | s.executables = ['annotate'] | ||
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'TODO.rdoc'] | s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'TODO.rdoc'] | ||
s.files = [ | s.files = `git ls-files -z LICENSE.txt *.rdoc *.gemspec bin lib`.split("\x0") | ||
'AUTHORS.rdoc', | |||
'CHANGELOG.rdoc', | |||
'LICENSE.txt', | |||
'README.rdoc', | |||
'TODO.rdoc', | |||
'annotate.gemspec', | |||
'bin/annotate', | |||
'lib/annotate.rb', | |||
'lib/annotate/active_record_patch.rb', | |||
'lib/annotate/annotate_models.rb', | |||
'lib/annotate/annotate_routes.rb', | |||
'lib/annotate/constants.rb', | |||
'lib/annotate/parser.rb', | |||
'lib/annotate/tasks.rb', | |||
'lib/annotate/version.rb', | |||
'lib/generators/annotate/USAGE', | |||
'lib/generators/annotate/install_generator.rb', | |||
'lib/generators/annotate/templates/auto_annotate_models.rake', | |||
'lib/tasks/annotate_models.rake', | |||
'lib/tasks/annotate_routes.rake', | |||
'lib/tasks/annotate_models_migrate.rake' | |||
] | |||
s.homepage = 'http://github.com/ctran/annotate_models' | s.homepage = 'http://github.com/ctran/annotate_models' | ||
s.licenses = ['Ruby'] | s.licenses = ['Ruby'] | ||
s.require_paths = ['lib'] | s.require_paths = ['lib'] | ||
... | ... |
Please
register
or
sign in
to comment