diff --git a/win32-registry.gemspec b/win32-registry.gemspec index d747daf..a690dd5 100644 --- a/win32-registry.gemspec +++ b/win32-registry.gemspec @@ -17,13 +17,10 @@ Gem::Specification.new do |spec| # The `git ls-files -z` loads the files in the RubyGem that have been added into git. excludes = %w[ bin/ test/ spec/ features/ rakelib/ - .git .github .mailmap appveyor Rakefile Gemfile + .git* .mailmap appveyor Rakefile Gemfile ] - spec.files = Dir.chdir(__dir__) do - `git ls-files -z`.split("\x0").reject do |f| - File.identical?(f, __FILE__) || f.start_with?(*excludes) - end - end + git_files = %w[git ls-files -z --] + excludes.map {|x| ":^/#{x}"} + spec.files = IO.popen(git_files, chdir: __dir__, &:read).split("\x0") spec.bindir = "exe" spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"]