rubygems-update 3.2.8 → 3.2.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -0
  3. data/Manifest.txt +1 -0
  4. data/Rakefile +6 -0
  5. data/bundler/CHANGELOG.md +48 -0
  6. data/bundler/lib/bundler.rb +1 -1
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/gem.rb +23 -17
  9. data/bundler/lib/bundler/definition.rb +26 -29
  10. data/bundler/lib/bundler/dsl.rb +36 -22
  11. data/bundler/lib/bundler/inline.rb +1 -0
  12. data/bundler/lib/bundler/installer.rb +2 -0
  13. data/bundler/lib/bundler/lockfile_parser.rb +12 -8
  14. data/bundler/lib/bundler/man/bundle-config.1 +4 -4
  15. data/bundler/lib/bundler/man/bundle-config.1.ronn +8 -7
  16. data/bundler/lib/bundler/plugin.rb +1 -0
  17. data/bundler/lib/bundler/plugin/installer.rb +8 -10
  18. data/bundler/lib/bundler/plugin/source_list.rb +4 -0
  19. data/bundler/lib/bundler/resolver.rb +36 -38
  20. data/bundler/lib/bundler/rubygems_gem_installer.rb +47 -0
  21. data/bundler/lib/bundler/source_list.rb +15 -18
  22. data/bundler/lib/bundler/stub_specification.rb +8 -0
  23. data/bundler/lib/bundler/templates/newgem/README.md.tt +5 -3
  24. data/bundler/lib/bundler/version.rb +1 -1
  25. data/lib/rubygems.rb +2 -2
  26. data/lib/rubygems/command.rb +1 -0
  27. data/lib/rubygems/config_file.rb +9 -0
  28. data/lib/rubygems/core_ext/tcpsocket_init.rb +52 -0
  29. data/lib/rubygems/dependency.rb +5 -1
  30. data/lib/rubygems/platform.rb +7 -3
  31. data/lib/rubygems/remote_fetcher.rb +1 -0
  32. data/lib/rubygems/specification.rb +13 -11
  33. data/lib/rubygems/test_case.rb +5 -6
  34. data/rubygems-update.gemspec +1 -1
  35. data/test/rubygems/test_gem.rb +80 -8
  36. data/test/rubygems/test_gem_commands_outdated_command.rb +18 -0
  37. data/test/rubygems/test_gem_config_file.rb +10 -0
  38. data/test/rubygems/test_gem_dependency_installer.rb +2 -18
  39. data/test/rubygems/test_gem_platform.rb +29 -0
  40. data/test/rubygems/test_gem_remote_fetcher.rb +6 -0
  41. data/test/rubygems/test_gem_specification.rb +10 -15
  42. data/test/rubygems/test_gem_util.rb +4 -4
  43. metadata +4 -3
@@ -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
@@ -41,6 +41,7 @@ class TestGemConfigFile < Gem::TestCase
41
41
  assert_equal true, @cfg.verbose
42
42
  assert_equal [@gem_repo], Gem.sources
43
43
  assert_equal 365, @cfg.cert_expiration_length_days
44
+ assert_equal false, @cfg.ipv4_fallback_enabled
44
45
 
45
46
  File.open @temp_conf, 'w' do |fp|
46
47
  fp.puts ":backtrace: true"
@@ -56,6 +57,7 @@ class TestGemConfigFile < Gem::TestCase
56
57
  fp.puts ":ssl_verify_mode: 0"
57
58
  fp.puts ":ssl_ca_cert: /etc/ssl/certs"
58
59
  fp.puts ":cert_expiration_length_days: 28"
60
+ fp.puts ":ipv4_fallback_enabled: true"
59
61
  end
60
62
 
61
63
  util_config_file
@@ -70,6 +72,14 @@ class TestGemConfigFile < Gem::TestCase
70
72
  assert_equal 0, @cfg.ssl_verify_mode
71
73
  assert_equal '/etc/ssl/certs', @cfg.ssl_ca_cert
72
74
  assert_equal 28, @cfg.cert_expiration_length_days
