rubygems-update 4.0.23 → 4.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2260352c2624a3ae9cf0e6097f01885b629db9bc4bb4896e8ba2553ecf18f49d
4
- data.tar.gz: da371b40f613b3681bcc75cbc9f1a13e4813ee7bfd1f7808ebaf41d76080d8db
3
+ metadata.gz: 12a02c6521aff4409e80855dadfcdb2d47008984e7e9b469e4be1d747160a981
4
+ data.tar.gz: 8e53022237b43998ae24f8c8860b6cb10438a4ccc0fb51f95f4e43a449857f57
5
5
  SHA512:
6
- metadata.gz: 4f7bc18982adcbcf73382c37cea141c266e0d5fd1b2c3814c337fc04cac281f6d774c129312665dafad70fb8aa65e69ba389c8bd7dabd315d5feb8988e9f00ca
7
- data.tar.gz: 4f4be770ef448f4ab13a3bccf91305148edc604327190c0dccbbdcab3ebf36bb46af49b1b2681e2922b792cb75e7c82301dce04371ef79e840190eb4d6d61670
6
+ metadata.gz: c0efca98d58afb043fcd127dbccdf77d465b555473891fa19214745ce7b0b55312982cd694ac96a7c0b5311df89865fa5a813a990afad52091fb055bc625e9d2
7
+ data.tar.gz: 1100a548b7b270a14f9cea5dbb1cb9d8b71da3991ca501862c32028a2ba1816c9300cbbbe1f66ff89dca5a9bb6dc17fa8fe08e4375ed7e1035da1825542058ed
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.24 / 2026-11-05
4
+
5
+ ### Enhancements:
6
+
7
+ * Installs bundler 4.0.24 as a default gem.
8
+
9
+ ### Bug fixes:
10
+
11
+ * Skip executable removal gracefully when the bin directory is missing. Pull request [#9963](https://github.com/ruby/rubygems/pull/9963) by Evan Li and Hiroshi SHIBATA
12
+ * Fix file locks letting multiple processes in when lock files are removed. Pull request [#9930](https://github.com/ruby/rubygems/pull/9930) by Richard Janita and Hiroshi SHIBATA
13
+ * Turn off echo before printing the password prompt. Pull request [#9969](https://github.com/ruby/rubygems/pull/9969) by Mike Dalessio
14
+
15
+ ### Documentation:
16
+
17
+ * [DOC] Fix link. Pull request [#10014](https://github.com/ruby/rubygems/pull/10014) by Burdette Lamar
18
+
3
19
  ## 4.0.23 / 2026-10-14
4
20
 
5
21
  ### Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.24 / 2026-11-05
4
+
5
+ ### Enhancements:
6
+
7
+ * Read the Ruby version from mise's inline table form. Pull request [#9991](https://github.com/ruby/rubygems/pull/9991) by Hiroshi SHIBATA
8
+ * Report which locked gems can't be materialized for the current platform. Pull request [#9738](https://github.com/ruby/rubygems/pull/9738) by Muhammad Moussa
9
+
10
+ ### Bug fixes:
11
+
12
+ * Fix `bundle exec` with no arguments for paths containing spaces. Pull request [#9996](https://github.com/ruby/rubygems/pull/9996) by Brandon Weiss
13
+ * Respect enclosing platforms and install_if for gemspec development dependencies. Pull request [#9992](https://github.com/ruby/rubygems/pull/9992) by Hiroshi SHIBATA
14
+ * Respect enclosing group and platforms for gemspec dependencies. Pull request [#9990](https://github.com/ruby/rubygems/pull/9990) by Denis Talakevich
15
+ * Don't report locked gems in the cooldown summary. Pull request [#9981](https://github.com/ruby/rubygems/pull/9981) by Patrik Ragnarsson
16
+ * Make `Bundler::Source::Rubygems#hash` agree with `eql?`. Pull request [#9983](https://github.com/ruby/rubygems/pull/9983) by Hiroshi SHIBATA
17
+ * Add checksums after platform changes in `bundle lock`. Pull request [#9960](https://github.com/ruby/rubygems/pull/9960) by Farid Zakaria
18
+ * Apply BUNDLE_RETRY to lazy gemspec downloads. Pull request [#9868](https://github.com/ruby/rubygems/pull/9868) by Islam Elsayed
19
+ * Fix file locks letting multiple processes in when lock files are removed. Pull request [#9930](https://github.com/ruby/rubygems/pull/9930) by Richard Janita and Hiroshi SHIBATA
20
+
3
21
  ## 4.0.23 / 2026-10-14
4
22
 
5
23
  ### Enhancements:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2026-10-14".freeze
8
- @git_commit_sha = "642a23e".freeze
7
+ @built_at = "2026-11-05".freeze
8
+ @git_commit_sha = "3b396e4".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -24,7 +24,7 @@ module Bundler
24
24
  kernel_load(bin_path, *args)
25
25
  else
26
26
  bin_path = explicit_path(bin_path)
27
- kernel_exec(bin_path, *args)
27
+ kernel_exec([bin_path, bin_path], *args)
28
28
  end
29
29
  else
30
30
  # exec using the given command
@@ -43,7 +43,6 @@ module Bundler
43
43
 
44
44
  Bundler.settings.temporary(frozen: false) do
45
45
  definition = Bundler.definition(update, Bundler.default_lockfile)
46
- definition.add_checksums if options["add-checksums"]
47
46
 
48
47
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
49
48
 
@@ -65,6 +64,11 @@ module Bundler
65
64
  raise InvalidOption, "Removing all platforms from the bundle is not allowed"
66
65
  end
67
66
 
67
+ # Adding checksums resolves the bundle to fetch them, so it has to
68
+ # run after every platform change above has been recorded, or the
69
+ # new platforms are listed in the lockfile without their specs.
70
+ definition.add_checksums if options["add-checksums"]
71
+
68
72
  definition.remotely! unless options[:local]
69
73
 
70
74
  if options["normalize-platforms"]
@@ -748,7 +748,9 @@ module Bundler
748
748
  loop do
749
749
  break if incomplete_specs.empty?
750
750
 
751
- Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
751
+ Bundler.ui.debug("The lockfile does not have all gems needed for the current platform (#{Bundler.local_platform}) though, " \
752
+ "Bundler will still re-resolve dependencies. The following locked gems could not be materialized for it: " \
753
+ "#{incomplete_specs.map(&:full_name).join(", ")}")
752
754
  sources.remote!
753
755
  reresolve_without(incomplete_specs)
754
756
  specs = resolve.materialize(dependencies)
@@ -80,11 +80,15 @@ module Bundler
80
80
  @gemspecs << spec
81
81
 
82
82
  path path, "glob" => glob, "name" => spec.name, "gemspec" => spec do
83
- add_dependency spec.name
83
+ options = {}
84
+ normalize_options(spec.name, [], options)
85
+ add_dependency spec.name, nil, options
84
86
  end
85
87
 
86
88
  spec.development_dependencies.each do |dep|
87
- add_dependency dep.name, dep.requirement.as_list, "gemspec_dev_dep" => true, "group" => development_group
89
+ options = {}
90
+ normalize_options(dep.name, dep.requirement.as_list, options)
91
+ add_dependency dep.name, dep.requirement.as_list, options.merge("gemspec_dev_dep" => true, "group" => development_group)
88
92
  end
89
93
  when 0
90
94
  raise InvalidOption, "There are no gemspecs at #{expanded_path}"
@@ -156,7 +156,10 @@ module Bundler
156
156
  elsif cached_spec_path = gemspec_cached_path(spec_file_name)
157
157
  Bundler.load_gemspec(cached_spec_path)
158
158
  else
159
- Bundler.safe_load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
159
+ body = Bundler::Retry.new("fetcher", FAIL_ERRORS).attempts do
160
+ downloader.fetch(uri).body
161
+ end
162
+ Bundler.safe_load_marshal Bundler.rubygems.inflate(body)
160
163
  end
161
164
  raise MarshalError, "is #{spec.inspect}" unless spec.is_a?(Gem::Specification)
162
165
  spec
@@ -461,6 +461,8 @@ The \fBgemspec\fR method adds any runtime dependencies as gem requirements in th
461
461
  .P
462
462
  The \fBgemspec\fR method supports optional \fB:path\fR, \fB:glob\fR, \fB:name\fR, and \fB:development_group\fR options, which control where bundler looks for the \fB\.gemspec\fR, the glob it uses to look for the gemspec (defaults to: \fB{,*,*/*}\.gemspec\fR), what named \fB\.gemspec\fR it uses (if more than one is present), and which group development dependencies are included in\.
463
463
  .P
464
+ When \fBgemspec\fR is called inside a \fBgroup\fR block, the gem requirement on your project goes into that group instead of the default group, and so do its runtime dependencies\. Development dependencies stay in the \fBdevelopment\fR group, or the group given by \fB:development_group\fR\. An enclosing \fBplatforms\fR or \fBinstall_if\fR block applies to the project and its development dependencies alike\.
465
+ .P
464
466
  When a \fBgemspec\fR dependency encounters version conflicts during resolution, the local version under development will always be selected \-\- even if there are remote versions that better match other requirements for the \fBgemspec\fR gem\.
465
467
  .SH "EVAL_GEMFILE"
466
468
  A Gemfile \fBMAY\fR be split across multiple files\. The \fBeval_gemfile\fR method reads the contents of another file as if they appeared in the current Gemfile\. A relative path is resolved against the directory of the file containing the call\.
@@ -546,6 +546,12 @@ options, which control where bundler looks for the `.gemspec`, the glob it uses
546
546
  for the gemspec (defaults to: `{,*,*/*}.gemspec`), what named `.gemspec` it uses
547
547
  (if more than one is present), and which group development dependencies are included in.
548
548
 
549
+ When `gemspec` is called inside a `group` block, the gem requirement on your
550
+ project goes into that group instead of the default group, and so do its runtime
551
+ dependencies. Development dependencies stay in the `development` group, or the
552
+ group given by `:development_group`. An enclosing `platforms` or `install_if`
553
+ block applies to the project and its development dependencies alike.
554
+
549
555
  When a `gemspec` dependency encounters version conflicts during resolution, the
550
556
  local version under development will always be selected -- even if there are
551
557
  remote versions that better match other requirements for the `gemspec` gem.
@@ -499,6 +499,8 @@ module Bundler
499
499
  @cooldown_skipped_specs.each do |(name, version), spec|
500
500
  resolved = resolved_versions[name]
501
501
  next unless resolved && version > resolved
502
+ package = @base.get_package(name)
503
+ next if !package.unlock? && package.locked_version == resolved
502
504
  next unless requirements[name].all? {|req| req.satisfied_by?(version) }
503
505
  newest = newest_skipped[name]
504
506
  newest_skipped[name] = spec if newest.nil? || version > newest.version
@@ -42,11 +42,12 @@ module Bundler
42
42
  # Loads the file relative to the dirname of the Gemfile itself.
43
43
  def normalize_ruby_file(filename)
44
44
  file_content = Bundler.read_file(gemfile.dirname.join(filename))
45
- # match "ruby-3.2.2", ruby = "3.2.2", ruby = '3.2.2' or "ruby 3.2.2" capturing version string up to the first space or comment
45
+ # match "ruby-3.2.2", ruby = "3.2.2", ruby = '3.2.2', ruby = { version = "3.2.2" } or "ruby 3.2.2" capturing version string up to the first space or comment
46
46
  version_match = /^ # Start of line
47
47
  ruby # Literal "ruby"
48
48
  [\s-]* # Optional whitespace or hyphens (for "ruby-3.2.2" format)
49
49
  (?:=\s*)? # Optional equals sign with whitespace (for ruby = "3.2.2" format)
50
+ (?:\{[^}]*?\bversion\s*=\s*)? # Optional inline table up to its version key (for ruby = { version = "3.2.2" } format)
50
51
  (?:
51
52
  "([^"]+)" # Double quoted version
52
53
  |
@@ -40,11 +40,22 @@ module Gem
40
40
  end
41
41
  end
42
42
 
43
- def open_file_with_lock(path, &block)
43
+ def open_file_with_lock(path)
44
44
  file_lock = "#{path}.lock"
45
- open_file_with_flock(file_lock, &block)
46
- ensure
47
- FileUtils.rm_f file_lock
45
+
46
+ loop do
47
+ open_file_with_flock(file_lock) do |io|
48
+ # The previous holder removed the file while we were waiting on it,
49
+ # so leave this block and try again on the file now at the lock path
50
+ next unless File.identical?(io, file_lock)
51
+
52
+ begin
53
+ return yield io
54
+ ensure
55
+ FileUtils.rm_f file_lock
56
+ end
57
+ end
58
+ end
48
59
  end
49
60
  end
50
61
  end
@@ -76,7 +76,7 @@ module Bundler
76
76
  end
77
77
 
78
78
  def hash
79
- @remotes.hash
79
+ credless_remotes.hash
80
80
  end
81
81
 
82
82
  def eql?(other)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "4.0.23".freeze
4
+ VERSION = "4.0.24".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
@@ -155,7 +155,7 @@ class Gem::Ext::Builder
155
155
  end
156
156
 
157
157
  ##
158
- # Splits a command string such as ENV["MAKE"] into an argument list.
158
+ # Splits a command string such as <tt>ENV["MAKE"]</tt> into an argument list.
159
159
  #
160
160
  # On Windows, a value that names an existing file, such as
161
161
  # <tt>C:\path\nmake.exe</tt>, is taken as a single word because POSIX
@@ -208,6 +208,9 @@ class Gem::Uninstaller
208
208
 
209
209
  return if executables.empty?
210
210
 
211
+ bin_dir = @bin_dir || Gem.bindir(spec.base_dir)
212
+ return if bin_dir_missing?(bin_dir)
213
+
211
214
  executables = executables.map {|exec| formatted_program_filename exec }
212
215
 
213
216
  remove = if @force_executables.nil?
@@ -220,8 +223,6 @@ class Gem::Uninstaller
220
223
  end
221
224
 
222
225
  if remove
223
- bin_dir = @bin_dir || Gem.bindir(spec.base_dir)
224
-
225
226
  raise Gem::FilePermissionError, bin_dir unless File.writable? bin_dir
226
227
 
227
228
  executables.each do |exe_name|
@@ -398,6 +399,17 @@ class Gem::Uninstaller
398
399
 
399
400
  private
400
401
 
402
+ # Only a directory that does not exist is skipped. Any other error, such as
403
+ # EACCES on a parent directory, is left to the writable check.
404
+ def bin_dir_missing?(bin_dir)
405
+ File.stat(bin_dir)
406
+ false
407
+ rescue Errno::ENOENT
408
+ true
409
+ rescue SystemCallError
410
+ false
411
+ end
412
+
401
413
  def rm_r(path, exclusions:)
402
414
  FileUtils::Entry_.new(path).postorder_traverse do |ent|
403
415
  ent.remove unless exclusions.include?(ent.path)
@@ -295,10 +295,12 @@ class Gem::StreamUI
295
295
  def ask_for_password(question)
296
296
  return nil unless tty?
297
297
 
298
- @outs.print(question, " ")
299
- @outs.flush
300
-
301
- password = _gets_noecho
298
+ require_io_console
299
+ password = @ins.noecho do
300
+ @outs.print(question, " ")
301
+ @outs.flush
302
+ @ins.gets
303
+ end
302
304
  @outs.puts
303
305
  password&.chomp!
304
306
  password
@@ -314,11 +316,6 @@ class Gem::StreamUI
314
316
  end
315
317
  end
316
318
 
317
- def _gets_noecho
318
- require_io_console
319
- @ins.noecho { @ins.gets }
320
- end
321
-
322
319
  ##
323
320
  # Display a statement.
324
321
 
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "4.0.23"
12
+ VERSION = "4.0.24"
13
13
  end
14
14
 
15
15
  require_relative "rubygems/defaults"
@@ -853,14 +853,30 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
853
853
  end
854
854
 
855
855
  ##
856
- # Open a file with given flags, and protect access with a file lock
856
+ # Open a file with given flags, and protect access with a file lock.
857
+ #
858
+ # The lock file is removed once done, while still holding the lock. Since
859
+ # processes waiting for the lock may end up acquiring it on the removed file,
860
+ # after acquiring it we check that the locked file is still the one at the
861
+ # lock path, and start over otherwise.
857
862
 
858
- def self.open_file_with_lock(path, &block)
863
+ def self.open_file_with_lock(path)
859
864
  file_lock = "#{path}.lock"
860
- open_file_with_flock(file_lock, &block)
861
- ensure
862
- require "fileutils"
863
- FileUtils.rm_f file_lock
865
+
866
+ loop do
867
+ open_file_with_flock(file_lock) do |io|
868
+ # The previous holder removed the file while we were waiting on it, so
869
+ # leave this block and try again on the file now at the lock path
870
+ next unless File.identical?(io, file_lock)
871
+
872
+ begin
873
+ return yield io
874
+ ensure
875
+ require "fileutils"
876
+ FileUtils.rm_f file_lock
877
+ end
878
+ end
879
+ end
864
880
  end
865
881
 
866
882
  ##
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.23
4
+ version: 4.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich