rubygems-update 3.2.8 → 3.2.9

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: 8c88809da851f0467214e490fb43a1d4c54b9980d7c0099881d10b19bd5f668c
4
- data.tar.gz: adc3c7278c9bca2021b7bfb3f3ba0a215447512d2af3cc7bba8bd8c3781944d5
3
+ metadata.gz: 6f97da94a4361531119587adbe81df2cb025b7cd46e64ac4344897e403eba853
4
+ data.tar.gz: 3539b4322d457c4b4f3fb387880aac7ba86f8c72f34ea66b2b4e749411dff5f7
5
5
  SHA512:
6
- metadata.gz: 6ce421e400fcb3e38ad14f83e5614f0ee77ad0f9cfba73c7a51b8afca807f1ef3f166a585e4ec377fb41f2526d02055dcaff66bf54d9dde221f68f256e0bf777
7
- data.tar.gz: b8da7349c0f8c7c71e95405a8748006c70c5917613f85f5ed56d7188d1cc6afa7b348d07e133535e9959c9505c9b86dc9087c1d4af25501a93535e0301d31bf4
6
+ metadata.gz: 9b4a518220115bc1e638e0ef3a69cbacf49a21940666b9fc9310426cc077fc3ba73c1ffbd9860ecd6dd8210c1c80853ed916298e610c3e508679c0d853f471ad
7
+ data.tar.gz: 28dcf6a59842e3838ccb94fe5ad35a947fb4f1e532eff8edb2a0b49d00741853b8a56ee595233bd6d0768cc0c4c33c49bf965900ad315f88936dec90e0abd5a8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 3.2.9 / 2021-02-08
2
+
3
+ ## Bug fixes:
4
+
5
+ * Fix error message when underscore selection can't find bundler. Pull
6
+ request #4363 by deivid-rodriguez
7
+ * Fix `Gem::Specification.stubs_for` returning wrong named specs. Pull
8
+ request #4356 by tompng
9
+ * Don't error out when activating a binstub unless necessary. Pull request
10
+ #4351 by deivid-rodriguez
11
+ * Fix `gem outdated` incorrectly handling platform specific gems. Pull
12
+ request #4248 by deivid-rodriguez
13
+
1
14
  # 3.2.8 / 2021-02-02
2
15
 