75
+ assert_equal true, @cfg.ipv4_fallback_enabled
76
+ end
77
+
78
+ def test_initialize_ipv4_fallback_enabled_env
79
+ ENV['IPV4_FALLBACK_ENABLED'] = 'true'
80
+ util_config_file %W[--config-file #{@temp_conf}]
81
+
82
+ assert_equal true, @cfg.ipv4_fallback_enabled
73
83
  end
74
84
 
75
85
  def test_initialize_handle_arguments_config_file
@@ -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
@@ -134,7 +134,9 @@ class TestGemPlatform < Gem::TestCase
134
134
  'i386-solaris2.8' => ['x86', 'solaris', '2.8'],
135
135
  'mswin32' => ['x86', 'mswin32', nil],
136
136
  'x86_64-linux' => ['x86_64', 'linux', nil],
137
+ 'x86_64-linux-gnu' => ['x86_64', 'linux', nil],
137
138
  'x86_64-linux-musl' => ['x86_64', 'linux', 'musl'],
139
+ 'x86_64-linux-uclibc' => ['x86_64', 'linux', 'uclibc'],
138
140
  'x86_64-openbsd3.9' => ['x86_64', 'openbsd', '3.9'],
139
141
  'x86_64-openbsd4.0' => ['x86_64', 'openbsd', '4.0'],
140
142
  'x86_64-openbsd' => ['x86_64', 'openbsd', nil],
@@ -143,6 +145,7 @@ class TestGemPlatform < Gem::TestCase
143
145
  test_cases.each do |arch, expected|
144
146
  platform = Gem::Platform.new arch
145
147
  assert_equal expected, platform.to_a, arch.inspect
148
+ assert_equal expected, Gem::Platform.new(platform.to_s).to_a, arch.inspect
146
149
  end
147
150
  end
148
151
 
@@ -261,6 +264,32 @@ class TestGemPlatform < Gem::TestCase
261
264
  assert((with_x86_arch === with_nil_arch), 'x86 =~ nil')
262
265
  end
263
266
 
267
+ def test_nil_version_is_treated_as_any_version
268
+ x86_darwin_8 = Gem::Platform.new 'i686-darwin8.0'
269
+ x86_darwin_nil = Gem::Platform.new 'i686-darwin'
270
+
271
+ assert((x86_darwin_8 === x86_darwin_nil), '8.0 =~ nil')
272
+ assert((x86_darwin_nil === x86_darwin_8), 'nil =~ 8.0')
273
+ end
274
+
275
+ def test_nil_version_is_stricter_for_linux_os
276
+ x86_linux = Gem::Platform.new 'i686-linux'
277
+ x86_linux_gnu = Gem::Platform.new 'i686-linux-gnu'
278
+ x86_linux_musl = Gem::Platform.new 'i686-linux-musl'
279
+ x86_linux_uclibc = Gem::Platform.new 'i686-linux-uclibc'
280
+
281
+ assert((x86_linux === x86_linux_gnu), 'linux =~ linux-gnu')
282
+ assert((x86_linux_gnu === x86_linux), 'linux-gnu =~ linux')
283
+ assert(!(x86_linux_gnu === x86_linux_musl), 'linux-gnu =~ linux-musl')
284
+ assert(!(x86_linux_musl === x86_linux_gnu), 'linux-musl =~ linux-gnu')
285
+ assert(!(x86_linux_uclibc === x86_linux_musl), 'linux-uclibc =~ linux-musl')
286
+ assert(!(x86_linux_musl === x86_linux_uclibc), 'linux-musl =~ linux-uclibc')
287
+ assert(!(x86_linux === x86_linux_musl), 'linux =~ linux-musl')
288
+ assert(!(x86_linux_musl === x86_linux), 'linux-musl =~ linux')
289
+ assert(!(x86_linux === x86_linux_uclibc), 'linux =~ linux-uclibc')
290
+ assert(!(x86_linux_uclibc === x86_linux), 'linux-uclibc =~ linux')
291
+ end
292
+
264
293
  def test_equals3_cpu_arm
265
294
  arm = Gem::Platform.new 'arm-linux'
266
295
  armv5 = Gem::Platform.new 'armv5-linux'
@@ -962,6 +962,12 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
962
962
  end
963
963
  end
964
964
 
965
+ def test_tcpsocketext_require
966
+ with_configured_fetcher(":ipv4_fallback_enabled: true") do |fetcher|
967
+ refute require('rubygems/core_ext/tcpsocket_init')
968
+ end
969
+ end
970
+
965
971
  def with_configured_fetcher(config_str = nil, &block)
966
972
  if config_str
967
973
  temp_conf = File.join @tempdir, '.gemrc'
@@ -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.13
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-03-03 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
@@ -410,6 +410,7 @@ files:
410
410
  - lib/rubygems/core_ext/kernel_gem.rb
411
411
  - lib/rubygems/core_ext/kernel_require.rb
412
412
  - lib/rubygems/core_ext/kernel_warn.rb
413
+ - lib/rubygems/core_ext/tcpsocket_init.rb
413
414
  - lib/rubygems/defaults.rb
414
415
  - lib/rubygems/dependency.rb
415
416
  - lib/rubygems/dependency_installer.rb
@@ -767,7 +768,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
767
768
  - !ruby/object:Gem::Version
768
769
  version: '0'
769
770
  requirements: []
770
- rubygems_version: 3.2.8
771
+ rubygems_version: 3.2.13
771
772
  signing_key:
772
773
  specification_version: 4
773
774
  summary: RubyGems is a package management framework for Ruby.