rubygems-update 3.5.21 → 3.5.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b93fb693eb681ac96e283d9cbeaa13d051f7aad74a1c5345efdb2f3197bc3ffa
4
- data.tar.gz: 891fe98e7164fd5e684ea15055f56ebeb041e9c316ba0528cb08346aa26032b8
3
+ metadata.gz: 276b006ba43b78677b3ab572a3c2fe93f5d2dba491ca7e52fe1383b045348149
4
+ data.tar.gz: c3e120a1d2e201666f9ae43967fbb6633096c79dccfb4b81dcb70239ea92966f
5
5
  SHA512:
6
- metadata.gz: 40183fff5ed0fc360dd8399691277c6f13f179d8bccadbc07d5008c189b63ed3b4eb7987214230f7cd720fbc9bbcae548fc14b5b6caddf635730c8f206651acb
7
- data.tar.gz: 01cb679ca372d6856e928f71da3a991acd9f27cf526d1b650e33ccec7aa8d09ece5a2ff8a5dcbb02f11a7fa2923ee25042e2da52b42c452adc34c98770c1951b
6
+ metadata.gz: 0dd508e5b57121a6bdb08df3f984dcdc39ce14cc5b1725fd857f3f4e67e3334053fa2f2a93d0d2bb92f3050f1a4f85acfb86ea3064113d0388652265a31ed56d
7
+ data.tar.gz: c0cae4cac2bc5af2c91a3adcf7bbaad26ff5a8662bfbe20913cfe14b2b509f16cc169654451ed58e628d5a53fb88e30b3303d7bf85e266caf76d87324f2b1ddc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,38 @@
1
+ # 3.5.22 / 2024-10-16
2
+
3
+ ## Enhancements:
4
+
5
+ * Prevent `._*` files in packages generated from macOS. Pull request
6
+ [#8150](https://github.com/rubygems/rubygems/pull/8150) by
7
+ deivid-rodriguez
8
+ * Fix `gem pristine etc` resetting gem twice sometimes. Pull request
9
+ [#8117](https://github.com/rubygems/rubygems/pull/8117) by
10
+ deivid-rodriguez
11
+ * Allow `gem pristine` to reset default gems too. Pull request
12
+ [#8118](https://github.com/rubygems/rubygems/pull/8118) by
13
+ deivid-rodriguez
14
+ * Update vendored `uri` and `net-http`. Pull request
15
+ [#8112](https://github.com/rubygems/rubygems/pull/8112) by segiddins
16
+ * Installs bundler 2.5.22 as a default gem.
17
+
18
+ ## Bug fixes:
19
+
20
+ * Fix `gem contents` for default gems. Pull request
21
+ [#8132](https://github.com/rubygems/rubygems/pull/8132) by
22
+ deivid-rodriguez
23
+ * Fix duplicated specs when they have been previously activated. Pull
24
+ request [#8131](https://github.com/rubygems/rubygems/pull/8131) by
25
+ deivid-rodriguez
26
+ * Fix `gem install` on NFS shares. Pull request
27
+ [#8123](https://github.com/rubygems/rubygems/pull/8123) by
28
+ deivid-rodriguez
29
+ * Fix a `gem install` crash during "done installing" hooks. Pull request
30
+ [#8113](https://github.com/rubygems/rubygems/pull/8113) by
31
+ deivid-rodriguez
32
+ * Fix plugin command loading. Pull request
33
+ [#8121](https://github.com/rubygems/rubygems/pull/8121) by
34
+ deivid-rodriguez
35
+
1
36
  # 3.5.21 / 2024-10-03
2
37
 
3
38
  ## Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2.5.22 (October 16, 2024)
2
+
3
+ ## Enhancements:
4
+
5
+ - Update vendored `uri` and `net-http` [#8112](https://github.com/rubygems/rubygems/pull/8112)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix bundler sometimes crashing because of trying to use a version of psych compiled for a different Ruby [#8104](https://github.com/rubygems/rubygems/pull/8104)
10
+
1
11
  # 2.5.21 (October 3, 2024)
2
12
 
3
13
  ## Bug fixes:
@@ -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 = "2024-10-03".freeze
8
- @git_commit_sha = "5cc66a2380b".freeze
7
+ @built_at = "2024-10-16".freeze
8
+ @git_commit_sha = "342d4542fda".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -589,21 +589,21 @@ module Bundler
589
589
 
590
590
  trace_line = backtrace.find {|l| l.include?(dsl_path) } || trace_line
591
591
  return m unless trace_line
592
- line_numer = trace_line.split(":")[1].to_i - 1
593
- return m unless line_numer
592
+ line_number = trace_line.split(":")[1].to_i - 1
593
+ return m unless line_number
594
594
 
595
595
  lines = contents.lines.to_a
596
596
  indent = " # "
597
597
  indicator = indent.tr("#", ">")
598
- first_line = line_numer.zero?
599
- last_line = (line_numer == (lines.count - 1))
598
+ first_line = line_number.zero?
599
+ last_line = (line_number == (lines.count - 1))
600
600
 
601
601
  m << "\n"
602
602
  m << "#{indent}from #{trace_line.gsub(/:in.*$/, "")}\n"
603
603
  m << "#{indent}-------------------------------------------\n"
604
- m << "#{indent}#{lines[line_numer - 1]}" unless first_line
605
- m << "#{indicator}#{lines[line_numer]}"
606
- m << "#{indent}#{lines[line_numer + 1]}" unless last_line
604
+ m << "#{indent}#{lines[line_number - 1]}" unless first_line
605
+ m << "#{indicator}#{lines[line_number]}"
606
+ m << "#{indent}#{lines[line_number + 1]}" unless last_line
607
607
  m << "\n" unless m.end_with?("\n")
608
608
  m << "#{indent}-------------------------------------------\n"
609
609
  end
@@ -221,7 +221,7 @@ module Bundler
221
221
 
222
222
  requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
223
223
  path_plugin_files = requested_path_gems.map do |spec|
224
- Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
224
+ spec.matches_for_glob("rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
225
225
  rescue TypeError
226
226
  error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
227
227
  raise Gem::InvalidSpecificationException, error_message
@@ -131,7 +131,7 @@ module Bundler
131
131
  Bundler::Index.build do |index|
132
132
  files.each do |file|
133
133
  next unless spec = Bundler.load_gemspec(file)
134
- Bundler.rubygems.set_installed_by_version(spec)
134
+ spec.installed_by_version = Gem::VERSION
135
135
 
136
136
  spec.source = self
137
137
  Bundler.rubygems.validate(spec)
@@ -36,15 +36,14 @@ module Gem
36
36
  remove_method :open_file_with_flock if Gem.respond_to?(:open_file_with_flock)
37
37
 
38
38
  def open_file_with_flock(path, &block)
39
- mode = IO::RDONLY | IO::APPEND | IO::CREAT | IO::BINARY
39
+ # read-write mode is used rather than read-only in order to support NFS
40
+ mode = IO::RDWR | IO::APPEND | IO::CREAT | IO::BINARY
40
41
  mode |= IO::SHARE_DELETE if IO.const_defined?(:SHARE_DELETE)
41
42
 
42
43
  File.open(path, mode) do |io|
43
44
  begin
44
45
  io.flock(File::LOCK_EX)
45
46
  rescue Errno::ENOSYS, Errno::ENOTSUP
46
- rescue Errno::ENOLCK # NFS
47
- raise unless Thread.main == Thread.current
48
47
  end
49
48
  yield io
50
49
  end
@@ -267,6 +266,16 @@ module Gem
267
266
  end
268
267
  out
269
268
  end
269
+
270
+ if Gem.rubygems_version < Gem::Version.new("3.5.22")
271
+ module FilterIgnoredSpecs
272
+ def matching_specs(platform_only = false)
273
+ super.reject(&:ignored?)
274
+ end
275
+ end
276
+
277
+ prepend FilterIgnoredSpecs
278
+ end
270
279
  end
271
280
 
272
281
  # Requirements using lambda operator differentiate trailing zeros since rubygems 3.2.6
@@ -389,6 +398,15 @@ module Gem
389
398
  end
390
399
  end
391
400
  end
401
+
402
+ # Can be removed once RubyGems 3.5.22 support is dropped
403
+ unless new.respond_to?(:ignored?)
404
+ def ignored?
405
+ return @ignored unless @ignored.nil?
406
+
407
+ @ignored = missing_extensions?
408
+ end
409
+ end
392
410
  end
393
411
 
394
412
  require "rubygems/name_tuple"
@@ -57,28 +57,6 @@ module Bundler
57
57
  nil
58
58
  end
59
59
 
60
- def set_installed_by_version(spec, installed_by_version = Gem::VERSION)
61
- return unless spec.respond_to?(:installed_by_version=)
62
- spec.installed_by_version = Gem::Version.create(installed_by_version)
63
- end
64
-
65
- def spec_missing_extensions?(spec, default = true)
66
- return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
67
-
68
- return false if spec.default_gem?
69
- return false if spec.extensions.empty?
70
-
71
- default
72
- end
73
-
74
- def spec_matches_for_glob(spec, glob)
75
- return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
76
-
77
- spec.load_paths.flat_map do |lp|
78
- Dir["#{lp}/#{glob}#{suffix_pattern}"]
79
- end
80
- end
81
-
82
60
  def stub_set_spec(stub, spec)
83
61
  stub.instance_variable_set(:@spec, spec)
84
62
  end
@@ -210,7 +210,7 @@ module Bundler
210
210
  checkout
211
211
  end
212
212
 
213
- generate_bin_options = { disable_extensions: !Bundler.rubygems.spec_missing_extensions?(spec), build_args: options[:build_args] }
213
+ generate_bin_options = { disable_extensions: !spec.missing_extensions?, build_args: options[:build_args] }
214
214
  generate_bin(spec, generate_bin_options)
215
215
 
216
216
  requires_checkout? ? spec.post_install_message : nil
@@ -299,7 +299,7 @@ module Bundler
299
299
  # The gemspecs we cache should already be evaluated.
300
300
  spec = Bundler.load_gemspec(spec_path)
301
301
  next unless spec
302
- Bundler.rubygems.set_installed_by_version(spec)
302
+ spec.installed_by_version = Gem::VERSION
303
303
  Bundler.rubygems.validate(spec)
304
304
  File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) }
305
305
  end
@@ -150,7 +150,7 @@ module Bundler
150
150
 
151
151
  def load_gemspec(file)
152
152
  return unless spec = Bundler.load_gemspec(file)
153
- Bundler.rubygems.set_installed_by_version(spec)
153
+ spec.installed_by_version = Gem::VERSION
154
154
  spec
155
155
  end
156
156
 
@@ -357,10 +357,7 @@ module Bundler
357
357
  @installed_specs ||= Index.build do |idx|
358
358
  Bundler.rubygems.installed_specs.reverse_each do |spec|
359
359
  spec.source = self
360
- if Bundler.rubygems.spec_missing_extensions?(spec, false)
361
- Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
362
- next
363
- end
360
+ next if spec.ignored?
364
361
  idx << spec
365
362
  end
366
363
  end
@@ -28,6 +28,17 @@ module Bundler
28
28
 
29
29
  # @!group Stub Delegates
30
30
 
31
+ def ignored?
32
+ return @ignored unless @ignored.nil?
33
+
34
+ @ignored = missing_extensions?
35
+ return false unless @ignored
36
+
37
+ warn "Source #{source} is ignoring #{self} because it is missing extensions"
38
+
39
+ true
40
+ end
41
+
31
42
  def manually_installed?
32
43
  # This is for manually installed gems which are gems that were fixed in place after a
33
44
  # failed installation. Once the issue was resolved, the user then manually created
@@ -68,6 +68,8 @@ autoload :OpenSSL, 'openssl'
68
68
  # #verify_callback :: For server certificate verification
69
69
  # #verify_depth :: Depth of certificate verification
70
70
  # #verify_mode :: How connections should be verified
71
+ # #verify_hostname :: Use hostname verification for server certificate
72
+ # during the handshake
71
73
  #
72
74
  # == Proxies
73
75
  #
@@ -174,7 +176,7 @@ class Gem::Net::HTTP::Persistent
174
176
  ##
175
177
  # The version of Gem::Net::HTTP::Persistent you are using
176
178
 
177
- VERSION = '4.0.2'
179
+ VERSION = '4.0.4'
178
180
 
179
181
  ##
180
182
  # Error class for errors raised by Gem::Net::HTTP::Persistent. Various
@@ -449,6 +451,21 @@ class Gem::Net::HTTP::Persistent
449
451
 
450
452
  attr_reader :verify_mode
451
453
 
454
+ ##
455
+ # HTTPS verify_hostname.
456
+ #
457
+ # If a client sets this to true and enables SNI with SSLSocket#hostname=,
458
+ # the hostname verification on the server certificate is performed
459
+ # automatically during the handshake using
460
+ # OpenSSL::SSL.verify_certificate_identity().
461
+ #
462
+ # You can set +verify_hostname+ as true to use hostname verification
463
+ # during the handshake.
464
+ #
465
+ # NOTE: This works with Ruby > 3.0.
466
+
467
+ attr_reader :verify_hostname
468
+
452
469
  ##
453
470
  # Creates a new Gem::Net::HTTP::Persistent.
454
471
  #
@@ -508,6 +525,7 @@ class Gem::Net::HTTP::Persistent
508
525
  @verify_callback = nil
509
526
  @verify_depth = nil
510
527
  @verify_mode = nil
528
+ @verify_hostname = nil
511
529
  @cert_store = nil
512
530
 
513
531
  @generation = 0 # incremented when proxy Gem::URI changes
@@ -607,13 +625,23 @@ class Gem::Net::HTTP::Persistent
607
625
 
608
626
  return yield connection
609
627
  rescue Errno::ECONNREFUSED
610
- address = http.proxy_address || http.address
611
- port = http.proxy_port || http.port
628
+ if http.proxy?
629
+ address = http.proxy_address
630
+ port = http.proxy_port
631
+ else
632
+ address = http.address
633
+ port = http.port
634
+ end
612
635
 
613
636
  raise Error, "connection refused: #{address}:#{port}"
614
637
  rescue Errno::EHOSTDOWN
615
- address = http.proxy_address || http.address
616
- port = http.proxy_port || http.port
638
+ if http.proxy?
639
+ address = http.proxy_address
640
+ port = http.proxy_port
641
+ else
642
+ address = http.address
643
+ port = http.port
644
+ end
617
645
 
618
646
  raise Error, "host down: #{address}:#{port}"
619
647
  ensure
@@ -948,8 +976,10 @@ class Gem::Net::HTTP::Persistent
948
976
  connection.min_version = @min_version if @min_version
949
977
  connection.max_version = @max_version if @max_version
950
978
 
951
- connection.verify_depth = @verify_depth
952
- connection.verify_mode = @verify_mode
979
+ connection.verify_depth = @verify_depth
980
+ connection.verify_mode = @verify_mode
981
+ connection.verify_hostname = @verify_hostname if
982
+ @verify_hostname != nil && connection.respond_to?(:verify_hostname=)
953
983
 
954
984
  if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
955
985
  not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
@@ -1058,6 +1088,15 @@ application:
1058
1088
  reconnect_ssl
1059
1089
  end
1060
1090
 
1091
+ ##
1092
+ # Sets the HTTPS verify_hostname.
1093
+
1094
+ def verify_hostname= verify_hostname
1095
+ @verify_hostname = verify_hostname
1096
+
1097
+ reconnect_ssl
1098
+ end
1099
+
1061
1100
  ##
1062
1101
  # SSL verification callback.
1063
1102
 
@@ -1070,4 +1109,3 @@ end
1070
1109
 
1071
1110
  require_relative 'persistent/connection'
1072
1111
  require_relative 'persistent/pool'
1073
-
@@ -19,6 +19,8 @@ module Bundler::URI
19
19
  Parser = RFC2396_Parser
20
20
  RFC3986_PARSER = RFC3986_Parser.new
21
21
  Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
22
+ RFC2396_PARSER = RFC2396_Parser.new
23
+ Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
22
24
 
23
25
  # Bundler::URI::Parser.new
24
26
  DEFAULT_PARSER = Parser.new
@@ -1,6 +1,6 @@
1
1
  module Bundler::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '001300'.freeze
3
+ VERSION_CODE = '001301'.freeze
4
4
  VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
5
5
  # :startdoc:
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.21".freeze
4
+ VERSION = "2.5.22".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -71,11 +71,7 @@ class Gem::BasicSpecification
71
71
  # Return true if this spec can require +file+.
72
72
 
73
73
  def contains_requirable_file?(file)
74
- if @ignored
75
- return false
76
- elsif missing_extensions?
77
- @ignored = true
78
-
74
+ if ignored?
79
75
  if platform == Gem::Platform::RUBY || Gem::Platform.local === platform
80
76
  warn "Ignoring #{full_name} because its extensions are not built. " \
81
77
  "Try: gem pristine #{name} --version #{version}"
@@ -93,8 +89,17 @@ class Gem::BasicSpecification
93
89
  end
94
90
  end
95
91
 
92
+ ##
93
+ # Return true if this spec should be ignored because it's missing extensions.
94
+
95
+ def ignored?
96
+ return @ignored unless @ignored.nil?
97
+
98
+ @ignored = missing_extensions?
99
+ end
100
+
96
101
  def default_gem?
97
- loaded_from &&
102
+ !loaded_from.nil? &&
98
103
  File.dirname(loaded_from) == Gem.default_specifications_dir
99
104
  end
100
105
 
@@ -232,9 +232,14 @@ class Gem::CommandManager
232
232
  const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command"
233
233
 
234
234
  begin
235
- require "rubygems/commands/#{command_name}_command"
235
+ begin
236
+ require "rubygems/commands/#{command_name}_command"
237
+ rescue LoadError
238
+ # it may have been defined from a rubygems_plugin.rb file
239
+ end
240
+
236
241
  Gem::Commands.const_get(const_name).new
237
- rescue StandardError, LoadError => e
242
+ rescue StandardError => e
238
243
  alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
239
244
  ui.backtrace e
240
245
  end
@@ -103,16 +103,23 @@ prefix or only the files that are requireable.
103
103
 
104
104
  def files_in_default_gem(spec)
105
105
  spec.files.map do |file|
106
- case file
107
- when %r{\A#{spec.bindir}/}
108
- # $' is POSTMATCH
109
- [RbConfig::CONFIG["bindir"], $']
110
- when /\.so\z/
111
- [RbConfig::CONFIG["archdir"], file]
106
+ if file.start_with?("#{spec.bindir}/")
107
+ [RbConfig::CONFIG["bindir"], file.delete_prefix("#{spec.bindir}/")]
112
108
  else
113
- [RbConfig::CONFIG["rubylibdir"], file]
109
+ gem spec.name, spec.version
110
+
111
+ require_path = spec.require_paths.find do |path|
112
+ file.start_with?("#{path}/")
113
+ end
114
+
115
+ requirable_part = file.delete_prefix("#{require_path}/")
116
+
117
+ resolve = $LOAD_PATH.resolve_feature_path(requirable_part)&.last
118
+ next unless resolve
119
+
120
+ [resolve.delete_suffix(requirable_part), requirable_part]
114
121
  end
115
- end
122
+ end.compact
116
123
  end
117
124
 
118
125
  def gem_contents(name)
@@ -134,10 +134,14 @@ extensions will be restored.
134
134
 
135
135
  say "Restoring gems to pristine condition..."
136
136
 
137
- specs.each do |spec|
138
- if spec.default_gem?
139
- say "Skipped #{spec.full_name}, it is a default gem"
140
- next
137
+ specs.group_by(&:full_name_with_location).values.each do |grouped_specs|
138
+ spec = grouped_specs.find {|s| !s.default_gem? } || grouped_specs.first
139
+
140
+ unless only_executables_or_plugins?
141
+ # Default gemspecs include changes provided by ruby-core installer that
142
+ # can't currently be pristined (inclusion of compiled extension targets in
143
+ # the file list). So stick to resetting executables if it's a default gem.
144
+ options[:only_executables] = true if spec.default_gem?
141
145
  end
142
146
 
143
147
  if options.key? :skip
@@ -147,14 +151,14 @@ extensions will be restored.
147
151
  end
148
152
  end
149
153
 
150
- unless spec.extensions.empty? || options[:extensions] || options[:only_executables] || options[:only_plugins]
154
+ unless spec.extensions.empty? || options[:extensions] || only_executables_or_plugins?
151
155
  say "Skipped #{spec.full_name_with_location}, it needs to compile an extension"
152
156
  next
153
157
  end
154
158
 
155
159
  gem = spec.cache_file
156
160
 
157
- unless File.exist?(gem) || options[:only_executables] || options[:only_plugins]
161
+ unless File.exist?(gem) || only_executables_or_plugins?
158
162
  require_relative "../remote_fetcher"
159
163
 
160
164
  say "Cached gem for #{spec.full_name_with_location} not found, attempting to fetch..."
@@ -204,4 +208,10 @@ extensions will be restored.
204
208
  say "Restored #{spec.full_name_with_location}"
205
209
  end
206
210
  end
211
+
212
+ private
213
+
214
+ def only_executables_or_plugins?
215
+ options[:only_executables] || options[:only_plugins]
216
+ end
207
217
  end
@@ -279,7 +279,7 @@ class Gem::Dependency
279
279
  end
280
280
  end
281
281
 
282
- matches
282
+ matches.reject(&:ignored?)
283
283
  end
284
284
 
285
285
  ##
@@ -2470,7 +2470,7 @@ class Gem::Specification < Gem::BasicSpecification
2470
2470
 
2471
2471
  if @installed_by_version
2472
2472
  result << nil
2473
- result << " s.installed_by_version = #{ruby_code Gem::VERSION} if s.respond_to? :installed_by_version"
2473
+ result << " s.installed_by_version = #{ruby_code Gem::VERSION}"
2474
2474
  end
2475
2475
 
2476
2476
  unless dependencies.empty?
@@ -30,7 +30,7 @@ module Gem
30
30
  # Returns the list of all specifications in the record
31
31
 
32
32
  def all
33
- @all ||= Gem.loaded_specs.values | stubs.map(&:to_spec)
33
+ @all ||= stubs.map(&:to_spec)
34
34
  end
35
35
 
36
36
  ##
@@ -83,11 +83,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
83
83
  # True when this gem has been activated
84
84
 
85
85
  def activated?
86
- @activated ||=
87
- begin
88
- loaded = Gem.loaded_specs[name]
89
- loaded && loaded.version == version
90
- end
86
+ @activated ||= !loaded_spec.nil?
91
87
  end
92
88
 
93
89
  def default_gem?
@@ -187,11 +183,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
187
183
  # The full Gem::Specification for this gem, loaded from evalling its gemspec
188
184
 
189
185
  def spec
190
- @spec ||= if @data
191
- loaded = Gem.loaded_specs[name]
192
- loaded if loaded && loaded.version == version
193
- end
194
-
186
+ @spec ||= loaded_spec if @data
195
187
  @spec ||= Gem::Specification.load(loaded_from)
196
188
  end
197
189
  alias_method :to_spec, :spec
@@ -231,4 +223,13 @@ class Gem::StubSpecification < Gem::BasicSpecification
231
223
  def sort_obj # :nodoc:
232
224
  [name, version, Gem::Platform.sort_priority(platform)]
233
225
  end
226
+
227
+ private
228
+
229
+ def loaded_spec
230
+ spec = Gem.loaded_specs[name]
231
+ return unless spec && spec.version == version && spec.default_gem? == default_gem?
232
+
233
+ spec
234
+ end
234
235
  end
@@ -722,7 +722,7 @@ module Gem::Net #:nodoc:
722
722
  class HTTP < Protocol
723
723
 
724
724
  # :stopdoc:
725
- VERSION = "0.4.0"
725
+ VERSION = "0.4.1"
726
726
  HTTPVersion = '1.1'
727
727
  begin
728
728
  require 'zlib'
@@ -19,6 +19,8 @@ module Gem::URI
19
19
  Parser = RFC2396_Parser
20
20
  RFC3986_PARSER = RFC3986_Parser.new
21
21
  Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
22
+ RFC2396_PARSER = RFC2396_Parser.new
23
+ Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
22
24
 
23
25
  # Gem::URI::Parser.new
24
26
  DEFAULT_PARSER = Parser.new
@@ -1,6 +1,6 @@
1
1
  module Gem::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '001300'.freeze
3
+ VERSION_CODE = '001301'.freeze
4
4
  VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
5
5
  # :startdoc:
6
6
  end
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "3.5.21"
12
+ VERSION = "3.5.22"
13
13
  end
14
14
 
15
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -788,15 +788,14 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
788
788
  # Open a file with given flags, and protect access with flock
789
789
 
790
790
  def self.open_file_with_flock(path, &block)
791
- mode = IO::RDONLY | IO::APPEND | IO::CREAT | IO::BINARY
791
+ # read-write mode is used rather than read-only in order to support NFS
792
+ mode = IO::RDWR | IO::APPEND | IO::CREAT | IO::BINARY
792
793
  mode |= IO::SHARE_DELETE if IO.const_defined?(:SHARE_DELETE)
793
794
 
794
795
  File.open(path, mode) do |io|
795
796
  begin
796
797
  io.flock(File::LOCK_EX)
797
798
  rescue Errno::ENOSYS, Errno::ENOTSUP
798
- rescue Errno::ENOLCK # NFS
799
- raise unless Thread.main == Thread.current
800
799
  end
801
800
  yield io
802
801
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.5.21"
5
+ s.version = "3.5.22"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
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: 3.5.21
4
+ version: 3.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: exe
18
18
  cert_chain: []
19
- date: 2024-10-03 00:00:00.000000000 Z
19
+ date: 2024-10-16 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -737,7 +737,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
737
737
  - !ruby/object:Gem::Version
738
738
  version: '0'
739
739
  requirements: []
740
- rubygems_version: 3.5.21
740
+ rubygems_version: 3.5.22
741
741
  signing_key:
742
742
  specification_version: 4
743
743
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded