From 4bbeed61346d6016e2d72818e8068bedcb9f006d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 30 May 2023 20:25:29 +0900 Subject: Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285 --- lib/bundler.rb | 7 ++++--- lib/bundler/definition.rb | 9 ++++----- lib/bundler/installer.rb | 2 +- lib/bundler/lockfile_parser.rb | 1 + lib/rubygems/commands/setup_command.rb | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/bundler.rb b/lib/bundler.rb index 69370e81a7..f83268e9cd 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -210,9 +210,10 @@ module Bundler end def frozen_bundle? - frozen = settings[:deployment] - frozen ||= settings[:frozen] - frozen + frozen = settings[:frozen] + return frozen unless frozen.nil? + + settings[:deployment] end def locked_gems diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 3249fb09dc..1444cc2b0a 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -361,10 +361,8 @@ module Bundler "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control." unless explicit_flag - suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any? - "bundle config unset frozen" - elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any? - "bundle config unset deployment" + suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env) + "bundle config set frozen false" end msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \ "freeze \nby running `#{suggested_command}`." if suggested_command @@ -886,7 +884,8 @@ module Bundler if preserve_unknown_sections sections_to_ignore = LockfileParser.sections_to_ignore(@locked_bundler_version) sections_to_ignore += LockfileParser.unknown_sections_in_lockfile(current) - sections_to_ignore += LockfileParser::ENVIRONMENT_VERSION_SECTIONS + sections_to_ignore << LockfileParser::RUBY + sections_to_ignore << LockfileParser::BUNDLED unless @unlocking_bundler pattern = /#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/ whitespace_cleanup = /\n{2,}/ current = current.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 680e812ac8..59b6a6ad22 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -90,7 +90,7 @@ module Bundler Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available - lock unless Bundler.frozen_bundle? + lock Standalone.new(options[:standalone], @definition).generate if options[:standalone] end end diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index 97cbf211ba..7360a36752 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -26,6 +26,7 @@ module Bundler KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze + deprecate_constant(:ENVIRONMENT_VERSION_SECTIONS) def self.sections_in_lockfile(lockfile_contents) lockfile_contents.scan(/^\w[\w ]*$/).uniq diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index c2b681c60d..c35d0f5ccc 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -245,7 +245,7 @@ By default, this RubyGems will install gem as: def install_executables(bin_dir) prog_mode = options[:prog_mode] || 0o755 - executables = { "gem" => "bin" } + executables = { "gem" => "exe" } executables.each do |tool, path| say "Installing #{tool} executable" if @verbose -- cgit v1.2.3