ruby-changes:73775
From: David <ko1@a...>
Date: Thu, 29 Sep 2022 03:42:09 +0900 (JST)
Subject: [ruby-changes:73775] 00a040dda3 (master): [rubygems/rubygems] Little refactor to keep things consistent
https://git.ruby-lang.org/ruby.git/commit/?id=00a040dda3 From 00a040dda3bd2955aa6f470578d639b3c4fc3220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Sat, 4 Dec 2021 14:00:02 +0100 Subject: [rubygems/rubygems] Little refactor to keep things consistent https://github.com/rubygems/rubygems/commit/3934deb4e4 --- test/rubygems/helper.rb | 4 ++++ test/rubygems/test_gem.rb | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 5eae310222..1ab23c2983 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -1297,6 +1297,10 @@ Also, a list: https://github.com/ruby/ruby/blob/trunk/test/rubygems/helper.rb#L1297 $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) } end + def bundler_path + $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/bundler.rb") }) } + end + def with_clean_path_to_ruby orig_ruby = Gem.ruby diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index f3a543dd05..8ed374eb0b 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1676,8 +1676,6 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1676 end end - BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) } - def add_bundler_full_name(names) names << "bundler-#{Bundler::VERSION}".freeze names.sort! @@ -1708,7 +1706,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1706 with_rubygems_gemdeps("-") do new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR) - new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}" + new_RUBYOPT = "-I#{rubygems_path} -I#{bundler_path}" path = File.join @tempdir, "gem.deps.rb" @@ -1759,7 +1757,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1757 Dir.mkdir "sub1" new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR) - new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}" + new_RUBYOPT = "-I#{rubygems_path} -I#{bundler_path}" path = File.join @tempdir, "gem.deps.rb" -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/