[前][次][番号順一覧][スレッド一覧]

ruby-changes:59324

From: Hiroshi <ko1@a...>
Date: Wed, 18 Dec 2019 14:53:57 +0900 (JST)
Subject: [ruby-changes:59324] efbc0d499c (master): Merge bundler-2.1.1 from bundler/bundler

https://git.ruby-lang.org/ruby.git/commit/?id=efbc0d499c

From efbc0d499c0dc5b74698418c76e58098c6c113e1 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Wed, 18 Dec 2019 14:53:19 +0900
Subject: Merge bundler-2.1.1 from bundler/bundler


diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb
index 2bace6e..0a1edbd 100644
--- a/lib/bundler/cli/exec.rb
+++ b/lib/bundler/cli/exec.rb
@@ -25,12 +25,12 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/exec.rb#L25
       SharedHelpers.set_bundle_environment
       if bin_path = Bundler.which(cmd)
         if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
-          return with_verbose_rubygems { kernel_load(bin_path, *args) }
+          return kernel_load(bin_path, *args)
         end
-        with_verbose_rubygems { kernel_exec(bin_path, *args) }
+        kernel_exec(bin_path, *args)
       else
         # exec using the given command
-        with_verbose_rubygems { kernel_exec(cmd, *args) }
+        kernel_exec(cmd, *args)
       end
     end
 
@@ -89,14 +89,5 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/exec.rb#L89
       first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
       possibilities.any? {|shebang| first_line.start_with?(shebang) }
     end
-
-    def with_verbose_rubygems
-      old_ui = Gem::DefaultUserInteraction.ui
-      Gem::DefaultUserInteraction.ui = nil
-
-      yield
-    ensure
-      Gem::DefaultUserInteraction.ui = old_ui
-    end
   end
 end
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index bb63209..88fcd4d 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -525,6 +525,14 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/rubygems_integration.rb#L525
       end
     end
 
+    def plain_specs
+      Gem::Specification._all
+    end
+
+    def plain_specs=(specs)
+      Gem::Specification.all = specs
+    end
+
     def fetch_specs(remote, name)
       path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
       fetcher = gem_remote_fetcher
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb
index 70a0968..27911dc 100644
--- a/lib/bundler/setup.rb
+++ b/lib/bundler/setup.rb
@@ -19,4 +19,9 @@ if Bundler::SharedHelpers.in_bundle? https://github.com/ruby/ruby/blob/trunk/lib/bundler/setup.rb#L19
   else
     Bundler.ui.silence { Bundler.setup }
   end
+
+  # We might be in the middle of shelling out to rubygems
+  # (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
+  # not being silent.
+  Gem::DefaultUserInteraction.ui = nil
 end
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 417b21f..06d6a0f 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/bundler/version.rb#L1
 # frozen_string_literal: false
 
 module Bundler
-  VERSION = "2.1.0".freeze
+  VERSION = "2.1.1".freeze
 
   def self.bundler_major_version
     @bundler_major_version ||= VERSION.split(".").first.to_i
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb
index c1d6e4c..42f760a 100644
--- a/spec/bundler/commands/exec_spec.rb
+++ b/spec/bundler/commands/exec_spec.rb
@@ -61,6 +61,12 @@ RSpec.describe "bundle exec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/exec_spec.rb#L61
     expect(out).to eq(Gem::VERSION)
   end
 
+  it "works when exec'ing to rubygems through sh -c" do
+    install_gemfile 'gem "rack"'
+    bundle "exec sh -c '#{gem_cmd} --version'"
+    expect(out).to eq(Gem::VERSION)
+  end
+
   it "respects custom process title when loading through ruby" do
     script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~'RUBY'
       Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15")
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]