Skip to content

Commit 3dae74e

Browse files
committed
chore: Update spec.files logic
1 parent f65eb82 commit 3dae74e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

serverkit-vscode.gemspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ Gem::Specification.new do |spec|
2020

2121
# Specify which files should be added to the gem when it is released.
2222
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
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+
gemspec = File.basename(__FILE__)
24+
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
25+
ls.readlines("\x0", chomp: true).reject do |f|
26+
(f == gemspec) ||
27+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
28+
end
2529
end
2630
spec.bindir = "exe"
27-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2832
spec.require_paths = ["lib"]
2933

3034
spec.add_runtime_dependency "serverkit"

0 commit comments

Comments
 (0)