ruby-changes:69844
From: Hiroshi <ko1@a...>
Date: Mon, 22 Nov 2021 10:51:57 +0900 (JST)
Subject: [ruby-changes:69844] 31a7104852 (ruby_3_0): Merge RubyGems 3.2.27 and Bundler 2.2.27
https://git.ruby-lang.org/ruby.git/commit/?id=31a7104852 From 31a71048521224774bdb8b5982ab73eb35dad66d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Thu, 11 Nov 2021 10:40:30 +0900 Subject: Merge RubyGems 3.2.27 and Bundler 2.2.27 --- lib/bundler.rb | 28 +++--- lib/bundler/cli/check.rb | 2 +- lib/bundler/definition.rb | 6 ++ lib/bundler/installer.rb | 1 - lib/bundler/plugin.rb | 29 ++++-- lib/bundler/plugin/installer.rb | 2 + lib/bundler/rubygems_integration.rb | 2 + lib/bundler/settings.rb | 10 +- lib/bundler/source.rb | 2 + lib/bundler/source/rubygems.rb | 9 +- lib/bundler/source_list.rb | 4 + lib/bundler/spec_set.rb | 2 +- .../templates/newgem/github/workflows/main.yml.tt | 3 +- lib/bundler/version.rb | 2 +- lib/rubygems.rb | 30 +++--- lib/rubygems/command_manager.rb | 6 +- lib/rubygems/commands/build_command.rb | 6 +- lib/rubygems/commands/cert_command.rb | 4 +- lib/rubygems/commands/check_command.rb | 8 +- lib/rubygems/commands/cleanup_command.rb | 6 +- lib/rubygems/commands/contents_command.rb | 4 +- lib/rubygems/commands/dependency_command.rb | 6 +- lib/rubygems/commands/environment_command.rb | 2 +- lib/rubygems/commands/fetch_command.rb | 6 +- lib/rubygems/commands/generate_index_command.rb | 4 +- lib/rubygems/commands/help_command.rb | 2 +- lib/rubygems/commands/info_command.rb | 4 +- lib/rubygems/commands/install_command.rb | 23 ++--- lib/rubygems/commands/list_command.rb | 4 +- lib/rubygems/commands/lock_command.rb | 2 +- lib/rubygems/commands/mirror_command.rb | 2 +- lib/rubygems/commands/open_command.rb | 4 +- lib/rubygems/commands/outdated_command.rb | 8 +- lib/rubygems/commands/owner_command.rb | 8 +- lib/rubygems/commands/pristine_command.rb | 10 +- lib/rubygems/commands/push_command.rb | 8 +- lib/rubygems/commands/query_command.rb | 6 +- lib/rubygems/commands/rdoc_command.rb | 6 +- lib/rubygems/commands/search_command.rb | 4 +- lib/rubygems/commands/server_command.rb | 6 +- lib/rubygems/commands/setup_command.rb | 10 +- lib/rubygems/commands/signin_command.rb | 4 +- lib/rubygems/commands/signout_command.rb | 2 +- lib/rubygems/commands/sources_command.rb | 8 +- lib/rubygems/commands/specification_command.rb | 8 +- lib/rubygems/commands/stale_command.rb | 2 +- lib/rubygems/commands/uninstall_command.rb | 6 +- lib/rubygems/commands/unpack_command.rb | 10 +- lib/rubygems/commands/update_command.rb | 18 ++-- lib/rubygems/commands/which_command.rb | 2 +- lib/rubygems/commands/yank_command.rb | 8 +- lib/rubygems/config_file.rb | 2 +- lib/rubygems/dependency_installer.rb | 16 ++-- lib/rubygems/dependency_list.rb | 2 +- lib/rubygems/doctor.rb | 4 +- lib/rubygems/exceptions.rb | 2 +- lib/rubygems/gem_runner.rb | 6 +- lib/rubygems/gemcutter_utilities.rb | 4 +- lib/rubygems/indexer.rb | 4 +- lib/rubygems/install_default_message.rb | 4 +- lib/rubygems/install_message.rb | 4 +- lib/rubygems/install_update_options.rb | 4 +- lib/rubygems/installer.rb | 14 +-- lib/rubygems/local_remote_options.rb | 2 +- lib/rubygems/mock_gem_ui.rb | 2 +- lib/rubygems/package.rb | 24 ++--- lib/rubygems/package/tar_reader.rb | 2 +- lib/rubygems/package_task.rb | 4 +- lib/rubygems/platform.rb | 2 +- lib/rubygems/rdoc.rb | 2 +- lib/rubygems/remote_fetcher.rb | 34 +++---- lib/rubygems/request.rb | 10 +- lib/rubygems/request_set.rb | 8 +- lib/rubygems/request_set/lockfile.rb | 2 +- lib/rubygems/request_set/lockfile/tokenizer.rb | 2 +- lib/rubygems/requirement.rb | 2 +- lib/rubygems/resolver.rb | 62 ++++++------- lib/rubygems/resolver/git_specification.rb | 2 +- lib/rubygems/resolver/installer_set.rb | 6 +- lib/rubygems/resolver/molinillo.rb | 2 +- lib/rubygems/resolver/specification.rb | 2 +- lib/rubygems/security.rb | 10 +- lib/rubygems/security/policy.rb | 2 +- lib/rubygems/security/signer.rb | 2 +- lib/rubygems/security_option.rb | 4 +- lib/rubygems/server.rb | 4 +- lib/rubygems/source.rb | 12 +-- lib/rubygems/spec_fetcher.rb | 10 +- lib/rubygems/specification.rb | 18 ++-- lib/rubygems/specification_policy.rb | 2 +- lib/rubygems/uninstaller.rb | 12 +-- lib/rubygems/uri.rb | 102 +++++++++++++++++++++ lib/rubygems/uri_parser.rb | 34 ------- lib/rubygems/uri_parsing.rb | 23 ----- lib/rubygems/user_interaction.rb | 4 +- lib/rubygems/util/licenses.rb | 2 +- lib/rubygems/validator.rb | 4 +- lib/rubygems/version_option.rb | 2 +- spec/bundler/bundler/bundler_spec.rb | 6 +- spec/bundler/bundler/env_spec.rb | 14 +++ spec/bundler/bundler/plugin_spec.rb | 7 ++ spec/bundler/commands/check_spec.rb | 52 +++++++++++ spec/bundler/commands/config_spec.rb | 8 ++ spec/bundler/plugins/command_spec.rb | 6 +- spec/bundler/plugins/install_spec.rb | 21 ++++- test/rubygems/test_gem_commands_install_command.rb | 25 +++++ test/rubygems/test_gem_remote_fetcher.rb | 30 ++++++ test/rubygems/test_gem_request.rb | 34 ++++++- test/rubygems/test_gem_resolver_installer_set.rb | 18 ++++ test/rubygems/test_gem_uri.rb | 32 +++++++ tool/bundler/rubocop_gems.rb.lock | 2 +- tool/bundler/test_gems.rb.lock | 2 +- 112 files changed, 702 insertions(+), 397 deletions(-) create mode 100644 lib/rubygems/uri.rb delete mode 100644 lib/rubygems/uri_parser.rb delete mode 100644 lib/rubygems/uri_parsing.rb create mode 100644 test/rubygems/test_gem_uri.rb diff --git a/lib/bundler.rb b/lib/bundler.rb index 439c8cbb868..a7676cd497b 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -636,6 +636,12 @@ EOF https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L636 @rubygems = nil end + def configure_gem_home_and_path(path = bundle_path) + configure_gem_path + configure_gem_home(path) + Bundler.rubygems.clear_paths + end + private def eval_yaml_gemspec(path, contents) @@ -656,29 +662,17 @@ EOF https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L662 raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents) end - def configure_gem_home_and_path - configure_gem_path - configure_gem_home - bundle_path - end - - def configure_gem_path(env = ENV) - blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty? - if !use_system_gems? + def configure_gem_path + unless use_system_gems? # this needs to be empty string to cause # PathSupport.split_gem_path to only load up the # Bundler --path setting as the GEM_PATH. - env["GEM_PATH"] = "" - elsif blank_home - possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path] - paths = possibles.flatten.compact.uniq.reject(&:empty?) - env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR) + Bundler::SharedHelpers.set_env "GEM_PATH", "" end end - def configure_gem_home - Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root) - Bundler.rubygems.clear_paths + def configure_gem_home(path) + Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s end def tmp_home_path diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb index 4221fc7f2b4..65c51337d2f 100644 --- a/lib/bundler/cli/check.rb +++ b/lib/bundler/cli/check.rb @@ -15,7 +15,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/check.rb#L15 definition.validate_runtime! begin - definition.resolve_with_cache! + definition.resolve_only_locally! not_installed = definition.missing_specs rescue GemNotFound, VersionConflict Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies." diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 673bf376986..4a27c438f5f 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -161,6 +161,12 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L161 @multisource_allowed end + def resolv (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/