1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Create build-only gemspec files only if having an extension

This commit is contained in:
Nobuyoshi Nakada 2022-07-17 10:30:56 +09:00
parent d010eba2f4
commit d20886dd22
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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