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

ruby-changes:59255

From: Hiroshi <ko1@a...>
Date: Sun, 15 Dec 2019 16:41:35 +0900 (JST)
Subject: [ruby-changes:59255] 38002a8adb (master): Prepare to release bundler-2.1.0

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

From 38002a8adbd98266426940d829429a30af0622a4 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Sat, 14 Dec 2019 19:49:16 +0900
Subject: Prepare to release bundler-2.1.0


diff --git a/lib/bundler.rb b/lib/bundler.rb
index 3b494a6..df34553 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -50,7 +50,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L50
   autoload :FeatureFlag,            File.expand_path("bundler/feature_flag", __dir__)
   autoload :GemHelper,              File.expand_path("bundler/gem_helper", __dir__)
   autoload :GemHelpers,             File.expand_path("bundler/gem_helpers", __dir__)
-  autoload :GemRemoteFetcher,       File.expand_path("bundler/gem_remote_fetcher", __dir__)
   autoload :GemVersionPromoter,     File.expand_path("bundler/gem_version_promoter", __dir__)
   autoload :Graph,                  File.expand_path("bundler/graph", __dir__)
   autoload :Index,                  File.expand_path("bundler/index", __dir__)
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index d7f749a..443458f 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -783,7 +783,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli.rb#L783
       return unless SharedHelpers.md5_available?
 
       latest = Fetcher::CompactIndex.
-               new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
+               new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
                send(:compact_index_client).
                instance_variable_get(:@cache).
                dependencies("bundler").
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
index 78e035a..8d2aba0 100644
--- a/lib/bundler/cli/config.rb
+++ b/lib/bundler/cli/config.rb
@@ -25,7 +25,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/config.rb#L25
           ["config", "get", ARGV[1]]
         end
 
-      SharedHelpers.major_deprecation 2,
+      SharedHelpers.major_deprecation 3,
         "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
 
       Base.new(options, name, value, self).run
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb
index 0a1edbd..2bace6e 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 kernel_load(bin_path, *args)
+          return with_verbose_rubygems { kernel_load(bin_path, *args) }
         end
-        kernel_exec(bin_path, *args)
+        with_verbose_rubygems { kernel_exec(bin_path, *args) }
       else
         # exec using the given command
-        kernel_exec(cmd, *args)
+        with_verbose_rubygems { kernel_exec(cmd, *args) }
       end
     end
 
@@ -89,5 +89,14 @@ 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/cli/update.rb b/lib/bundler/cli/update.rb
index afd386b..529dd9c 100644
--- a/lib/bundler/cli/update.rb
+++ b/lib/bundler/cli/update.rb
@@ -22,7 +22,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/update.rb#L22
         if Bundler.feature_flag.update_requires_all_flag?
           raise InvalidOption, "To update everything, pass the `--all` flag."
         end
-        SharedHelpers.major_deprecation 2, "Pass --all to `bundle update` to update everything"
+        SharedHelpers.major_deprecation 3, "Pass --all to `bundle update` to update everything"
       elsif !full_update && options[:all]
         raise InvalidOption, "Cannot specify --all along with specific options."
       end
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 5e1932e..01739ec 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -46,7 +46,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/feature_flag.rb#L46
     settings_flag(:specific_platform) { bundler_3_mode? }
     settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
     settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
-    settings_flag(:update_requires_all_flag) { bundler_3_mode? }
+    settings_flag(:update_requires_all_flag) { bundler_4_mode? }
     settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
 
     settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 7bda267..caf33bc 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -97,7 +97,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/fetcher.rb#L97
       spec -= [nil, "ruby", ""]
       spec_file_name = "#{spec.join "-"}.gemspec"
 
-      uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
+      uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
       if uri.scheme == "file"
         path = Bundler.rubygems.correct_for_windows_path(uri.path)
         Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
@@ -244,7 +244,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/fetcher.rb#L244
 
         con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
         if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
-          con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
+          con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
         end
 
         if remote_uri.scheme == "https"
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
index 73f125a..498852c 100644
--- a/lib/bundler/fetcher/downloader.rb
+++ b/lib/bundler/fetcher/downloader.rb
@@ -21,7 +21,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/fetcher/downloader.rb#L21
         when Net::HTTPSuccess, Net::HTTPNotModified
           response
         when Net::HTTPRedirection
-          new_uri = URI.parse(response["location"])
+          new_uri = Bundler::URI.parse(response["location"])
           if new_uri.host == uri.host
             new_uri.user = uri.user
             new_uri.password = uri.password
diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb
index d2ad657..034a225 100644
--- a/lib/bundler/fetcher/index.rb
+++ b/lib/bundler/fetcher/index.rb
@@ -28,7 +28,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/fetcher/index.rb#L28
         spec -= [nil, "ruby", ""]
         spec_file_name = "#{spec.join "-"}.gemspec"
 
-        uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
+        uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
         if uri.scheme == "file"
           path = Bundler.rubygems.correct_for_windows_path(uri.path)
           Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index 273573e..080697b 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -1,6 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/lib/bundler/friendly_errors.rb#L1
 # frozen_string_literal: true
 
-require "cgi"
 require_relative "vendored_thor"
 
 module Bundler
@@ -114,6 +113,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/friendly_errors.rb#L113
     def issues_url(exception)
       message = exception.message.lines.first.tr(":", " ").chomp
       message = message.split("-").first if exception.is_a?(Errno)
+      require "cgi"
       "https://github.com/bundler/bundler/search?q=" \
         "#{CGI.escape(message)}&type=Issues"
     end
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 46a6643..7d4e382 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -73,8 +73,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/gem_helper.rb#L73
 
     def build_gem
       file_name = nil
-      gem = ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
-      sh("#{gem} build -V #{spec_path}".shellsplit) do
+      sh("#{gem_command} build -V #{spec_path}".shellsplit) do
         file_name = File.basename(built_gem_path)
         SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
         FileUtils.mv(built_gem_path, "pkg")
@@ -85,11 +84,10 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/gem_helper.rb#L84
 
     def install_gem(built_gem_path = nil, local = false)
       built_gem_path ||= build_gem
-      gem = ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
-      cmd = "#{gem} install #{built_gem_path}"
+      cmd = "#{gem_command} install #{built_gem_path}"
       cmd += " --local" if local
-      out, status = sh_with_status(cmd.shellsplit)
-      unless status.success? && out[/Successfully installed/]
+      _, status = sh_with_status(cmd.shellsplit)
+      unless status.success?
         raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
       end
       Bundler.ui.confirm "#{name} (#{version}) installed."
@@ -98,13 +96,13 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/gem_helper.rb#L96
   protected
 
     def rubygem_push(path (... truncated)

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

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