From d20886dd225e07fe14347398c2c0913f3e11d22a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 17 Jul 2022 10:30:56 +0900 Subject: [PATCH] Create build-only gemspec files only if having an extension --- tool/gem-unpack.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/gem-unpack.rb b/tool/gem-unpack.rb index 0ba23ef4d3..770ddce618 100644 --- a/tool/gem-unpack.rb +++ b/tool/gem-unpack.rb @@ -18,9 +18,9 @@ def Gem.unpack(file, dir = nil, spec_dir = nil) end FileUtils.mkdir_p(spec_dir) File.binwrite(File.join(spec_dir, "#{spec.name}-#{spec.version}.gemspec"), spec.to_ruby) - unless spec.extensions.empty? or spec.dependencies.empty? + unless spec.extensions.empty? spec.dependencies.clear + File.binwrite(File.join(spec_dir, ".bundled.#{spec.name}-#{spec.version}.gemspec"), spec.to_ruby) end - File.binwrite(File.join(spec_dir, ".bundled.#{spec.name}-#{spec.version}.gemspec"), spec.to_ruby) puts "Unpacked #{file}" end