Skip to content

Commit

Permalink
Use a less error-prone way of specifying gem files (#662)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mattbrictson authored and drwl committed Oct 1, 2019
1 parent 988b495 commit 9c91d50
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions annotate.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,7 @@ Gem::Specification.new do |s|
s.email = ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
s.executables = ['annotate']
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'TODO.rdoc']
s.files = [
'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.files = `git ls-files -z LICENSE.txt *.rdoc *.gemspec bin lib`.split("\x0")
s.homepage = 'http://github.com/ctran/annotate_models'
s.licenses = ['Ruby']
s.require_paths = ['lib']
Expand Down

0 comments on commit 9c91d50

Please sign in to comment.