Skip to content

Commit 9c91d50

Browse files
mattbrictsondrwl
authored andcommitted
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
1 parent 988b495 commit 9c91d50

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

annotate.gemspec

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,7 @@ Gem::Specification.new do |s|
1414
1515
s.executables = ['annotate']
1616
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'TODO.rdoc']
17-
s.files = [
18-
'AUTHORS.rdoc',
19-
'CHANGELOG.rdoc',
20-
'LICENSE.txt',
21-
'README.rdoc',
22-
'TODO.rdoc',
23-
'annotate.gemspec',
24-
'bin/annotate',
25-
'lib/annotate.rb',
26-
'lib/annotate/active_record_patch.rb',
27-
'lib/annotate/annotate_models.rb',
28-
'lib/annotate/annotate_routes.rb',
29-
'lib/annotate/constants.rb',
30-
'lib/annotate/parser.rb',
31-
'lib/annotate/tasks.rb',
32-
'lib/annotate/version.rb',
33-
'lib/generators/annotate/USAGE',
34-
'lib/generators/annotate/install_generator.rb',
35-
'lib/generators/annotate/templates/auto_annotate_models.rake',
36-
'lib/tasks/annotate_models.rake',
37-
'lib/tasks/annotate_routes.rake',
38-
'lib/tasks/annotate_models_migrate.rake'
39-
]
17+
s.files = `git ls-files -z LICENSE.txt *.rdoc *.gemspec bin lib`.split("\x0")
4018
s.homepage = 'http://github.com/ctran/annotate_models'
4119
s.licenses = ['Ruby']
4220
s.require_paths = ['lib']

0 commit comments

Comments
 (0)