From 7a4314740709b8e2a4b65ab2af22422b2fb76a05 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 3 Jul 2024 14:18:27 +0900 Subject: [PATCH] [ruby/shellwords] Exclude unnecessary files from the packages https://github.com/ruby/shellwords/commit/08c87a964e --- lib/shellwords.gemspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/shellwords.gemspec b/lib/shellwords.gemspec index d60ab5f650..8d0c518ca5 100644 --- a/lib/shellwords.gemspec +++ b/lib/shellwords.gemspec @@ -21,8 +21,9 @@ Gem::Specification.new do |spec| spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + srcdir, gemspec_file = File.split(__FILE__) + spec.files = Dir.chdir(srcdir) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:(?:test|spec|features)/|\.git|Rake)}) || f == gemspec_file} end spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }