Skip to content

Commit a1a3857

Browse files
nobumatzbot
authored andcommitted
[ruby/win32-registry] Use pathspecs to select needed files in the gem file
Exclude other git management files too. ruby/win32-registry@3be0188111
1 parent 342dfd7 commit a1a3857

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ext/win32/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)