ruby-changes:67466
From: David <ko1@a...>
Date: Tue, 31 Aug 2021 19:07:42 +0900 (JST)
Subject: [ruby-changes:67466] 71b937d3d7 (master): [rubygems/rubygems] Normalize setting `GEM_PATH`
https://git.ruby-lang.org/ruby.git/commit/?id=71b937d3d7 From 71b937d3d7f1369a55844201f31720e815d0168c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Sat, 21 Aug 2021 16:52:48 +0200 Subject: [rubygems/rubygems] Normalize setting `GEM_PATH` https://github.com/rubygems/rubygems/commit/4188ebd568 --- lib/bundler.rb | 4 ++-- spec/bundler/bundler/bundler_spec.rb | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/bundler.rb b/lib/bundler.rb index 47f1fd2..52e80c4 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -661,12 +661,12 @@ EOF https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L661 configure_gem_home end - def configure_gem_path(env = ENV) + def configure_gem_path unless use_system_gems? # this needs to be empty string to cause # PathSupport.split_gem_path to only load up the # Bundler --path setting as the GEM_PATH. - env["GEM_PATH"] = "" + Bundler::SharedHelpers.set_env "GEM_PATH", "" end end diff --git a/spec/bundler/bundler/bundler_spec.rb b/spec/bundler/bundler/bundler_spec.rb index d164b5d..b8191fe 100644 --- a/spec/bundler/bundler/bundler_spec.rb +++ b/spec/bundler/bundler/bundler_spec.rb @@ -176,11 +176,9 @@ RSpec.describe Bundler do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/bundler_spec.rb#L176 describe "configuration" do context "disable_shared_gems" do it "should unset GEM_PATH with empty string" do - env = {} expect(Bundler).to receive(:use_system_gems?).and_return(false) - Bundler.send(:configure_gem_path, env) - expect(env.keys).to include("GEM_PATH") - expect(env["GEM_PATH"]).to eq "" + Bundler.send(:configure_gem_path) + expect(ENV["GEM_PATH"]).to eq "" end end end -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/