Skip to content

Commit ce38e26

Browse files
authored
Merge pull request #14 from ruby/pkg-files
Use pathspecs to select needed files in the gem file
2 parents f444329 + 3be0188 commit ce38e26

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

win32-registry.gemspec

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ Gem::Specification.new do |spec|
1717
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
1818
excludes = %w[
1919
bin/ test/ spec/ features/ rakelib/
20-
.git .github .mailmap appveyor Rakefile Gemfile
20+
.git* .mailmap appveyor Rakefile Gemfile
2121
]
22-
spec.files = Dir.chdir(__dir__) do
23-
`git ls-files -z`.split("\x0").reject do |f|
24-
File.identical?(f, __FILE__) || f.start_with?(*excludes)
25-
end
26-
end
22+
git_files = %w[git ls-files -z --] + excludes.map {|x| ":^/#{x}"}
23+
spec.files = IO.popen(git_files, chdir: __dir__, &:read).split("\x0")
2724
spec.bindir = "exe"
2825
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2926
spec.require_paths = ["lib"]

0 commit comments

Comments
 (0)