diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-07 23:47:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-07 23:47:37 +0900 |
commit | 91f831ac17c8ff58d536ce1fa320294bb477d2ae (patch) | |
tree | e8ce810068739d08716ee5f3fe33cf469a7875ae /tool/rbinstall.rb | |
parent | e025113d71ca208255203f78cc85e9efa25bb23f (diff) | |
download | ruby-91f831ac17c8ff58d536ce1fa320294bb477d2ae.tar.gz |
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.
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-x | tool/rbinstall.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index b1f657a69b..ed883f6085 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -965,9 +965,14 @@ install?(:ext, :comm, :gem, :'bundled-gems') do 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}" |