summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-05-30 20:25:29 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-05-30 21:50:07 +0900
commit4bbeed61346d6016e2d72818e8068bedcb9f006d (patch)
treeddf1b23eb0e63a47efa8cc1fc0b72652e3dac354 /lib
parent30b960ba345fd462f98db204f47bba66819d9884 (diff)
Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7873
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler.rb7
-rw-r--r--lib/bundler/definition.rb9
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--lib/bundler/lockfile_parser.rb1
-rw-r--r--lib/rubygems/commands/setup_command.rb2
5 files changed, 11 insertions, 10 deletions
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