[rubygems/rubygems] Remove more unnecessary ENV modifications

https://github.com/rubygems/rubygems/commit/457b25df1a
This commit is contained in:
David Rodríguez 2024-10-08 13:54:50 +02:00 committed by git
parent 6bd79e53cd
commit cfcc7522d4

View File

@ -290,18 +290,16 @@ module Spec
options = gems.last.is_a?(Hash) ? gems.pop : {} options = gems.last.is_a?(Hash) ? gems.pop : {}
install_dir = options.fetch(:path, system_gem_path) install_dir = options.fetch(:path, system_gem_path)
default = options.fetch(:default, false) default = options.fetch(:default, false)
with_gem_path_as(install_dir) do gems.each do |g|
gem_repo = options.fetch(:gem_repo, gem_repo1) gem_name = g.to_s
gems.each do |g| if gem_name.start_with?("bundler")
gem_name = g.to_s version = gem_name.match(/\Abundler-(?<version>.*)\z/)[:version] if gem_name != "bundler"
if gem_name.start_with?("bundler") with_built_bundler(version) {|gem_path| install_gem(gem_path, install_dir, default) }
version = gem_name.match(/\Abundler-(?<version>.*)\z/)[:version] if gem_name != "bundler" elsif %r{\A(?:[a-zA-Z]:)?/.*\.gem\z}.match?(gem_name)
with_built_bundler(version) {|gem_path| install_gem(gem_path, install_dir, default) } install_gem(gem_name, install_dir, default)
elsif %r{\A(?:[a-zA-Z]:)?/.*\.gem\z}.match?(gem_name) else
install_gem(gem_name, install_dir, default) gem_repo = options.fetch(:gem_repo, gem_repo1)
else install_gem("#{gem_repo}/gems/#{gem_name}.gem", install_dir, default)
install_gem("#{gem_repo}/gems/#{gem_name}.gem", install_dir, default)
end
end end
end end
end end