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

[rubygems/rubygems] Remove unnecessary @@ruby variable

https://github.com/rubygems/rubygems/commit/5f20647ec1
This commit is contained in:
David Rodríguez 2020-04-08 21:10:33 +02:00 committed by Hiroshi SHIBATA
parent c6979feb02
commit 9042787508
Notes: git 2020-05-08 14:14:26 +09:00
3 changed files with 7 additions and 8 deletions

View file

@ -1220,7 +1220,7 @@ Also, a list:
def build_rake_in(good=true) def build_rake_in(good=true)
gem_ruby = Gem.ruby gem_ruby = Gem.ruby
Gem.ruby = @@ruby Gem.ruby = self.class.rubybin
env_rake = ENV["rake"] env_rake = ENV["rake"]
rake = (good ? @@good_rake : @@bad_rake) rake = (good ? @@good_rake : @@bad_rake)
ENV["rake"] = rake ENV["rake"] = rake
@ -1289,7 +1289,6 @@ Also, a list:
end end
@@ruby = rubybin
@@good_rake = "#{rubybin} #{escape_path(TEST_PATH, 'good_rake.rb')}" @@good_rake = "#{rubybin} #{escape_path(TEST_PATH, 'good_rake.rb')}"
@@bad_rake = "#{rubybin} #{escape_path(TEST_PATH, 'bad_rake.rb')}" @@bad_rake = "#{rubybin} #{escape_path(TEST_PATH, 'bad_rake.rb')}"

View file

@ -26,7 +26,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n" output = output.join "\n"
refute_match %r{^rake failed:}, output 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 assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output
end end
end end
@ -47,7 +47,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n" output = output.join "\n"
refute_match %r{^rake failed:}, output 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 assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output
end end
end end

View file

@ -523,11 +523,11 @@ class TestGemRequire < Gem::TestCase
File.write(dir + "/sub.rb", "#{prefix}warn 'uplevel', 'test', uplevel: 1\n") File.write(dir + "/sub.rb", "#{prefix}warn 'uplevel', 'test', uplevel: 1\n")
File.write(dir + "/main.rb", "require 'sub'\n") File.write(dir + "/main.rb", "require 'sub'\n")
_, err = capture_subprocess_io do _, 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 end
assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err) assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err)
_, err = capture_subprocess_io do _, 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 end
assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err) assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err)
end end
@ -538,11 +538,11 @@ class TestGemRequire < Gem::TestCase
Dir.mktmpdir("warn_test") do |dir| Dir.mktmpdir("warn_test") do |dir|
File.write(dir + "/main.rb", "#{prefix}warn({x:1}, {y:2}, [])\n") File.write(dir + "/main.rb", "#{prefix}warn({x:1}, {y:2}, [])\n")
_, err = capture_subprocess_io do _, 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 end
assert_match(/{:x=>1}\n{:y=>2}\n$/, err) assert_match(/{:x=>1}\n{:y=>2}\n$/, err)
_, err = capture_subprocess_io do _, 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 end
assert_match(/{:x=>1}\n{:y=>2}\n$/, err) assert_match(/{:x=>1}\n{:y=>2}\n$/, err)
end end