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

ruby-changes:66135

From: David <ko1@a...>
Date: Tue, 11 May 2021 11:29:57 +0900 (JST)
Subject: [ruby-changes:66135] 5b0abba931 (master): Sync bundler & rubygems

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

From 5b0abba9317f206913cf2e599d0dac7e9dbd0baa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Wed, 21 Apr 2021 13:54:29 +0200
Subject: Sync bundler & rubygems

---
 lib/bundler/bundler.gemspec                        |   5 +-
 lib/bundler/cli.rb                                 |   4 +-
 lib/bundler/cli/common.rb                          |   2 +
 lib/bundler/compact_index_client/updater.rb        |  10 +-
 lib/bundler/current_ruby.rb                        |   1 +
 lib/bundler/definition.rb                          |   6 +-
 lib/bundler/dependency.rb                          |   8 +-
 lib/bundler/fetcher.rb                             |   3 +-
 lib/bundler/fetcher/compact_index.rb               |  13 +-
 lib/bundler/fetcher/downloader.rb                  |  12 +-
 lib/bundler/man/bundle-config.1                    |  19 +-
 lib/bundler/man/bundle-config.1.ronn               |  19 +-
 lib/bundler/plugin.rb                              |   4 +-
 lib/bundler/resolver.rb                            |  35 +-
 lib/bundler/resolver/spec_group.rb                 |  24 --
 lib/bundler/retry.rb                               |   2 +-
 lib/bundler/settings.rb                            |  69 +++-
 lib/bundler/source/rubygems.rb                     |   4 +-
 lib/bundler/spec_set.rb                            |  25 +-
 lib/bundler/templates/newgem/newgem.gemspec.tt     |   2 +-
 .../molinillo/modules/specification_provider.rb    |   2 +-
 .../thor/lib/thor/actions/file_manipulation.rb     |   2 +-
 lib/rubygems.rb                                    |   2 +-
 lib/rubygems/commands/install_command.rb           |   2 +-
 lib/rubygems/commands/open_command.rb              |   2 +-
 lib/rubygems/commands/yank_command.rb              |   2 +-
 lib/rubygems/deprecate.rb                          |   4 +-
 .../molinillo/modules/specification_provider.rb    |   2 +-
 .../bundler/compact_index_client/updater_spec.rb   |   1 -
 spec/bundler/bundler/env_spec.rb                   |  14 +
 spec/bundler/bundler/fetcher/downloader_spec.rb    |   5 +
 spec/bundler/bundler/plugin/dsl_spec.rb            |   2 +-
 spec/bundler/bundler/plugin/index_spec.rb          |   2 +-
 spec/bundler/commands/cache_spec.rb                |  25 +-
 spec/bundler/commands/clean_spec.rb                |   2 +-
 spec/bundler/commands/config_spec.rb               |   8 +
 spec/bundler/commands/outdated_spec.rb             | 353 +++++++++++++++++++--
 spec/bundler/commands/pristine_spec.rb             |  10 +
 spec/bundler/commands/remove_spec.rb               |   4 +-
 spec/bundler/commands/update_spec.rb               | 295 ++++++++++++-----
 spec/bundler/install/gemfile/gemspec_spec.rb       |  53 ++++
 spec/bundler/install/gemfile/sources_spec.rb       |  11 +-
 spec/bundler/install/gems/compact_index_spec.rb    |  33 ++
 spec/bundler/install/gems/dependency_api_spec.rb   |  27 ++
 spec/bundler/install/gems/post_install_spec.rb     |   2 +-
 spec/bundler/install/prereleases_spec.rb           |   6 +-
 spec/bundler/quality_spec.rb                       |  10 +-
 spec/bundler/realworld/edgecases_spec.rb           |   8 +-
 spec/bundler/runtime/inline_spec.rb                |   2 +-
 spec/bundler/spec_helper.rb                        |  12 +-
 spec/bundler/support/artifice/compact_index.rb     |   4 +-
 ...index_partial_update_no_etag_not_incremental.rb |  40 +++
 spec/bundler/support/artifice/endpoint.rb          |  26 +-
 spec/bundler/support/artifice/windows.rb           |   4 +-
 spec/bundler/support/builders.rb                   |   7 -
 spec/bundler/support/helpers.rb                    |   4 +-
 spec/bundler/support/rubygems_ext.rb               |   2 +-
 test/rubygems/test_deprecate.rb                    |  48 ++-
 tool/bundler/rubocop_gems.rb.lock                  |   2 +-
 tool/bundler/standard_gems.rb.lock                 |   2 +-
 60 files changed, 1042 insertions(+), 267 deletions(-)
 create mode 100644 spec/bundler/support/artifice/compact_index_partial_update_no_etag_not_incremental.rb

diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec
index 9da149d..38c533b 100644
--- a/lib/bundler/bundler.gemspec
+++ b/lib/bundler/bundler.gemspec
@@ -34,9 +34,10 @@ Gem::Specification.new do |s| https://github.com/ruby/ruby/blob/trunk/lib/bundler/bundler.gemspec#L34
   s.required_ruby_version     = ">= 2.3.0"
   s.required_rubygems_version = ">= 2.5.2"
 
-  s.files = (Dir.glob("lib/bundler/**/*", File::FNM_DOTMATCH) + Dir.glob("libexec/bundle*")).reject {|f| File.directory?(f) }
+  s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
 
-  s.files += ["lib/bundler.rb"]
+  # include the gemspec itself because warbler breaks w/o it
+  s.files += %w[lib/bundler/bundler.gemspec]
 
   s.bindir        = "libexec"
   s.executables   = %w[bundle bundler]
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index b924edb..6562f3a 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -510,8 +510,8 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli.rb#L510
       By default, setting a configuration value sets it for all projects
       on the machine.
 
-      If a global setting is superceded by local configuration, this command
-      will show the current value, as well as any superceded values and
+      If a global setting is superseded by local configuration, this command
+      will show the current value, as well as any superseded values and
       where they were specified.
     D
     require_relative "cli/config"
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb
index 32d952f..ba25914 100644
--- a/lib/bundler/cli/common.rb
+++ b/lib/bundler/cli/common.rb
@@ -94,6 +94,8 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/common.rb#L94
     end
 
     def self.ensure_all_gems_in_lockfile!(names, locked_gems = Bundler.locked_gems)
+      return unless locked_gems
+
       locked_names = locked_gems.specs.map(&:name).uniq
       names.-(locked_names).each do |g|
         raise GemNotFound, gem_not_found_message(g, locked_names)
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
index b4b2321..06486f9 100644
--- a/lib/bundler/compact_index_client/updater.rb
+++ b/lib/bundler/compact_index_client/updater.rb
@@ -50,16 +50,20 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/compact_index_client/updater.rb#L50
 
           content = response.body
 
-          SharedHelpers.filesystem_access(local_temp_path) do
+          etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
+          correct_response = SharedHelpers.filesystem_access(local_temp_path) do
             if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
               local_temp_path.open("a") {|f| f << slice_body(content, 1..-1) }
+
+              etag_for(local_temp_path) == etag
             else
               local_temp_path.open("wb") {|f| f << content }
+
+              etag.length.zero? || etag_for(local_temp_path) == etag
             end
           end
 
-          etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
-          if etag.length.zero? || etag_for(local_temp_path) == etag
+          if correct_response
             SharedHelpers.filesystem_access(local_path) do
               FileUtils.mv(local_temp_path, local_path)
             end
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index c132e8e..b8c7cad 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -20,6 +20,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/current_ruby.rb#L20
       2.5
       2.6
       2.7
+      3.0
     ].freeze
 
     KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index ca5aadb..fc30dd5 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -166,16 +166,14 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L166
     end
 
     def resolve_with_cache!
-      raise "Specs already loaded" if @specs
       sources.cached!
-      specs
+      resolve
     end
 
     def resolve_remotely!
-      return if @specs
       @remote = true
       sources.remote!
-      specs
+      resolve
     end
 
     # For given dependency list returns a SpecSet with Gemspec of all the required
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index af07e8b..27206b1 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -96,15 +96,11 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/dependency.rb#L96
     def gem_platforms(valid_platforms)
       return valid_platforms if @platforms.empty?
 
-      valid_generic_platforms = valid_platforms.map {|p| [p, GemHelpers.generic(p)] }.to_h
-      @gem_platforms ||= expanded_platforms.compact.uniq
-
-      filtered_generic_platforms = valid_generic_platforms.values & @gem_platforms
-      valid_generic_platforms.select {|_, v| filtered_generic_platforms.include?(v) }.keys
+      valid_platforms.select {|p| expanded_platforms.include?(GemHelpers.generic(p)) }
     end
 
     def expanded_platforms
-      @platforms.map {|pl| PLATFORM_MAP[pl] }
+      @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
     end
 
     def should_include?
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index f9c54f7..d237837 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -47,7 +47,8 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/fetcher.rb#L47
         remote_uri = filter_uri(remote_uri)
         super "Authentication is required for #{remote_uri}.\n" \
           "Please supply credentials for this source. You can do this by running:\n" \
-          " bundle config set --glo (... truncated)

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

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