Skip to content

Commit 89e1ecb

Browse files
committed
Exclude unneeded files
1 parent ec9c70a commit 89e1ecb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

net-http.gemspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ Gem::Specification.new do |spec|
3030

3131
# Specify which files should be added to the gem when it is released.
3232
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
34-
`git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{\A(?:(?:test|spec|features)/|\.git)}) }
35-
end
33+
excludes = %W[/.git* /bin /test /*file /#{File.basename(__FILE__)}]
34+
spec.files = IO.popen(%W[git -C #{__dir__} ls-files -z --] + excludes.map {|e| ":^#{e}"}, &:read).split("\x0")
3635
spec.bindir = "exe"
3736
spec.require_paths = ["lib"]
3837

0 commit comments

Comments
 (0)