Skip to content

Commit 53a03c4

Browse files
authored
Add all appropriate files (excluding tests) to the gem (#507)
Signed-off-by: James Couball <jcouball@yahoo.com>
1 parent 352f688 commit 53a03c4

File tree

1 file changed

+5
-27
lines changed

1 file changed

+5
-27
lines changed

git.gemspec

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,9 @@ Gem::Specification.new do |s|
3838
s.add_development_dependency 'yardstick', '~> 0.9'
3939
end
4040

41-
s.files = [
42-
'CHANGELOG.md',
43-
'CONTRIBUTING.md',
44-
'MAINTAINERS.md',
45-
'LICENSE',
46-
'README.md',
47-
'lib/git.rb',
48-
'lib/git/author.rb',
49-
'lib/git/base.rb',
50-
'lib/git/base/factory.rb',
51-
'lib/git/branch.rb',
52-
'lib/git/branches.rb',
53-
'lib/git/config.rb',
54-
'lib/git/diff.rb',
55-
'lib/git/index.rb',
56-
'lib/git/lib.rb',
57-
'lib/git/log.rb',
58-
'lib/git/object.rb',
59-
'lib/git/path.rb',
60-
'lib/git/remote.rb',
61-
'lib/git/repository.rb',
62-
'lib/git/stash.rb',
63-
'lib/git/stashes.rb',
64-
'lib/git/status.rb',
65-
'lib/git/version.rb',
66-
'lib/git/working_directory.rb'
67-
]
41+
# Specify which files should be added to the gem when it is released.
42+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
43+
s.files = Dir.chdir(File.expand_path(__dir__)) do
44+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(tests|spec|features)/}) }
45+
end
6846
end

0 commit comments

Comments
 (0)