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

ruby-changes:71699

From: Hiroshi <ko1@a...>
Date: Tue, 12 Apr 2022 14:07:45 +0900 (JST)
Subject: [ruby-changes:71699] cdec8a29c5 (ruby_3_0): Merge Bundler-2.2.33

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

From cdec8a29c5e2e3fedc2e7726d409121d5e2890da Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Mon, 11 Apr 2022 19:45:59 +0900
Subject: Merge Bundler-2.2.33

---
 lib/bundler/cli.rb                                 |  1 +
 lib/bundler/cli/doctor.rb                          |  5 +-
 lib/bundler/cli/gem.rb                             |  1 +
 lib/bundler/cli/info.rb                            |  7 +-
 lib/bundler/cli/update.rb                          |  4 +-
 lib/bundler/compact_index_client/updater.rb        |  5 --
 lib/bundler/definition.rb                          | 67 +++++-------------
 lib/bundler/dsl.rb                                 | 21 +++++-
 lib/bundler/environment_preserver.rb               |  5 +-
 lib/bundler/lazy_specification.rb                  | 18 ++++-
 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                    |  2 +-
 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                          | 28 +++++++-
 lib/bundler/man/gemfile.5.ronn                     |  8 +++
 lib/bundler/plugin/api/source.rb                   |  1 +
 lib/bundler/resolver.rb                            |  6 +-
 lib/bundler/shared_helpers.rb                      |  5 +-
 lib/bundler/source.rb                              |  2 +-
 lib/bundler/source/git/git_proxy.rb                |  4 +-
 lib/bundler/source/rubygems.rb                     | 28 ++++----
 lib/bundler/source/rubygems_aggregate.rb           |  2 +-
 lib/bundler/source_list.rb                         | 36 ++--------
 .../templates/newgem/github/workflows/main.yml.tt  |  4 +-
 lib/bundler/templates/newgem/sig/newgem.rbs.tt     |  8 +++
 lib/bundler/vendor/.document                       |  1 +
 lib/bundler/vendor/connection_pool/LICENSE         | 20 ++++++
 lib/bundler/vendor/fileutils/LICENSE.txt           | 22 ++++++
 lib/bundler/vendor/molinillo/LICENSE               |  9 +++
 lib/bundler/vendor/net-http-persistent/README.rdoc | 82 ++++++++++++++++++++++
 lib/bundler/vendor/thor/LICENSE.md                 | 20 ++++++
 lib/bundler/vendor/tsort/LICENSE.txt               | 22 ++++++
 lib/bundler/vendor/uri/LICENSE.txt                 | 22 ++++++
 lib/bundler/version.rb                             |  2 +-
 .../bundler/compact_index_client/updater_spec.rb   | 10 ---
 spec/bundler/bundler/dsl_spec.rb                   | 39 ++++++++++
 spec/bundler/bundler/rubygems_integration_spec.rb  |  4 +-
 spec/bundler/bundler/source/git/git_proxy_spec.rb  | 28 ++++++--
 spec/bundler/commands/doctor_spec.rb               | 12 +++-
 spec/bundler/commands/exec_spec.rb                 | 12 ++--
 spec/bundler/commands/info_spec.rb                 | 13 ++++
 spec/bundler/commands/newgem_spec.rb               |  7 ++
 spec/bundler/commands/remove_spec.rb               |  4 +-
 spec/bundler/install/deploy_spec.rb                | 14 ++--
 spec/bundler/install/gemfile/path_spec.rb          | 66 +++++++++++++++++
 spec/bundler/install/gemfile/platform_spec.rb      | 43 ++++++++++++
 spec/bundler/install/gemfile/sources_spec.rb       | 12 ++--
 spec/bundler/realworld/ffi_spec.rb                 | 57 +++++++++++++++
 spec/bundler/runtime/setup_spec.rb                 | 23 ++++++
 spec/bundler/support/helpers.rb                    |  2 +-
 spec/bundler/support/indexes.rb                    |  2 +-
 spec/bundler/support/rubygems_version_manager.rb   | 12 +---
 tool/bundler/rubocop_gems.rb.lock                  |  4 +-
 tool/bundler/standard_gems.rb.lock                 |  2 +
 tool/bundler/test_gems.rb.lock                     |  3 +-
 76 files changed, 686 insertions(+), 197 deletions(-)
 create mode 100644 lib/bundler/templates/newgem/sig/newgem.rbs.tt
 create mode 100644 lib/bundler/vendor/.document
 create mode 100644 lib/bundler/vendor/connection_pool/LICENSE
 create mode 100644 lib/bundler/vendor/fileutils/LICENSE.txt
 create mode 100644 lib/bundler/vendor/molinillo/LICENSE
 create mode 100644 lib/bundler/vendor/net-http-persistent/README.rdoc
 create mode 100644 lib/bundler/vendor/thor/LICENSE.md
 create mode 100644 lib/bundler/vendor/tsort/LICENSE.txt
 create mode 100644 lib/bundler/vendor/uri/LICENSE.txt
 create mode 100644 spec/bundler/realworld/ffi_spec.rb

diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index f178560938..d271086b25 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -331,6 +331,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli.rb#L331
 
     desc "info GEM [OPTIONS]", "Show information for the given gem"
     method_option "path", :type => :boolean, :banner => "Print full path to gem"
+    method_option "version", :type => :boolean, :banner => "Print gem version"
     def info(gem_name)
       require_relative "cli/info"
       Info.new(options, gem_name).run
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb
index c28997bc7d..43f1ca92e2 100644
--- a/lib/bundler/cli/doctor.rb
+++ b/lib/bundler/cli/doctor.rb
@@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/doctor.rb#L1
 # frozen_string_literal: true
 
 require "rbconfig"
+require "shellwords"
 
 module Bundler
   class CLI::Doctor
@@ -22,14 +23,14 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/doctor.rb#L23
     end
 
     def dylibs_darwin(path)
-      output = `/usr/bin/otool -L "#{path}"`.chomp
+      output = `/usr/bin/otool -L #{path.shellescape}`.chomp
       dylibs = output.split("\n")[1..-1].map {|l| l.match(DARWIN_REGEX).captures[0] }.uniq
       # ignore @rpath and friends
       dylibs.reject {|dylib| dylib.start_with? "@" }
     end
 
     def dylibs_ldd(path)
-      output = `/usr/bin/ldd "#{path}"`.chomp
+      output = `/usr/bin/ldd #{path.shellescape}`.chomp
       output.split("\n").map do |l|
         match = l.match(LDD_REGEX)
         next if match.nil?
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 779947d642..2a74325fde 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -76,6 +76,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/gem.rb#L76
         "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
         "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
         "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
+        "sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
         "newgem.gemspec.tt" => "#{name}.gemspec",
         "Rakefile.tt" => "Rakefile",
         "README.md.tt" => "README.md",
diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
index 3afed89ceb..76c8cf60c0 100644
--- a/lib/bundler/cli/info.rb
+++ b/lib/bundler/cli/info.rb
@@ -18,6 +18,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L18
 
       if spec
         return print_gem_path(spec) if @options[:path]
+        return print_gem_version(spec) if @options[:version]
         print_gem_info(spec)
       end
     end
@@ -39,6 +40,10 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L40
       raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
     end
 
+    def print_gem_version(spec)
+      Bundler.ui.info spec.version.to_s
+    end
+
     def print_gem_path(spec)
       name = spec.name
       if name == "bundler"
@@ -70,7 +75,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L75
       gem_info << "\tPath: #{spec.full_gem_path}\n"
       gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
 
-      if spec.deleted_gem?
+      if name != "bundler" && spec.deleted_gem?
         return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
       end
 
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb
index 1adcaef67c..95a8886ea5 100644
--- a/lib/bundler/cli/update.rb
+++ b/lib/bundler/cli/update.rb
@@ -66,7 +66,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/update.rb#L66
 
       if locked_gems = Bundler.definition.locked_gems
         previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
-          h[s.name] = { :spec => s, :version => s.version, :source => s.source.to_s }
+          h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
           h
         end
       end
@@ -95,7 +95,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/update.rb#L95
           end
 
           locked_source = locked_info[:source]
-          new_source = new_spec.source.to_s
+          new_source = new_spec.source. (... truncated)

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

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