From 8d443417a9693e55fc38bf05840c8d23fbaea433 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 23 Mar 2024 21:53:24 +0900 Subject: [PATCH] Refine pathspecs for `spec.files` --- win32ole.gemspec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/win32ole.gemspec b/win32ole.gemspec index e9abb57..625916a 100644 --- a/win32ole.gemspec +++ b/win32ole.gemspec @@ -23,11 +23,11 @@ Gem::Specification.new do |spec| spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage - cmd = %W[git ls-files -z -- - :^#{File.basename(__FILE__)} - :^/bin/ :^/test/ :^/rakelib/ :^/.git* :^Gemfile* :^Rakefile* + pathspecs = %W[ + :(exclude,literal)#{File.basename(__FILE__)} + :^/bin/ :^/test/ :^/rakelib/ :^/.git* :^/Gemfile* :^/Rakefile* ] - spec.files = IO.popen(cmd, chdir: __dir__, err: IO::NULL, exception: false, &:read).split("\x0") + spec.files = IO.popen(%w[git ls-files -z --] + pathspecs, chdir: __dir__, err: IO::NULL, exception: false, &:read).split("\x0") spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"]