ruby-changes:61093
From: David <ko1@a...>
Date: Fri, 8 May 2020 14:14:04 +0900 (JST)
Subject: [ruby-changes:61093] 9042787508 (master): [rubygems/rubygems] Remove unnecessary `@@ruby` variable
https://git.ruby-lang.org/ruby.git/commit/?id=9042787508 From 90427875085f480c4c8e02d4252804cac29d7aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Wed, 8 Apr 2020 21:10:33 +0200 Subject: [rubygems/rubygems] Remove unnecessary `@@ruby` variable https://github.com/rubygems/rubygems/commit/5f20647ec1 diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index f1f6b85..b4d8db3 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -1220,7 +1220,7 @@ Also, a list: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L1220 def build_rake_in(good=true) gem_ruby = Gem.ruby - Gem.ruby = @@ruby + Gem.ruby = self.class.rubybin env_rake = ENV["rake"] rake = (good ? @@good_rake : @@bad_rake) ENV["rake"] = rake @@ -1289,7 +1289,6 @@ Also, a list: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L1289 end - @@ruby = rubybin @@good_rake = "#{rubybin} #{escape_path(TEST_PATH, 'good_rake.rb')}" @@bad_rake = "#{rubybin} #{escape_path(TEST_PATH, 'bad_rake.rb')}" diff --git a/test/rubygems/test_gem_ext_rake_builder.rb b/test/rubygems/test_gem_ext_rake_builder.rb index 1b5993c..9d78917 100644 --- a/test/rubygems/test_gem_ext_rake_builder.rb +++ b/test/rubygems/test_gem_ext_rake_builder.rb @@ -26,7 +26,7 @@ class TestGemExtRakeBuilder < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L26 output = output.join "\n" refute_match %r{^rake failed:}, output - assert_match %r{^#{Regexp.escape @@ruby} mkrf_conf\.rb}, output + assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output end end @@ -47,7 +47,7 @@ class TestGemExtRakeBuilder < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L47 output = output.join "\n" refute_match %r{^rake failed:}, output - assert_match %r{^#{Regexp.escape @@ruby} mkrf_conf\.rb}, output + assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output end end diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb index 7b071ba..e6c69c8 100644 --- a/test/rubygems/test_require.rb +++ b/test/rubygems/test_require.rb @@ -523,11 +523,11 @@ class TestGemRequire < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_require.rb#L523 File.write(dir + "/sub.rb", "#{prefix}warn 'uplevel', 'test', uplevel: 1\n") File.write(dir + "/main.rb", "require 'sub'\n") _, err = capture_subprocess_io do - system(@@ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") + system(Gem.ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") end assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err) _, err = capture_subprocess_io do - system(@@ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") + system(Gem.ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") end assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err) end @@ -538,11 +538,11 @@ class TestGemRequire < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_require.rb#L538 Dir.mktmpdir("warn_test") do |dir| File.write(dir + "/main.rb", "#{prefix}warn({x:1}, {y:2}, [])\n") _, err = capture_subprocess_io do - system(@@ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "main.rb") + system(Gem.ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "main.rb") end assert_match(/{:x=>1}\n{:y=>2}\n$/, err) _, err = capture_subprocess_io do - system(@@ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "main.rb") + system(Gem.ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "main.rb") end assert_match(/{:x=>1}\n{:y=>2}\n$/, err) end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/