rubygems-update 3.5.2 → 3.5.4

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: 516ff3035710aec51c55a79b9d0634c6900796ff1a0ed176db0eed96ea9fdc83
4
- data.tar.gz: 3a7c9ba6ba6c93e8c78ece390b1d14c7b9aa5876c7580fa53a85b0eb18e83311
3
+ metadata.gz: 4cb7b6f7687a1507b8536010f6eed4228f0e940ba642a684070d9e5b7676813b
4
+ data.tar.gz: df18b884768e1c6ce0b9566cee7df79dba8f07b40bb7798b109e4c2834b6991b
5
5
  SHA512:
6
- metadata.gz: 14bde13965cae368e5b5c812fb6e4e45cdec3bd7fe116b1eff897e3a2b7131ca555fbe3dff6da0d847854c81cc886bfb5f8835d13e7e60fa4a569432149f4684
7
- data.tar.gz: d50b039fa4f0b3ed8a66019f522a6c8b64679a69e05a31b31a82a7e6e2c97d2fffab43593076729b3bf98da795f345f252a678a33e55d50209d3f15b1e74ef9f
6
+ metadata.gz: 660660053dd83e660146422b033644d7ecf5f8ba13fb38995d37248979ef8c259aad042b9b9f741b0a5cf405bea117e86e5e7ef30c7d1db76f0de3b1d9fe2e59
7
+ data.tar.gz: b6036f05191c48ca663ea87e3e5f142f60da79f97d2adaba0796f30de65be4bdf039ccd122433a5ae5ba161f6df2e436cd2627c8a65107049b7ea0fc9bce5f1e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # 3.5.4 / 2024-01-03
2
+
3
+ ## Enhancements:
4
+
5
+ * Always avoid "Updating rubygems-update" message. Pull request
6
+ [#7335](https://github.com/rubygems/rubygems/pull/7335) by
7
+ deivid-rodriguez
8
+ * Installs bundler 2.5.4 as a default gem.
9
+
10
+ ## Bug fixes:
11
+
12
+ * Make `gem update --system` respect ruby version constraints. Pull
13
+ request [#7334](https://github.com/rubygems/rubygems/pull/7334) by
14
+ deivid-rodriguez
15
+
16
+ # 3.5.3 / 2023-12-22
17
+
18
+ ## Enhancements:
19
+
20
+ * Installs bundler 2.5.3 as a default gem.
21
+
1
22
  # 3.5.2 / 2023-12-21
2
23
 
3
24
  ## Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 2.5.4 (January 3, 2024)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Fix resolution when different platform specific gems have different dependencies [#7324](https://github.com/rubygems/rubygems/pull/7324)
6
+
7
+ # 2.5.3 (December 22, 2023)
8
+
9
+ ## Bug fixes:
10
+
11
+ - Fix incorrect error when Gemfile overrides a gemspec development dependency [#7319](https://github.com/rubygems/rubygems/pull/7319)
12
+
1
13
  # 2.5.2 (December 21, 2023)
2
14
 
3
15
  ## 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 = "2023-12-21".freeze
8
- @git_commit_sha = "00351925e4".freeze
7
+ @built_at = "2024-01-04".freeze
8
+ @git_commit_sha = "7ffda9ba9b".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -312,10 +312,6 @@ module Bundler
312
312
  end
313
313
  end
314
314
 
315
- def should_complete_platforms?
316
- !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
317
- end
318
-
319
315
  def spec_git_paths
320
316
  sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
321
317
  end
@@ -517,6 +513,10 @@ module Bundler
517
513
 
518
514
  private
519
515
 
516
+ def should_add_extra_platforms?
517
+ !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
518
+ end
519
+
520
520
  def lockfile_exists?
521
521
  lockfile && File.exist?(lockfile)
522
522
  end
@@ -600,7 +600,9 @@ module Bundler
600
600
  result = SpecSet.new(resolver.start)
601
601
 
602
602
  @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
603
- @platforms = result.complete_platforms!(platforms) if should_complete_platforms?
603
+ @platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms?
604
+
605
+ result.complete_platforms!(platforms)
604
606
 
605
607
  SpecSet.new(result.for(dependencies, false, @platforms))
606
608
  end
@@ -68,6 +68,10 @@ module Bundler
68
68
  @should_include && current_env? && current_platform?
69
69
  end
70
70
 
71
+ def gemspec_dev_dep?
72
+ type == :development
73
+ end
74
+
71
75
  def current_env?
72
76
  return true unless @env
73
77
  if @env.is_a?(Hash)
@@ -103,16 +103,21 @@ module Bundler
103
103
  # if there's already a dependency with this name we try to prefer one
104
104
  if current = @dependencies.find {|d| d.name == dep.name }
105
105
  # Always prefer the dependency from the Gemfile
106
- deleted_dep = @dependencies.delete(current) if current.type == :development
106
+ @dependencies.delete(current) if current.gemspec_dev_dep?
107
107
 
108
108
  if current.requirement != dep.requirement
109
109
  current_requirement_open = current.requirements_list.include?(">= 0")
110
110
 
111
- if current.type == :development
112
- unless current_requirement_open || dep.type == :development
113
- Bundler.ui.warn "A gemspec development dependency (#{dep.name}, #{current.requirement}) is being overridden by a Gemfile dependency (#{dep.name}, #{dep.requirement}).\n" \
114
- "This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n" \
111
+ gemspec_dep = [dep, current].find(&:gemspec_dev_dep?)
112
+ if gemspec_dep
113
+ gemfile_dep = [dep, current].find(&:runtime?)
114
+
115
+ unless current_requirement_open
116
+ Bundler.ui.warn "A gemspec development dependency (#{gemspec_dep.name}, #{gemspec_dep.requirement}) is being overridden by a Gemfile dependency (#{gemfile_dep.name}, #{gemfile_dep.requirement}).\n" \
117
+ "This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n"
115
118
  end
119
+
120
+ return if dep.gemspec_dev_dep?
116
121
  else
117
122
  update_prompt = ""
118
123
 
@@ -130,8 +135,8 @@ module Bundler
130
135
  "You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
131
136
  "#{update_prompt}"
132
137
  end
133
- elsif current.type == :development || dep.type == :development
134
- return if deleted_dep.nil?
138
+ elsif current.gemspec_dev_dep? || dep.gemspec_dev_dep?
139
+ return if dep.gemspec_dev_dep?
135
140
  elsif current.source != dep.source
136
141
  raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
137
142
  "You specified that #{dep.name} (#{dep.requirement}) should come from " \
@@ -52,32 +52,14 @@ module Bundler
52
52
  specs.uniq
53
53
  end
54
54
 
55
- def complete_platforms!(platforms)
55
+ def add_extra_platforms!(platforms)
56
56
  return platforms.concat([Gem::Platform::RUBY]).uniq if @specs.empty?
57
57
 
58
- new_platforms = @specs.flat_map {|spec| spec.source.specs.search([spec.name, spec.version]).map(&:platform) }.uniq.select do |platform|
58
+ new_platforms = all_platforms.select do |platform|
59
59
  next if platforms.include?(platform)
60
60
  next unless GemHelpers.generic(platform) == Gem::Platform::RUBY
61
61
 
62
- new_specs = []
63
-
64
- valid_platform = lookup.all? do |_, specs|
65
- spec = specs.first
66
- matching_specs = spec.source.specs.search([spec.name, spec.version])
67
- platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
68
- s.matches_current_metadata? && valid_dependencies?(s)
69
- end
70
-
71
- if platform_spec
72
- new_specs << LazySpecification.from_spec(platform_spec)
73
- true
74
- else
75
- false
76
- end
77
- end
78
- next unless valid_platform
79
-
80
- @specs.concat(new_specs.uniq)
62
+ complete_platform(platform)
81
63
  end
82
64
  return platforms if new_platforms.empty?
83
65
 
@@ -86,12 +68,15 @@ module Bundler
86
68
  less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && platform === Bundler.local_platform }
87
69
  platforms.delete(Bundler.local_platform) if less_specific_platform
88
70
 
89
- @sorted = nil
90
- @lookup = nil
91
-
92
71
  platforms
93
72
  end
94
73
 
74
+ def complete_platforms!(platforms)
75
+ platforms.each do |platform|
76
+ complete_platform(platform)
77
+ end
78
+ end
79
+
95
80
  def validate_deps(s)
96
81
  s.runtime_dependencies.each do |dep|
97
82
  next if dep.name == "bundler"
@@ -110,14 +95,14 @@ module Bundler
110
95
 
111
96
  def []=(key, value)
112
97
  @specs << value
113
- @lookup = nil
114
- @sorted = nil
98
+
99
+ reset!
115
100
  end
116
101
 
117
102
  def delete(specs)
118
103
  specs.each {|spec| @specs.delete(spec) }
119
- @lookup = nil
120
- @sorted = nil
104
+
105
+ reset!
121
106
  end
122
107
 
123
108
  def sort!
@@ -175,8 +160,8 @@ module Bundler
175
160
 
176
161
  def delete_by_name(name)
177
162
  @specs.reject! {|spec| spec.name == name }
178
- @lookup = nil
179
- @sorted = nil
163
+
164
+ reset!
180
165
  end
181
166
 
182
167
  def what_required(spec)
@@ -212,6 +197,42 @@ module Bundler
212
197
 
213
198
  private
214
199
 
200
+ def reset!
201
+ @sorted = nil
202
+ @lookup = nil
203
+ end
204
+
205
+ def complete_platform(platform)
206
+ new_specs = []
207
+
208
+ valid_platform = lookup.all? do |_, specs|
209
+ spec = specs.first
210
+ matching_specs = spec.source.specs.search([spec.name, spec.version])
211
+ platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
212
+ s.matches_current_metadata? && valid_dependencies?(s)
213
+ end
214
+
215
+ if platform_spec
216
+ new_specs << LazySpecification.from_spec(platform_spec) unless specs.include?(platform_spec)
217
+ true
218
+ else
219
+ false
220
+ end
221
+ end
222
+
223
+ if valid_platform && new_specs.any?
224
+ @specs.concat(new_specs)
225
+
226
+ reset!
227
+ end
228
+
229
+ valid_platform
230
+ end
231
+
232
+ def all_platforms
233
+ @specs.flat_map {|spec| spec.source.specs.search([spec.name, spec.version]).map(&:platform) }.uniq
234
+ end
235
+
215
236
  def valid_dependencies?(s)
216
237
  validate_deps(s) == :valid
217
238
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.2".freeze
4
+ VERSION = "2.5.4".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -244,7 +244,7 @@ command to remove old versions.
244
244
 
245
245
  @installer = Gem::DependencyInstaller.new update_options
246
246
 
247
- say "Updating #{name}" unless options[:system] && options[:silent]
247
+ say "Updating #{name}" unless options[:system]
248
248
  begin
249
249
  @installer.install name, Gem::Requirement.new(version)
250
250
  rescue Gem::InstallError, Gem::DependencyError => e
@@ -282,7 +282,7 @@ command to remove old versions.
282
282
  check_oldest_rubygems version
283
283
 
284
284
  installed_gems = Gem::Specification.find_all_by_name "rubygems-update", requirement
285
- installed_gems = update_gem("rubygems-update", version) if installed_gems.empty? || installed_gems.first.version != version
285
+ installed_gems = update_gem("rubygems-update", requirement) if installed_gems.empty? || installed_gems.first.version != version
286
286
  return if installed_gems.empty?
287
287
 
288
288
  install_rubygems installed_gems.first
@@ -294,9 +294,7 @@ command to remove old versions.
294
294
  args << "--prefix" << Gem.prefix if Gem.prefix
295
295
  args << "--no-document" unless options[:document].include?("rdoc") || options[:document].include?("ri")
296
296
  args << "--no-format-executable" if options[:no_format_executable]
297
- args << "--previous-version" << Gem::VERSION if
298
- options[:system] == true ||
299
- Gem::Version.new(options[:system]) >= Gem::Version.new(2)
297
+ args << "--previous-version" << Gem::VERSION
300
298
  args
301
299
  end
302
300
 
@@ -133,6 +133,14 @@ module Gem
133
133
  end
134
134
  attr_reader :sign, :data
135
135
  end
136
+
137
+ class UserClass < Element
138
+ def initialize(name, wrapped_object)
139
+ @name = name
140
+ @wrapped_object = wrapped_object
141
+ end
142
+ attr_reader :name, :wrapped_object
143
+ end
136
144
  end
137
145
  end
138
146
  end
@@ -299,7 +299,9 @@ module Gem
299
299
  end
300
300
 
301
301
  def read_user_class
302
- raise NotImplementedError, "Reading Marshal objects of type user_class is not implemented"
302
+ name = read_element
303
+ wrapped_object = read_element
304
+ Elements::UserClass.new(name, wrapped_object)
303
305
  end
304
306
  end
305
307
  end
@@ -247,6 +247,30 @@ module Gem::SafeMarshal
247
247
  end
248
248
  end
249
249
 
250
+ def visit_Gem_SafeMarshal_Elements_UserClass(r)
251
+ if resolve_class(r.name) == ::Hash && r.wrapped_object.is_a?(Elements::Hash)
252
+
253
+ hash = register_object({}.compare_by_identity)
254
+
255
+ o = r.wrapped_object
256
+ o.pairs.each_with_index do |(k, v), i|
257
+ push_stack i
258
+ k = visit(k)
259
+ push_stack k
260
+ hash[k] = visit(v)
261
+ end
262
+
263
+ if o.is_a?(Elements::HashWithDefaultValue)
264
+ push_stack :default
265
+ hash.default = visit(o.default)
266
+ end
267
+
268
+ hash
269
+ else
270
+ raise UnsupportedError.new("Unsupported user class #{resolve_class(r.name)} in marshal stream", stack: formatted_stack)
271
+ end
272
+ end
273
+
250
274
  def resolve_class(n)
251
275
  @class_cache[n] ||= begin
252
276
  to_s = resolve_symbol_name(n)
@@ -375,6 +399,12 @@ module Gem::SafeMarshal
375
399
  end
376
400
  end
377
401
 
402
+ class UnsupportedError < Error
403
+ def initialize(message, stack:)
404
+ super "#{message} @ #{stack.join "."}"
405
+ end
406
+ end
407
+
378
408
  class FormatError < Error
379
409
  end
380
410
 
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "3.5.2"
12
+ VERSION = "3.5.4"
13
13
  end
14
14
 
15
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.5.2"
5
+ s.version = "3.5.4"
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.2
4
+ version: 3.5.4
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: 2023-12-21 00:00:00.000000000 Z
19
+ date: 2024-01-04 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
@@ -702,7 +702,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
702
702
  - !ruby/object:Gem::Version
703
703
  version: '0'
704
704
  requirements: []
705
- rubygems_version: 3.5.2
705
+ rubygems_version: 3.5.4
706
706
  signing_key:
707
707
  specification_version: 4
708
708
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded