From cfcc7522d44680b959e08b31c6e3af36fdaaa152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 8 Oct 2024 13:54:50 +0200 Subject: [PATCH] [rubygems/rubygems] Remove more unnecessary ENV modifications https://github.com/rubygems/rubygems/commit/457b25df1a --- spec/bundler/support/helpers.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index abd162bc35..959720ed05 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -290,18 +290,16 @@ module Spec options = gems.last.is_a?(Hash) ? gems.pop : {} install_dir = options.fetch(:path, system_gem_path) default = options.fetch(:default, false) - with_gem_path_as(install_dir) do - gem_repo = options.fetch(:gem_repo, gem_repo1) - gems.each do |g| - gem_name = g.to_s - if gem_name.start_with?("bundler") - version = gem_name.match(/\Abundler-(?.*)\z/)[:version] if gem_name != "bundler" - with_built_bundler(version) {|gem_path| install_gem(gem_path, install_dir, default) } - elsif %r{\A(?:[a-zA-Z]:)?/.*\.gem\z}.match?(gem_name) - install_gem(gem_name, install_dir, default) - else - install_gem("#{gem_repo}/gems/#{gem_name}.gem", install_dir, default) - end + gems.each do |g| + gem_name = g.to_s + if gem_name.start_with?("bundler") + version = gem_name.match(/\Abundler-(?.*)\z/)[:version] if gem_name != "bundler" + with_built_bundler(version) {|gem_path| install_gem(gem_path, install_dir, default) } + elsif %r{\A(?:[a-zA-Z]:)?/.*\.gem\z}.match?(gem_name) + install_gem(gem_name, install_dir, default) + else + gem_repo = options.fetch(:gem_repo, gem_repo1) + install_gem("#{gem_repo}/gems/#{gem_name}.gem", install_dir, default) end end end