rubygems-update 4.0.2 → 4.0.3

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: c9f59269d6d1048c0621c1a5eebf9a11e4bfb2563437a2321ab7ea7cc88112ae
4
- data.tar.gz: cc74dcbadef15de4f55949db6c8260b59a2c32217db792305cbc43f8f9475c2c
3
+ metadata.gz: 28ee6cf18b2dd8595c173ed33216a3138e827f4a0cf2edabdd1241602d91f322
4
+ data.tar.gz: c0846629675967ffc8194b81f931b35c1bcba82e45c89c99ae3fa77e865ce9d4
5
5
  SHA512:
6
- metadata.gz: dfca31973be9cfacea2aa06e470b47a0c49c4a381c2e5a3fa0cf8ef68bebdb675c62e101cc31bc9c3786fbe3272263792ee77ef13a5869d85fb68e97311d4f91
7
- data.tar.gz: 3da6e226d22a6328348ea79ea704e0c6acb99a1090579707aeacbe1984f823e0c8c02330c1aeb1281c61c4ffef17801325bd6c0061b79fe8502997093b6f9bf8
6
+ metadata.gz: c64d7c5069f669fd15fb3db88ddcc41fb46b427b523b86c628de4156aa256e5af13605b6437698ee012cdd6d336a01f226d79c22ce0f2f78611ef435d2eb7d34
7
+ data.tar.gz: ef84ccf16a33b1c0efc0e68607c06c86996485d69e4c5c61f50b00881932d29b7d028fe6e7fb5201a2ac8bf23c1e2709a6132d1a9e97da61d53526a8ac13dc8b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.3 / 2025-12-23
4
+
5
+ ### Enhancements:
6
+
7
+ * Installs bundler 4.0.3 as a default gem.
8
+
9
+ ### Documentation:
10
+
11
+ * Fix broken documentation links. Pull request
12
+ [#9208](https://github.com/ruby/rubygems/pull/9208) by eileencodes
13
+
3
14
  ## 4.0.2 / 2025-12-17
4
15
 
5
16
  ### Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.3 (2025-12-23)
4
+
5
+ ### Enhancements:
6
+
7
+ - Fall back to ruby platform gem when precompiled variant is incompatible [#9211](https://github.com/ruby/rubygems/pull/9211)
8
+
3
9
  ## 4.0.2 (2025-12-17)
4
10
 
5
11
  ### 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 = "2025-12-17".freeze
8
- @git_commit_sha = "03359f8b08".freeze
7
+ @built_at = "2025-12-23".freeze
8
+ @git_commit_sha = "28c66ecc1e".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -138,24 +138,16 @@ module Bundler
138
138
  source.local!
139
139
 
140
140
  if use_exact_resolved_specifications?
141
- materialize(self) do |matching_specs|
142
- choose_compatible(matching_specs)
143
- end
144
- else
145
- materialize([name, version]) do |matching_specs|
146
- target_platform = source.is_a?(Source::Path) ? platform : Bundler.local_platform
147
-
148
- installable_candidates = MatchPlatform.select_best_platform_match(matching_specs, target_platform)
149
-
150
- specification = choose_compatible(installable_candidates, fallback_to_non_installable: false)
151
- return specification unless specification.nil?
141
+ spec = materialize(self) {|specs| choose_compatible(specs, fallback_to_non_installable: false) }
142
+ return spec if spec
152
143
 
153
- if target_platform != platform
154
- installable_candidates = MatchPlatform.select_best_platform_match(matching_specs, platform)
155
- end
156
-
157
- choose_compatible(installable_candidates)
144
+ # Exact spec is incompatible; in frozen mode, try to find a compatible platform variant
145
+ # In non-frozen mode, return nil to trigger re-resolution and lockfile update
146
+ if Bundler.frozen_bundle?
147
+ materialize([name, version]) {|specs| resolve_best_platform(specs) }
158
148
  end
149
+ else
150
+ materialize([name, version]) {|specs| resolve_best_platform(specs) }
159
151
  end
160
152
  end
161
153
 
@@ -190,6 +182,39 @@ module Bundler
190
182
  !source.is_a?(Source::Path) && ruby_platform_materializes_to_ruby_platform?
191
183
  end
192
184
 
185
+ # Try platforms in order of preference until finding a compatible spec.
186
+ # Used for legacy lockfiles and as a fallback when the exact locked spec
187
+ # is incompatible. Falls back to frozen bundle behavior if none match.
188
+ def resolve_best_platform(specs)
189
+ find_compatible_platform_spec(specs) || frozen_bundle_fallback(specs)
190
+ end
191
+
192
+ def find_compatible_platform_spec(specs)
193
+ candidate_platforms.each do |plat|
194
+ candidates = MatchPlatform.select_best_platform_match(specs, plat)
195
+ spec = choose_compatible(candidates, fallback_to_non_installable: false)
196
+ return spec if spec
197
+ end
198
+ nil
199
+ end
200
+
201
+ # Platforms to try in order of preference. Ruby platform is last since it
202
+ # requires compilation, but works when precompiled gems are incompatible.
203
+ def candidate_platforms
204
+ target = source.is_a?(Source::Path) ? platform : Bundler.local_platform
205
+ [target, platform, Gem::Platform::RUBY].uniq
206
+ end
207
+
208
+ # In frozen mode, accept any candidate. Will error at install time.
209
+ # When target differs from locked platform, prefer locked platform's candidates
210
+ # to preserve lockfile integrity.
211
+ def frozen_bundle_fallback(specs)
212
+ target = source.is_a?(Source::Path) ? platform : Bundler.local_platform
213
+ fallback_platform = target == platform ? target : platform
214
+ candidates = MatchPlatform.select_best_platform_match(specs, fallback_platform)
215
+ choose_compatible(candidates)
216
+ end
217
+
193
218
  def ruby_platform_materializes_to_ruby_platform?
194
219
  generic_platform = Bundler.generic_local_platform == Gem::Platform::JAVA ? Gem::Platform::JAVA : Gem::Platform::RUBY
195
220
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "4.0.2".freeze
4
+ VERSION = "4.0.3".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
@@ -22,7 +22,7 @@ module Gem
22
22
  def register(target, obj)
23
23
  end
24
24
 
25
- # This is ported over from the yaml_tree in 1.9.3
25
+ # This is ported over from the YAMLTree implementation in Ruby 1.9.3
26
26
  def format_time(time)
27
27
  if time.utc?
28
28
  time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
@@ -38,7 +38,7 @@ class Gem::RequestSet::Lockfile
38
38
  end
39
39
 
40
40
  ##
41
- # Creates a new Lockfile for the given +request_set+ and +gem_deps_file+
41
+ # Creates a new Lockfile for the given Gem::RequestSet and +gem_deps_file+
42
42
  # location.
43
43
 
44
44
  def self.build(request_set, gem_deps_file, dependencies = nil)
@@ -143,7 +143,7 @@ class Gem::Security::Policy
143
143
  end
144
144
 
145
145
  ##
146
- # Ensures the root of +chain+ has a trusted certificate in +trust_dir+ and
146
+ # Ensures the root of +chain+ has a trusted certificate in Gem::Security.trust_dir and
147
147
  # the digests of the two certificates match according to +digester+
148
148
 
149
149
  def check_trust(chain, digester, trust_dir)
@@ -102,7 +102,7 @@ class Gem::Source
102
102
  end
103
103
 
104
104
  ##
105
- # Fetches a specification for the given +name_tuple+.
105
+ # Fetches a specification for the given Gem::NameTuple.
106
106
 
107
107
  def fetch_spec(name_tuple)
108
108
  fetcher = Gem::RemoteFetcher.fetcher
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "4.0.2"
12
+ VERSION = "4.0.3"
13
13
  end
14
14
 
15
15
  require_relative "rubygems/defaults"
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.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich