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

ruby-changes:65119

From: Hiroshi <ko1@a...>
Date: Tue, 2 Feb 2021 21:30:30 +0900 (JST)
Subject: [ruby-changes:65119] cc51cfabfd (ruby_3_0): Merge Bundler-2.2.7

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

From cc51cfabfd0592dd49d4a8ad4bc78e0520128e72 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Tue, 2 Feb 2021 20:23:14 +0900
Subject: Merge Bundler-2.2.7

---
 lib/bundler/cli/cache.rb                           |   1 +
 lib/bundler/definition.rb                          |   1 +
 lib/bundler/feature_flag.rb                        |   1 -
 lib/bundler/fetcher.rb                             |   1 -
 lib/bundler/gem_helper.rb                          |  14 +-
 lib/bundler/installer.rb                           |  17 --
 lib/bundler/installer/standalone.rb                |  14 ++
 lib/bundler/lazy_specification.rb                  |   2 +-
 lib/bundler/man/bundle-add.1                       |   2 +-
 lib/bundler/man/bundle-binstubs.1                  |   2 +-
 lib/bundler/man/bundle-cache.1                     |   2 +-
 lib/bundler/man/bundle-check.1                     |   2 +-
 lib/bundler/man/bundle-clean.1                     |   2 +-
 lib/bundler/man/bundle-config.1                    |   8 +-
 lib/bundler/man/bundle-config.1.ronn               |   6 +-
 lib/bundler/man/bundle-doctor.1                    |   2 +-
 lib/bundler/man/bundle-exec.1                      |   2 +-
 lib/bundler/man/bundle-gem.1                       |   2 +-
 lib/bundler/man/bundle-info.1                      |   2 +-
 lib/bundler/man/bundle-init.1                      |   2 +-
 lib/bundler/man/bundle-inject.1                    |   2 +-
 lib/bundler/man/bundle-install.1                   |   2 +-
 lib/bundler/man/bundle-list.1                      |   2 +-
 lib/bundler/man/bundle-lock.1                      |   2 +-
 lib/bundler/man/bundle-open.1                      |   2 +-
 lib/bundler/man/bundle-outdated.1                  |   2 +-
 lib/bundler/man/bundle-platform.1                  |   2 +-
 lib/bundler/man/bundle-pristine.1                  |   2 +-
 lib/bundler/man/bundle-remove.1                    |   2 +-
 lib/bundler/man/bundle-show.1                      |   2 +-
 lib/bundler/man/bundle-update.1                    |   2 +-
 lib/bundler/man/bundle-viz.1                       |   2 +-
 lib/bundler/man/bundle.1                           |   2 +-
 lib/bundler/man/gemfile.5                          |   2 +-
 lib/bundler/resolver.rb                            |  49 +++--
 lib/bundler/resolver/spec_group.rb                 |   5 +-
 lib/bundler/settings.rb                            |   2 +-
 lib/bundler/source/git.rb                          |   2 +-
 lib/bundler/source/rubygems.rb                     |   1 -
 .../molinillo/delegates/specification_provider.rb  |   7 +
 .../vendor/molinillo/lib/molinillo/errors.rb       |   2 +-
 .../molinillo/modules/specification_provider.rb    |  11 ++
 .../vendor/molinillo/lib/molinillo/resolution.rb   |   2 +-
 lib/bundler/version.rb                             |   2 +-
 spec/bundler/bundler/cli_spec.rb                   |   4 +-
 spec/bundler/bundler/gem_helper_spec.rb            |   8 +
 spec/bundler/cache/git_spec.rb                     |   2 +-
 spec/bundler/commands/cache_spec.rb                |  13 ++
 spec/bundler/commands/update_spec.rb               |  13 +-
 spec/bundler/install/bundler_spec.rb               |  70 +++++---
 spec/bundler/install/gemfile/git_spec.rb           |  18 ++
 spec/bundler/install/gems/resolving_spec.rb        |   9 +-
 spec/bundler/install/gems/standalone_spec.rb       |  24 +++
 spec/bundler/realworld/double_check_spec.rb        |   2 +-
 spec/bundler/realworld/edgecases_spec.rb           | 199 ++++++++++++++++++++-
 spec/bundler/realworld/parallel_spec.rb            |   2 +-
 spec/bundler/runtime/platform_spec.rb              |  18 +-
 spec/bundler/spec_helper.rb                        |   3 +-
 spec/bundler/support/helpers.rb                    |   2 -
 spec/bundler/support/sometimes.rb                  |  57 ------
 60 files changed, 438 insertions(+), 202 deletions(-)
 delete mode 100644 spec/bundler/support/sometimes.rb

diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb
index c14c887..9cd6133 100644
--- a/lib/bundler/cli/cache.rb
+++ b/lib/bundler/cli/cache.rb
@@ -30,6 +30,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/cache.rb#L30
       require_relative "install"
       options = self.options.dup
       options["local"] = false if Bundler.settings[:cache_all_platforms]
+      options["no-cache"] = true
       Bundler::CLI::Install.new(options).run
     end
 
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 7683047..9f9a938 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -913,6 +913,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L913
       metadata_dependencies.each do |dep|
         source_requirements[dep.name] = sources.metadata_source
       end
+      source_requirements[:default_bundler] = source_requirements["bundler"] || source_requirements[:default]
       source_requirements["bundler"] = sources.metadata_source # needs to come last to override
       source_requirements
     end
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index a92ec87..a1b443b 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -27,7 +27,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/feature_flag.rb#L27
 
     (1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
 
-    settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
     settings_flag(:allow_offline_install) { bundler_3_mode? }
     settings_flag(:auto_clean_without_path) { bundler_3_mode? }
     settings_flag(:cache_all) { bundler_3_mode? }
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 235eb9b..0c81c54 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -137,7 +137,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/fetcher.rb#L137
       end
 
       specs.each do |name, version, platform, dependencies, metadata|
-        next if name == "bundler"
         spec = if dependencies
           EndpointSpecification.new(name, version, platform, dependencies, metadata)
         else
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 0acaa69..d3e3012 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -116,19 +116,21 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/gem_helper.rb#L116
 
     def git_push(remote = nil)
       remote ||= default_remote
-      perform_git_push remote
+      perform_git_push "#{remote} refs/heads/#{current_branch}"
       perform_git_push "#{remote} refs/tags/#{version_tag}"
       Bundler.ui.confirm "Pushed git commits and release tag."
     end
 
     def default_remote
-      # We can replace this with `git branch --show-current` once we drop support for git < 2.22.0
-      current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).gsub(%r{\Aheads/}, "").strip
+      remote_for_branch, status = sh_with_status(%W[git config --get branch.#{current_branch}.remote])
+      return "origin" unless status.success?
 
-      remote_for_branch = sh(%W[git config --get branch.#{current_branch}.remote]).strip
-      return "origin" if remote_for_branch.empty?
+      remote_for_branch.strip
+    end
 
-      remote_for_branch
+    def current_branch
+      # We can replace this with `git branch --show-current` once we drop support for git < 2.22.0
+      sh(%w[git rev-parse --abbrev-ref HEAD]).gsub(%r{\Aheads/}, "").strip
     end
 
     def allowed_push_host
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 048b078..8d55784 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -82,7 +82,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/installer.rb#L82
 
         if resolve_if_needed(options)
           ensure_specs_are_compatible!
-          warn_on_incompatible_bundler_deps
           load_plugins
           options.delete(:jobs)
         else
@@ -265,22 +264,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/installer.rb#L264
       end
     end
 
-    def warn_on_incompatible_bundler_deps
-      bundler_version = Gem::Version.create(Bundler::VERSION)
-      @definition.specs.each do |spec|
-        spec.dependencies.each do |dep|
-          next if dep.type == :development
-          next unless dep.name == "bundler".freeze
-          next if dep.requirement.satisfied_by?(bundler_version)
-
-          Bundler.ui.warn "#{spec.name} (#{spec.version}) has dependency" \
-            " #{SharedHelpers.pretty_dependency(dep)}" \
-            ", which is unsatisfied by the current bundler version #{VERSION}" \
-            ", so the dependency is being ignored"
-        end
-      end
-    end
-
     def install_in_parallel(size, standalone, force = false)
       spec_installations = ParallelInstaller.call(self, @definition.specs, size, standalone, force)
       spec_installations.each do |installation|
diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb
index 0720d6d..11d5c49 100644
--- a/lib/bundler/installer/standalone.rb
+++ b/lib/bundler/installer/standalone.rb
@@ -15,6 +15,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/installer/standalone.rb#L15
         file.puts "ruby_engine = RUBY_ENGINE"
         file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
         file.puts "path = File.expand_path('..', __FILE__)"
+        file.puts reverse_rubygems_kernel_mixin
         paths.each do |path|
           file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
         end
@@ -48,5 +49,18 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/installer/standalone.rb#L49
       error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
       raise Gem::InvalidSpecificationException.new(error_message)
     end
+
+    def reverse_r (... truncated)

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

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