ruby-changes:64000
From: Nobuyoshi <ko1@a...>
Date: Mon, 7 Dec 2020 23:53:13 +0900 (JST)
Subject: [ruby-changes:64000] 91f831ac17 (master): Extract gemspec to versioned file
https://git.ruby-lang.org/ruby.git/commit/?id=91f831ac17 From 91f831ac17c8ff58d536ce1fa320294bb477d2ae Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 7 Dec 2020 23:47:37 +0900 Subject: Extract gemspec to versioned file Not to be overwritten by test-bundler-prepare. gem files often contain useless gemspec files which have not been processed. diff --git a/tool/gem-unpack.rb b/tool/gem-unpack.rb index 0ddcea0..6fb80d3 100644 --- a/tool/gem-unpack.rb +++ b/tool/gem-unpack.rb @@ -10,7 +10,7 @@ def Gem.unpack(file, dir = nil) https://github.com/ruby/ruby/blob/trunk/tool/gem-unpack.rb#L10 target = spec.full_name target = File.join(dir, target) if dir pkg.extract_files target - spec_file = File.join(target, "#{spec.name}.gemspec") + spec_file = File.join(target, "#{spec.name}-#{spec.version}.gemspec") open(spec_file, 'wb') do |f| f.print spec.to_ruby end diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index b1f657a..ed883f6 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -965,9 +965,14 @@ install?(:ext, :comm, :gem, :'bundled-gems') do https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L965 next if /^\s*(?:#|$)/ =~ name next unless /^(\S+)\s+(\S+).*/ =~ name gem_name = "#$1-#$2" - path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec" - next unless File.exist?(path) - spec = load_gemspec(path, true) + path = "#{srcdir}/.bundle/gems/#{gem_name}/#{gem_name}.gemspec" + if File.exist?(path) + spec = load_gemspec(path) + else + path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec" + next unless File.exist?(path) + spec = load_gemspec(path, true) + end next unless spec.platform == Gem::Platform::RUBY next unless spec.full_name == gem_name spec.extension_dir = "#{extensions_dir}/#{spec.full_name}" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/