From f0847c266cd5d427559a3bec1449fee6613e7d06 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:34:33 +1100 Subject: [PATCH 1/2] Remove unused files from the gem package --- uri.gemspec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uri.gemspec b/uri.gemspec index 9cf0a71..9c4d43e 100644 --- a/uri.gemspec +++ b/uri.gemspec @@ -30,8 +30,11 @@ Gem::Specification.new do |spec| # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + gemspec = File.basename(__FILE__) spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject do |file| + (file == gemspec) || file.start_with?(*%w[bin/ test/ .github/ .gitignore Gemfile Rakefile]) + end end spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } From a0dd612e9070c979f20ccf4308f6aa10690c1d68 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:20:46 +1100 Subject: [PATCH 2/2] Remove rakelib/ dir from gem also --- uri.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uri.gemspec b/uri.gemspec index 9c4d43e..0d0f897 100644 --- a/uri.gemspec +++ b/uri.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| gemspec = File.basename(__FILE__) spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject do |file| - (file == gemspec) || file.start_with?(*%w[bin/ test/ .github/ .gitignore Gemfile Rakefile]) + (file == gemspec) || file.start_with?(*%w[bin/ test/ rakelib/ .github/ .gitignore Gemfile Rakefile]) end end spec.bindir = "exe"