3
16
  ## Bug fixes:
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2.2.9 (February 8, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Stop removing existing platforms when force_ruby_platform is true [#4336](https://github.com/rubygems/rubygems/pull/4336)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Don't install platform specific gems on truffleruby [#4333](https://github.com/rubygems/rubygems/pull/4333)
10
+
1
11
  # 2.2.8 (February 2, 2021)
2
12
 
3
13
  ## Enhancements:
@@ -440,7 +440,7 @@ EOF
440
440
  end
441
441
 
442
442
  def local_platform
443
- return Gem::Platform::RUBY if settings[:force_ruby_platform]
443
+ return Gem::Platform::RUBY if settings[:force_ruby_platform] || Gem.platforms == [Gem::Platform::RUBY]
444
444
  Gem::Platform.local
445
445
  end
446
446
 
@@ -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 = "2021-02-02".freeze
8
- @git_commit_sha = "4015e550dc".freeze
7
+ @built_at = "2021-02-08".freeze
8
+ @git_commit_sha = "30e740c073".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -82,11 +82,7 @@ module Bundler
82
82
  @lockfile_contents = Bundler.read_file(lockfile)
83
83
  @locked_gems = LockfileParser.new(@lockfile_contents)
84
84
  @locked_platforms = @locked_gems.platforms
85
- if Bundler.settings[:force_ruby_platform]
86
- @platforms = [Gem::Platform::RUBY]
87
- else
88
- @platforms = @locked_platforms.dup
89
- end
85
+ @platforms = @locked_platforms.dup
90
86
  @locked_bundler_version = @locked_gems.bundler_version
91
87
  @locked_ruby_version = @locked_gems.ruby_version
92
88
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.8".freeze
4
+ VERSION = "2.2.9".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.8".freeze
11
+ VERSION = "3.2.9".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -275,7 +275,7 @@ module Gem
275
275
 
276
276
  unless spec = specs.first
277
277
  msg = "can't find gem #{dep} with executable #{exec_name}"
278
- if name == "bundler" && bundler_message = Gem::BundlerVersionFinder.missing_version_message
278
+ if dep.filters_bundler? && bundler_message = Gem::BundlerVersionFinder.missing_version_message
279
279
  msg = bundler_message
280
280
  end
281
281
  raise Gem::GemNotFoundException, msg
@@ -277,7 +277,7 @@ class Gem::Dependency
277
277
  requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version)
278
278
  end.map(&:to_spec)
279
279
 
280
- Gem::BundlerVersionFinder.filter!(matches) if name == "bundler".freeze && !requirement.specific?
280
+ Gem::BundlerVersionFinder.filter!(matches) if filters_bundler?
281
281
 
282
282
  if platform_only
283
283
  matches.reject! do |spec|
@@ -295,6 +295,10 @@ class Gem::Dependency
295
295
  @requirement.specific?
296
296
  end
297
297
 
298
+ def filters_bundler?
299
+ name == "bundler".freeze && !specific?
300
+ end
301
+
298
302
  def to_specs
299
303
  matches = matching_specs true
300
304
 
@@ -827,7 +827,9 @@ class Gem::Specification < Gem::BasicSpecification
827
827
  if @@stubs
828
828
  @@stubs_by_name[name] || []
829
829
  else
830
- @@stubs_by_name[name] ||= stubs_for_pattern("#{name}-*.gemspec")
830
+ @@stubs_by_name[name] ||= stubs_for_pattern("#{name}-*.gemspec").select do |s|
831
+ s.name == name
832
+ end
831
833
  end
832
834
  end
833
835
 
@@ -848,7 +850,9 @@ class Gem::Specification < Gem::BasicSpecification
848
850
  specs.sort! do |a, b|
849
851
  names = a.name <=> b.name
850
852
  next names if names.nonzero?
851
- b.version <=> a.version
853
+ versions = b.version <=> a.version
854
+ next versions if versions.nonzero?
855
+ b.platform == Gem::Platform::RUBY ? -1 : 1
852
856
  end
853
857
  end
854
858
 
@@ -1084,20 +1088,15 @@ class Gem::Specification < Gem::BasicSpecification
1084
1088
  end
1085
1089
 
1086
1090
  def self._latest_specs(specs, prerelease = false) # :nodoc:
1087
- result = Hash.new {|h,k| h[k] = {} }
1088
- native = {}
1091
+ result = {}
1089
1092
 
1090
1093
  specs.reverse_each do |spec|
1091
1094
  next if spec.version.prerelease? unless prerelease
1092
1095
 
1093
- native[spec.name] = spec.version if spec.platform == Gem::Platform::RUBY
1094
- result[spec.name][spec.platform] = spec
1096
+ result[spec.name] = spec
1095
1097
  end
1096
1098
 
1097
- result.map(&:last).map(&:values).flatten.reject do |spec|
1098
- minimum = native[spec.name]
1099
- minimum && spec.version < minimum
1100
- end.sort_by{|tup| tup.name }
1099
+ result.map(&:last).flatten.sort_by{|tup| tup.name }
1101
1100
  end
1102
1101
 
1103
1102
  ##
@@ -2552,7 +2551,7 @@ class Gem::Specification < Gem::BasicSpecification
2552
2551
  begin
2553
2552
  dependencies.each do |dep|
2554
2553
  next unless dep.runtime?
2555
- dep.to_specs.each do |dep_spec|
2554
+ dep.matching_specs(true).each do |dep_spec|
2556
2555
  next if visited.has_key?(dep_spec)
2557
2556
  visited[dep_spec] = true
2558
2557
  trail.push(dep_spec)
@@ -311,7 +311,7 @@ class Gem::TestCase < Minitest::Test
311
311
  ENV['XDG_CONFIG_HOME'] = nil
312
312
  ENV['XDG_DATA_HOME'] = nil
313
313
  ENV['SOURCE_DATE_EPOCH'] = nil
314
- ENV["TMPDIR"] = @tmp
314
+ ENV['BUNDLER_VERSION'] = nil
315
315
 
316
316
  @current_dir = Dir.pwd
317
317
  @fetcher = nil
@@ -322,13 +322,10 @@ class Gem::TestCase < Minitest::Test
322
322
  # capture output
323
323
  Gem::DefaultUserInteraction.ui = Gem::MockGemUi.new
324
324
 
325
- tmpdir = File.realpath Dir.tmpdir
326
- tmpdir.tap(&Gem::UNTAINT)
327
-
328
- @tempdir = File.join(tmpdir, "test_rubygems_#{$$}")
325
+ @tempdir = Dir.mktmpdir("test_rubygems_", @tmp)
329
326
  @tempdir.tap(&Gem::UNTAINT)
330
327
 
331
- FileUtils.mkdir_p @tempdir
328
+ ENV["TMPDIR"] = @tempdir
332
329
 
333
330
  @orig_SYSTEM_WIDE_CONFIG_FILE = Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
334
331
  Gem::ConfigFile.send :remove_const, :SYSTEM_WIDE_CONFIG_FILE
@@ -367,7 +364,9 @@ class Gem::TestCase < Minitest::Test
367
364
  Dir.chdir @tempdir
368
365
 
369
366
  ENV['HOME'] = @userhome
367
+ Gem.instance_variable_set :@config_file, nil
370
368
  Gem.instance_variable_set :@user_home, nil
369
+ Gem.instance_variable_set :@config_home, nil
371
370
  Gem.instance_variable_set :@data_home, nil
372
371
  Gem.instance_variable_set :@gemdeps, nil
373
372
  Gem.instance_variable_set :@env_requirements_by_name, nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.8"
5
+ s.version = "3.2.9"
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
 
@@ -297,6 +297,58 @@ class TestGem < Gem::TestCase
297
297
  assert_equal %w[a-1 b-2 c-1], loaded_spec_names
298
298
  end
299
299
 
300
+ def test_activate_bin_path_does_not_error_if_a_gem_thats_not_finally_activated_has_orphaned_dependencies
301
+ a1 = util_spec 'a', '1' do |s|
302
+ s.executables = ['exec']
303
+ s.add_dependency 'b'
304
+ end
305
+
306
+ b1 = util_spec 'b', '1' do |s|
307
+ s.add_dependency 'c', '1'
308
+ end
309
+
310
+ b2 = util_spec 'b', '2' do |s|
311
+ s.add_dependency 'c', '2'
312
+ end
313
+
314
+ c2 = util_spec 'c', '2'
315
+
316
+ install_specs c2, b1, b2, a1
317
+
318
+ # c1 is missing, but not needed for activation, so we should not get any errors here
319
+
320
+ Gem.activate_bin_path("a", "exec", ">= 0")
321
+
322
+ assert_equal %w[a-1 b-2 c-2], loaded_spec_names
323
+ end
324
+
325
+ def test_activate_bin_path_raises_a_meaningful_error_if_a_gem_thats_finally_activated_has_orphaned_dependencies
326
+ a1 = util_spec 'a', '1' do |s|
327
+ s.executables = ['exec']
328
+ s.add_dependency 'b'
329
+ end
330
+
331
+ b1 = util_spec 'b', '1' do |s|
332
+ s.add_dependency 'c', '1'
333
+ end
334
+
335
+ b2 = util_spec 'b', '2' do |s|
336
+ s.add_dependency 'c', '2'
337
+ end
338
+
339
+ c1 = util_spec 'c', '1'
340
+
341
+ install_specs c1, b1, b2, a1
342
+
343
+ # c2 is missing, and b2 which has it as a dependency will be activated, so we should get an error about the orphaned dependency
344
+
345
+ e = assert_raises Gem::UnsatisfiableDependencyError do
346
+ load Gem.activate_bin_path("a", "exec", ">= 0")
347
+ end
348
+
349
+ assert_equal "Unable to resolve dependency: 'b (>= 0)' requires 'c (= 2)'", e.message
350
+ end
351
+
300
352
  def test_activate_bin_path_in_debug_mode
301
353
  a1 = util_spec 'a', '1' do |s|
302
354
  s.executables = ['exec']
@@ -416,6 +468,32 @@ class TestGem < Gem::TestCase
416
468
  assert_equal %w[bundler-1.17.3], loaded_spec_names
417
469
  end
418
470
 
471
+ def test_activate_bin_path_gives_proper_error_for_bundler_when_underscore_selection_given
472
+ File.open("Gemfile.lock", "w") do |f|
473
+ f.write <<-L.gsub(/ {8}/, "")
474
+ GEM
475
+ remote: https://rubygems.org/
476
+ specs:
477
+
478
+ PLATFORMS
479
+ ruby
480
+
481
+ DEPENDENCIES
482
+
483
+ BUNDLED WITH
484
+ 2.1.4
485
+ L
486
+ end
487
+
488
+ File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
489
+
490
+ e = assert_raises Gem::GemNotFoundException do
491
+ load Gem.activate_bin_path("bundler", "bundle", "= 2.2.8")
492
+ end
493
+
494
+ assert_equal "can't find gem bundler (= 2.2.8) with executable bundle", e.message
495
+ end
496
+
419
497
  def test_self_bin_path_no_exec_name
420
498
  e = assert_raises ArgumentError do
421
499
  Gem.bin_path 'a'
@@ -28,4 +28,22 @@ class TestGemCommandsOutdatedCommand < Gem::TestCase
28
28
  assert_equal "foo (0.2 < 2.0)\n", @ui.output
29
29
  assert_equal "", @ui.error
30
30
  end
31
+
32
+ def test_execute_with_up_to_date_platform_specific_gem
33
+ spec_fetcher do |fetcher|
34
+ fetcher.download 'foo', '2.0'
35
+
36
+ fetcher.gem 'foo', '1.0'
37
+ fetcher.gem 'foo', '2.0' do |s|
38
+ s.platform = Gem::Platform.local
39
+ end
40
+ end
41
+
42
+ use_ui @ui do
43
+ @cmd.execute
44
+ end
45
+
46
+ assert_equal "", @ui.output
47
+ assert_equal "", @ui.error
48
+ end
31
49
  end
@@ -44,7 +44,7 @@ class TestGemDependencyInstaller < Gem::TestCase
44
44
  s.add_development_dependency 'c'
45
45
  end
46
46
 
47
- util_reset_gems
47
+ util_setup_spec_fetcher(@a1, @a1_pre, @b1, @d1)
48
48
  end
49
49
 
50
50
  def test_install
@@ -287,8 +287,6 @@ class TestGemDependencyInstaller < Gem::TestCase
287
287
 
288
288
  @aa1, @aa1_gem = util_gem 'aa', '1'
289
289
 
290
- util_reset_gems
291
-
292
290
  FileUtils.mv @a1_gem, @tempdir
293
291
  FileUtils.mv @aa1_gem, @tempdir
294
292
  FileUtils.mv @b1_gem, @tempdir
@@ -307,8 +305,6 @@ class TestGemDependencyInstaller < Gem::TestCase
307
305
 
308
306
  @aa1, @aa1_gem = util_gem 'aa', '1'
309
307
 
310
- util_reset_gems
311
-
312
308
  FileUtils.mv @a1_gem, @tempdir
313
309
  FileUtils.mv @aa1_gem, @tempdir
314
310
  FileUtils.mv @b1_gem, @tempdir
@@ -329,8 +325,6 @@ class TestGemDependencyInstaller < Gem::TestCase
329
325
 
330
326
  @aa1, @aa1_gem = util_gem 'aa', '1'
331
327
 
332
- util_reset_gems
333
-
334
328
  FileUtils.mv @a1_gem, @tempdir
335
329
  FileUtils.mv @aa1_gem, @tempdir
336
330
  FileUtils.mv @b1_gem, @tempdir
@@ -1156,16 +1150,6 @@ class TestGemDependencyInstaller < Gem::TestCase
1156
1150
  @d1, @d1_gem = util_gem 'd', '1'
1157
1151
  @d2, @d2_gem = util_gem 'd', '2'
1158
1152
 
1159
- util_reset_gems
1160
- end
1161
-
1162
- def util_reset_gems
1163
- @a1 ||= nil
1164
- @b1 ||= nil
1165
- @a1_pre ||= nil
1166
- @d1 ||= nil
1167
- @d2 ||= nil
1168
-
1169
- util_setup_spec_fetcher(*[@a1, @a1_pre, @b1, @d1, @d2].compact)
1153
+ util_setup_spec_fetcher(@d1, @d2)
1170
1154
  end
1171
1155
  end
@@ -1208,6 +1208,16 @@ dependencies: []
1208
1208
  Gem.platforms = orig_platform
1209
1209
  end
1210
1210
 
1211
+ def test_self_stubs_returns_only_specified_named_specs
1212
+ dir_standard_specs = File.join Gem.dir, 'specifications'
1213
+
1214
+ save_gemspec('a-1', '1', dir_standard_specs){|s| s.name = 'a' }
1215
+ save_gemspec('a-2', '2', dir_standard_specs){|s| s.name = 'a' }
1216
+ save_gemspec('a-a', '3', dir_standard_specs){|s| s.name = 'a-a' }
1217
+
1218
+ assert_equal ['a-1', 'a-2'], Gem::Specification.stubs_for('a').map(&:full_name).sort
1219
+ end
1220
+
1211
1221
  def test_handles_private_null_type
1212
1222
  path = File.expand_path "../data/null-type.gemspec.rz", __FILE__
1213
1223
 
@@ -3530,19 +3540,6 @@ Did you mean 'Ruby'?
3530
3540
  specfile.delete
3531
3541
  end
3532
3542
 
3533
- ##
3534
- # KEEP p-1-x86-darwin-8
3535
- # KEEP p-1
3536
- # KEEP c-1.2
3537
- # KEEP a_evil-9
3538
- # a-1
3539
- # a-1-x86-my_platform-1
3540
- # KEEP a-2
3541
- # a-2-x86-other_platform-1
3542
- # KEEP a-2-x86-my_platform-1
3543
- # a-3.a
3544
- # KEEP a-3-x86-other_platform-1
3545
-
3546
3543
  def test_latest_specs
3547
3544
  spec_fetcher do |fetcher|
3548
3545
  fetcher.spec 'a', 1 do |s|
@@ -3565,8 +3562,6 @@ Did you mean 'Ruby'?
3565
3562
  end
3566
3563
 
3567
3564
  expected = %W[
3568
- a-2
3569
- a-2-x86-my_platform-1
3570
3565
  a-3-x86-other_platform-1
3571
3566
  ]
3572
3567
 
@@ -46,8 +46,8 @@ class TestGemUtil < Gem::TestCase
46
46
 
47
47
  assert_equal File.join(@tempdir, 'd'), paths[0]
48
48
  assert_equal @tempdir, paths[1]
49
- assert_equal File.realpath(Dir.tmpdir), paths[2]
50
- assert_equal File.realpath("..", Dir.tmpdir), paths[3]
49
+ assert_equal File.realpath("..", @tempdir), paths[2]
50
+ assert_equal File.realpath("../..", @tempdir), paths[3]
51
51
  ensure
52
52
  # restore default permissions, allow the directory to be removed
53
53
  FileUtils.chmod(0775, 'd/e') unless win_platform? || java_platform?
@@ -72,10 +72,10 @@ class TestGemUtil < Gem::TestCase
72
72
  ]
73
73
 
74
74
  files_with_absolute_base = Gem::Util.glob_files_in_dir('*.rb', File.join(@tempdir, 'g'))
75
- assert_equal expected_paths.to_set, files_with_absolute_base.to_set
75
+ assert_equal expected_paths.sort, files_with_absolute_base.sort
76
76
 
77
77
  files_with_relative_base = Gem::Util.glob_files_in_dir('*.rb', 'g')
78
- assert_equal expected_paths.to_set, files_with_relative_base.to_set
78
+ assert_equal expected_paths.sort, files_with_relative_base.sort
79
79
  end
80
80
 
81
81
  def test_correct_for_windows_path
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.2.8
4
+ version: 3.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2021-02-02 00:00:00.000000000 Z
19
+ date: 2021-02-08 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
@@ -767,7 +767,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
767
767
  - !ruby/object:Gem::Version
768
768
  version: '0'
769
769
  requirements: []
770
- rubygems_version: 3.2.8
770
+ rubygems_version: 3.2.9
771
771
  signing_key:
772
772
  specification_version: 4
773
773
  summary: RubyGems is a package management framework for Ruby.