Skip to content

Commit f8e002a

Browse files
nobumatzbot
authored andcommitted
[ruby/English] Exclude unused files from gem
ruby/English@6bea25038b
1 parent a9eed30 commit f8e002a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/English.gemspec

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ Gem::Specification.new do |spec|
1515

1616
# Specify which files should be added to the gem when it is released.
1717
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19-
`git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18+
excludes = %W[
19+
:^/test :^/spec :^/feature :^/bin
20+
:^/Rakefile :^/Gemfile\* :^/.git*
21+
:^/#{File.basename(__FILE__)}
22+
]
23+
spec.files = IO.popen(%W[git ls-files -z --] + excludes, err: IO::NULL) do |f|
24+
f.readlines("\x0", chomp: true)
2025
end
2126
spec.require_paths = ["lib"]
2227
end

0 commit comments

Comments
 (0)