Skip to content

Commit 51de7c7

Browse files
nobumatzbot
authored andcommitted
[ruby/tsort] Use git magic signatures to exclude files
ruby/tsort@ab55dcb7f3
1 parent 7578655 commit 51de7c7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/tsort.gemspec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ Gem::Specification.new do |spec|
2020
spec.metadata["homepage_uri"] = spec.homepage
2121
spec.metadata["source_code_uri"] = spec.homepage
2222

23-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23+
dir, gemspec = File.split(__FILE__)
24+
excludes = %W[
25+
:^/bin/ :^/test/ :^/spec/ :^/features/ :^/Gemfile :^/Rakefile
26+
]
27+
spec.files = IO.popen(%w[git ls-files -z --] + excludes, chdir: dir) do |f|
28+
f.read.split("\x0")
2529
end
2630
spec.bindir = "exe"
2731
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

0 commit comments

Comments
 (0)