rubygems-update 3.5.3 → 3.5.5

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: 9a96e34ca4dd3b27ea38ac7b9eda98c12cc74082774fc03a4747b2746f215993
4
- data.tar.gz: 92f04742ef9d579ab430f766ca24fc89233a8463b57acdf07609fda64724c7e9
3
+ metadata.gz: c73f20f52f61db2ba70e9fd03114617fbaf95d0d78b9cb296f5b10efeb762aa8
4
+ data.tar.gz: 0a30532cbba00ffba42ae8649f7a43fca6c688e8a3e2cb7c74818b1336ff2de5
5
5
  SHA512:
6
- metadata.gz: d5bdc95e65579bf90563c99afd7c4f71573d12e3b564423ca90d277a672fadc712c576867b771287c042f8c141050c615f213c24a7f36c1800a75ffbf5d33ca0
7
- data.tar.gz: 47dbd452c5a1e069c19c43d6f3c818768579aa6d792fd9cf9e774b6d310772587da33c9dfc9742cbb431daafa6a73ba890b5c1331903ae41a7152db9c3c366c3
6
+ metadata.gz: 86a479e68ce7ba20464ac3a1af32d2f3032ae12fa5ec61b529b69296dacfc2d3746ab3e92382c04fe0363cd48d0a289cb3996cfea609b73314cdaf4c5cecf08b
7
+ data.tar.gz: 006f72296a1ee5695a5df7a12be4c61bf58b39ac1698b2047219217a160115b6a34f329169cdcc1019782f99fbbe66e20dd165d5941dc396338ade779b54b8d7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ # 3.5.5 / 2024-01-18
2
+
3
+ ## Enhancements:
4
+
5
+ * Installs bundler 2.5.5 as a default gem.
6
+
7
+ ## Bug fixes:
8
+
9
+ * Fix `require` activation conflicts when requiring default gems under
10
+ some situations. Pull request
11
+ [#7379](https://github.com/rubygems/rubygems/pull/7379) by
12
+ deivid-rodriguez
13
+ * Use cache_home instead of data_home in default_spec_cache_dir. Pull
14
+ request [#7331](https://github.com/rubygems/rubygems/pull/7331) by mrkn
15
+
16
+ ## Documentation:
17
+
18
+ * Use squiggly heredocs in `Gem::Specification#description` documentation,
19
+ so it doesn't add leading whitespace. Pull request
20
+ [#7373](https://github.com/rubygems/rubygems/pull/7373) by bravehager
21
+
22
+ # 3.5.4 / 2024-01-04
23
+
24
+ ## Enhancements:
25
+
26
+ * Always avoid "Updating rubygems-update" message. Pull request
27
+ [#7335](https://github.com/rubygems/rubygems/pull/7335) by
28
+ deivid-rodriguez
29
+ * Installs bundler 2.5.4 as a default gem.
30
+
31
+ ## Bug fixes:
32
+
33
+ * Make `gem update --system` respect ruby version constraints. Pull
34
+ request [#7334](https://github.com/rubygems/rubygems/pull/7334) by
35
+ deivid-rodriguez
36
+
1
37
  # 3.5.3 / 2023-12-22
2
38
 
3
39
  ## Enhancements:
data/POLICIES.md CHANGED
@@ -79,11 +79,11 @@ changelog.
79
79
  If PRs don't have a proper label, they won't be backported to patch releases.
80
80
 
81
81
  If you want a PR to be backported to a patch level release, but don't want to
82
- include it in the changelog, you can use the special `rubygems: backport` and
83
- `bundler: backport` labels. For example, this is useful when backporting a PR
84
- generates conflicts that are solved by backporting another PR with no user
85
- visible changes. You can use these special labels to also backport the other PR
86
- and not get any conflicts.
82
+ include it in the changelog, you can use the special `rubygems: skip changelog`
83
+ and `bundler: skip changelog` labels. For example, this is useful when
84
+ backporting a PR generates conflicts that are solved by backporting another PR
85
+ with no user visible changes. You can use these special labels to also backport
86
+ the other PR and not get any conflicts.
87
87
 
88
88
  ### Steps for patch releases
89
89
 
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 2.5.5 (January 18, 2024)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Fix development dependency not being added if introduced by two gemspecs [#7358](https://github.com/rubygems/rubygems/pull/7358)
6
+ - Fix ETag quoting regression in If-None-Match header of compact index request [#7352](https://github.com/rubygems/rubygems/pull/7352)
7
+
8
+ ## Documentation:
9
+
10
+ - Refer to underscores as underscores [#7364](https://github.com/rubygems/rubygems/pull/7364)
11
+
12
+ # 2.5.4 (January 4, 2024)
13
+
14
+ ## Bug fixes:
15
+
16
+ - Fix resolution when different platform specific gems have different dependencies [#7324](https://github.com/rubygems/rubygems/pull/7324)
17
+
1
18
  # 2.5.3 (December 22, 2023)
2
19
 
3
20
  ## 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 = "2023-12-22".freeze
8
- @git_commit_sha = "a04f70b115".freeze
7
+ @built_at = "2024-01-18".freeze
8
+ @git_commit_sha = "2efa8cec93".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -42,7 +42,7 @@ module Bundler
42
42
  else
43
43
  file.write(response.body)
44
44
  end
45
- CacheFile.write(etag_path, etag(response))
45
+ CacheFile.write(etag_path, etag_from_response(response))
46
46
  true
47
47
  end
48
48
  end
@@ -53,13 +53,13 @@ module Bundler
53
53
  response = @fetcher.call(remote_path, request_headers(etag))
54
54
  return true if response.is_a?(Gem::Net::HTTPNotModified)
55
55
  CacheFile.write(local_path, response.body, parse_digests(response))
56
- CacheFile.write(etag_path, etag(response))
56
+ CacheFile.write(etag_path, etag_from_response(response))
57
57
  end
58
58
 
59
59
  def request_headers(etag, range_start = nil)
60
60
  headers = {}
61
61
  headers["Range"] = "bytes=#{range_start}-" if range_start
62
- headers["If-None-Match"] = etag if etag
62
+ headers["If-None-Match"] = %("#{etag}") if etag
63
63
  headers
64
64
  end
65
65
 
@@ -77,7 +77,7 @@ module Bundler
77
77
  etag
78
78
  end
79
79
 
80
- def etag(response)
80
+ def etag_from_response(response)
81
81
  return unless response["ETag"]
82
82
  etag = response["ETag"].delete_prefix("W/")
83
83
  return if etag.delete_prefix!('"') && !etag.delete_suffix!('"')
@@ -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
@@ -102,9 +102,6 @@ module Bundler
102
102
 
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
- # Always prefer the dependency from the Gemfile
106
- @dependencies.delete(current) if current.gemspec_dev_dep?
107
-
108
105
  if current.requirement != dep.requirement
109
106
  current_requirement_open = current.requirements_list.include?(">= 0")
110
107
 
@@ -116,8 +113,6 @@ module Bundler
116
113
  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
114
  "This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n"
118
115
  end
119
-
120
- return if dep.gemspec_dev_dep?
121
116
  else
122
117
  update_prompt = ""
123
118
 
@@ -135,8 +130,13 @@ module Bundler
135
130
  "You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
136
131
  "#{update_prompt}"
137
132
  end
138
- elsif current.gemspec_dev_dep? || dep.gemspec_dev_dep?
139
- return if dep.gemspec_dev_dep?
133
+ end
134
+
135
+ # Always prefer the dependency from the Gemfile
136
+ if current.gemspec_dev_dep?
137
+ @dependencies.delete(current)
138
+ elsif dep.gemspec_dev_dep?
139
+ return
140
140
  elsif current.source != dep.source
141
141
  raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
142
142
  "You specified that #{dep.name} (#{dep.requirement}) should come from " \
@@ -302,9 +302,9 @@ Note that any configured credentials will be redacted by informative commands su
302
302
  .P
303
303
  Also note that to guarantee a sane mapping between valid environment variable names and valid host names, bundler makes the following transformations:
304
304
  .IP "\(bu" 4
305
- Any \fB\-\fR characters in a host name are mapped to a triple dash (\fB___\fR) in the corresponding environment variable\.
305
+ Any \fB\-\fR characters in a host name are mapped to a triple underscore (\fB___\fR) in the corresponding environment variable\.
306
306
  .IP "\(bu" 4
307
- Any \fB\.\fR characters in a host name are mapped to a double dash (\fB__\fR) in the corresponding environment variable\.
307
+ Any \fB\.\fR characters in a host name are mapped to a double underscore (\fB__\fR) in the corresponding environment variable\.
308
308
  .IP "" 0
309
309
  .P
310
310
  This means that if you have a gem server named \fBmy\.gem\-host\.com\fR, you'll need to use the \fBBUNDLE_MY__GEM___HOST__COM\fR variable to configure credentials for it through ENV\.
@@ -388,10 +388,10 @@ copy-pasting bundler output.
388
388
  Also note that to guarantee a sane mapping between valid environment variable
389
389
  names and valid host names, bundler makes the following transformations:
390
390
 
391
- * Any `-` characters in a host name are mapped to a triple dash (`___`) in the
391
+ * Any `-` characters in a host name are mapped to a triple underscore (`___`) in the
392
392
  corresponding environment variable.
393
393
 
394
- * Any `.` characters in a host name are mapped to a double dash (`__`) in the
394
+ * Any `.` characters in a host name are mapped to a double underscore (`__`) in the
395
395
  corresponding environment variable.
396
396
 
397
397
  This means that if you have a gem server named `my.gem-host.com`, you'll need to
@@ -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.3".freeze
4
+ VERSION = "2.5.5".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
 
@@ -39,7 +39,14 @@ module Kernel
39
39
  RUBYGEMS_ACTIVATION_MONITOR.synchronize do
40
40
  path = File.path(path)
41
41
 
42
- if spec = Gem.find_unresolved_default_spec(path)
42
+ # If +path+ belongs to a default gem, we activate it and then go straight
43
+ # to normal require
44
+
45
+ if spec = Gem.find_default_spec(path)
46
+ name = spec.name
47
+
48
+ next if Gem.loaded_specs[name]
49
+
43
50
  # Ensure -I beats a default gem
44
51
  resolved_path = begin
45
52
  rp = nil
@@ -57,8 +64,10 @@ module Kernel
57
64
  rp
58
65
  end
59
66
 
60
- Kernel.send(:gem, spec.name, Gem::Requirement.default_prerelease) unless
67
+ Kernel.send(:gem, name, Gem::Requirement.default_prerelease) unless
61
68
  resolved_path
69
+
70
+ next
62
71
  end
63
72
 
64
73
  # If there are no unresolved deps, then we can use just try
@@ -24,7 +24,7 @@ module Gem
24
24
  default_spec_cache_dir = File.join Gem.user_home, ".gem", "specs"
25
25
 
26
26
  unless File.exist?(default_spec_cache_dir)
27
- default_spec_cache_dir = File.join Gem.data_home, "gem", "specs"
27
+ default_spec_cache_dir = File.join Gem.cache_home, "gem", "specs"
28
28
  end
29
29
 
30
30
  default_spec_cache_dir
@@ -301,7 +301,7 @@ class Gem::Specification < Gem::BasicSpecification
301
301
  #
302
302
  # Usage:
303
303
  #
304
- # spec.description = <<-EOF
304
+ # spec.description = <<~EOF
305
305
  # Rake is a Make-like program implemented in Ruby. Tasks and
306
306
  # dependencies are specified in standard Ruby syntax.
307
307
  # EOF
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "3.5.3"
12
+ VERSION = "3.5.5"
13
13
  end
14
14
 
15
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -1216,6 +1216,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1216
1216
  ##
1217
1217
  # Find a Gem::Specification of default gem from +path+
1218
1218
 
1219
+ def find_default_spec(path)
1220
+ @path_to_default_spec_map[path]
1221
+ end
1222
+
1223
+ ##
1224
+ # Find an unresolved Gem::Specification of default gem from +path+
1225
+
1219
1226
  def find_unresolved_default_spec(path)
1220
1227
  default_spec = @path_to_default_spec_map[path]
1221
1228
  return default_spec if default_spec && loaded_specs[default_spec.name] != default_spec
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.5.3"
5
+ s.version = "3.5.5"
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.3
4
+ version: 3.5.5
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-22 00:00:00.000000000 Z
19
+ date: 2024-01-18 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.3
705
+ rubygems_version: 3.5.5
706
706
  signing_key:
707
707
  specification_version: 4
708
708
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded