bundler 2.5.21 → 2.5.22

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: 4d14e278135c6fa088c2fc0837815d8251449d7c0335d422ba2fcaa3e29bc3c8
4
- data.tar.gz: 9b0704eae91833bf63ab346369e0a0a5e3ed39093cbf19bbc27fe7f8eb5ff1ae
3
+ metadata.gz: bc7261a0b8dc5361d73ec05037b3ceb245a228a8e5e068928fd8db3fc68e6fb3
4
+ data.tar.gz: '049390d33cb5586ed405378073f30bb45e0f0e3127ee6b857cf79574dfe2d415'
5
5
  SHA512:
6
- metadata.gz: cad7762642146a6baba3c8cfab7528e667d0748da24fc442be84cc374bb10a8ef881ec9b87e0f019e4063bbf5112fd9a463ee9aab7567099e40811a9efcf5116
7
- data.tar.gz: ad30723406fac680a09dac9d4c2dedb202888c86cbcfc79481f905d2d8e3ecde477ba1dda7f0270dedaf386d03b12e782ec350ed7cf83ea80cda5886450bb02f
6
+ metadata.gz: 977e79ef6df50d6fa48909d74b9867621ba7f7883d4e438e9f4f658ec49030dd4752c3926dfea84be23da1e7964599d93adafbc3458df90f34380208cb810d84
7
+ data.tar.gz: ebd1d89e12a3d56c653cf90ef0bcb90d4cbc3b739f7ebbd5033505b367ee17c4320defc8c5810d4bb762ff482425c9326385bb6044bf012e397dc3f7d12eaa65
data/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
 
data/lib/bundler/dsl.rb CHANGED
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.21
4
+ version: 2.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2024-10-03 00:00:00.000000000 Z
25
+ date: 2024-10-16 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably
@@ -405,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
405
405
  - !ruby/object:Gem::Version
406
406
  version: 3.2.3
407
407
  requirements: []
408
- rubygems_version: 3.5.21
408
+ rubygems_version: 3.5.22
409
409
  signing_key:
410
410
  specification_version: 4
411
411
  summary: The best way to manage your application's dependencies