rubygems-update 3.2.32 → 3.2.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +88 -0
  3. data/Manifest.txt +4 -0
  4. data/bundler/CHANGELOG.md +29 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/cli/doctor.rb +3 -2
  7. data/bundler/lib/bundler/cli/gem.rb +1 -0
  8. data/bundler/lib/bundler/cli/info.rb +6 -1
  9. data/bundler/lib/bundler/cli/update.rb +2 -2
  10. data/bundler/lib/bundler/cli.rb +1 -0
  11. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -5
  12. data/bundler/lib/bundler/definition.rb +17 -50
  13. data/bundler/lib/bundler/dsl.rb +18 -3
  14. data/bundler/lib/bundler/environment_preserver.rb +4 -1
  15. data/bundler/lib/bundler/lazy_specification.rb +17 -1
  16. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  17. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  18. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  20. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle.1 +1 -1
  40. data/bundler/lib/bundler/man/gemfile.5 +27 -1
  41. data/bundler/lib/bundler/man/gemfile.5.ronn +8 -0
  42. data/bundler/lib/bundler/plugin/api/source.rb +1 -0
  43. data/bundler/lib/bundler/resolver.rb +2 -4
  44. data/bundler/lib/bundler/shared_helpers.rb +2 -3
  45. data/bundler/lib/bundler/source/git/git_proxy.rb +2 -2
  46. data/bundler/lib/bundler/source/rubygems.rb +16 -12
  47. data/bundler/lib/bundler/source/rubygems_aggregate.rb +1 -1
  48. data/bundler/lib/bundler/source.rb +1 -1
  49. data/bundler/lib/bundler/source_list.rb +7 -29
  50. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -2
  51. data/bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  52. data/bundler/lib/bundler/vendor/.document +1 -0
  53. data/bundler/lib/bundler/version.rb +1 -1
  54. data/lib/rubygems/command_manager.rb +3 -1
  55. data/lib/rubygems/commands/pristine_command.rb +8 -2
  56. data/lib/rubygems/commands/setup_command.rb +17 -6
  57. data/lib/rubygems/exceptions.rb +1 -0
  58. data/lib/rubygems/installer.rb +3 -11
  59. data/lib/rubygems/optparse/.document +1 -0
  60. data/lib/rubygems/specification.rb +9 -5
  61. data/lib/rubygems/tsort/.document +1 -0
  62. data/lib/rubygems.rb +5 -5
  63. data/rubygems-update.gemspec +1 -1
  64. data/test/rubygems/test_gem_command_manager.rb +12 -0
  65. data/test/rubygems/test_gem_commands_setup_command.rb +17 -0
  66. data/test/rubygems/test_gem_installer.rb +37 -5
  67. data/test/rubygems/test_require.rb +4 -26
  68. metadata +7 -3
@@ -182,8 +182,8 @@ By default, this RubyGems will install gem as:
182
182
 
183
183
  say "RubyGems #{Gem::VERSION} installed"
184
184
 
185
- regenerate_binstubs if options[:regenerate_binstubs]
186
- regenerate_plugins if options[:regenerate_plugins]
185
+ regenerate_binstubs(bin_dir) if options[:regenerate_binstubs]
186
+ regenerate_plugins(bin_dir) if options[:regenerate_plugins]
187
187
 
188
188
  uninstall_old_gemcutter
189
189
 
@@ -411,8 +411,16 @@ By default, this RubyGems will install gem as:
411
411
  Dir.chdir("bundler") do
412
412
  built_gem = Gem::Package.build(bundler_spec)
413
413
  begin
414
- installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], force: options[:force], install_as_default: true, bin_dir: bin_dir, wrappers: true)
415
- installer.install
414
+ Gem::Installer.at(
415
+ built_gem,
416
+ env_shebang: options[:env_shebang],
417
+ format_executable: options[:format_executable],
418
+ force: options[:force],
419
+ install_as_default: true,
420
+ bin_dir: bin_dir,
421
+ install_dir: default_dir,
422
+ wrappers: true
423
+ ).install
416
424
  ensure
417
425
  FileUtils.rm_f built_gem
418
426
  end
@@ -594,11 +602,12 @@ abort "#{deprecation_message}"
594
602
  rescue Gem::InstallError
595
603
  end
596
604
 
597
- def regenerate_binstubs
605
+ def regenerate_binstubs(bindir)
598
606
  require_relative "pristine_command"
599
607
  say "Regenerating binstubs"
600
608
 
601
609
  args = %w[--all --only-executables --silent]
610
+ args << "--bindir=#{bindir}"
602
611
  if options[:env_shebang]
603
612
  args << "--env-shebang"
604
613
  end
@@ -607,11 +616,13 @@ abort "#{deprecation_message}"
607
616
  command.invoke(*args)
608
617
  end
609
618
 
610
- def regenerate_plugins
619
+ def regenerate_plugins(bindir)
611
620
  require_relative "pristine_command"
612
621
  say "Regenerating plugins"
613
622
 
614
623
  args = %w[--all --only-plugins --silent]
624
+ args << "--bindir=#{bindir}"
625
+ args << "--install-dir=#{default_dir}"
615
626
 
616
627
  command = Gem::Commands::PristineCommand.new
617
628
  command.invoke(*args)
@@ -259,3 +259,4 @@ end
259
259
  # Backwards compatible typo'd exception class for early RubyGems 2.0.x
260
260
 
261
261
  Gem::UnsatisfiableDepedencyError = Gem::UnsatisfiableDependencyError # :nodoc:
262
+ Gem.deprecate_constant :UnsatisfiableDepedencyError
@@ -293,8 +293,6 @@ class Gem::Installer
293
293
  def install
294
294
  pre_install_checks
295
295
 
296
- FileUtils.rm_f File.join gem_home, 'specifications', spec.spec_name
297
-
298
296
  run_pre_install_hooks
299
297
 
300
298
  # Set loaded_from to ensure extension_dir is correct
@@ -448,13 +446,9 @@ class Gem::Installer
448
446
  # specifications directory.
449
447
 
450
448
  def write_spec
451
- File.open spec_file, 'w' do |file|
452
- spec.installed_by_version = Gem.rubygems_version
453
-
454
- file.puts spec.to_ruby_for_cache
449
+ spec.installed_by_version = Gem.rubygems_version
455
450
 
456
- file.fsync rescue nil # for filesystems without fsync(2)
457
- end
451
+ Gem.write_binary(spec_file, spec.to_ruby_for_cache)
458
452
  end
459
453
 
460
454
  ##
@@ -462,9 +456,7 @@ class Gem::Installer
462
456
  # specifications/default directory.
463
457
 
464
458
  def write_default_spec
465
- File.open(default_spec_file, "w") do |file|
466
- file.puts spec.to_ruby
467
- end
459
+ Gem.write_binary(default_spec_file, spec.to_ruby)
468
460
  end
469
461
 
470
462
  ##
@@ -0,0 +1 @@
1
+ # Vendored files do not need to be documented
@@ -287,6 +287,15 @@ class Gem::Specification < Gem::BasicSpecification
287
287
  ######################################################################
288
288
  # :section: Recommended gemspec attributes
289
289
 
290
+ ##
291
+ # The version of Ruby required by this gem
292
+ #
293
+ # Usage:
294
+ #
295
+ # spec.required_ruby_version = '>= 2.7.0'
296
+
297
+ attr_reader :required_ruby_version
298
+
290
299
  ##
291
300
  # A long description of this gem
292
301
  #
@@ -522,11 +531,6 @@ class Gem::Specification < Gem::BasicSpecification
522
531
  @require_paths = Array(val)
523
532
  end
524
533
 
525
- ##
526
- # The version of Ruby required by this gem
527
-
528
- attr_reader :required_ruby_version
529
-
530
534
  ##
531
535
  # The RubyGems version required by this gem
532
536
 
@@ -0,0 +1 @@
1
+ # Vendored files do not need to be documented
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.32".freeze
11
+ VERSION = "3.2.33".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -800,11 +800,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
800
800
  ##
801
801
  # Safely write a file in binary mode on all platforms.
802
802
  def self.write_binary(path, data)
803
+ File.open(path, File::RDWR | File::CREAT | File::BINARY | File::LOCK_EX) do |io|
804
+ io.write data
805
+ end
806
+ rescue *WRITE_BINARY_ERRORS
803
807
  File.open(path, 'wb') do |io|
804
- begin
805
- io.flock(File::LOCK_EX)
806
- rescue *WRITE_BINARY_ERRORS
807
- end
808
808
  io.write data
809
809
  end
810
810
  rescue Errno::ENOLCK # NFS
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.32"
5
+ s.version = "3.2.33"
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
 
@@ -36,6 +36,18 @@ class TestGemCommandManager < Gem::TestCase
36
36
  assert_kind_of Gem::Commands::InstallCommand, command
37
37
  end
38
38
 
39
+ def test_find_login_alias_command
40
+ command = @command_manager.find_command 'login'
41
+
42
+ assert_kind_of Gem::Commands::SigninCommand, command
43
+ end
44
+
45
+ def test_find_logout_alias_comamnd
46
+ command = @command_manager.find_command 'logout'
47
+
48
+ assert_kind_of Gem::Commands::SignoutCommand, command
49
+ end
50
+
39
51
  def test_find_command_ambiguous_exact
40
52
  ins_command = Class.new
41
53
  Gem::Commands.send :const_set, :InsCommand, ins_command
@@ -156,6 +156,21 @@ class TestGemCommandsSetupCommand < Gem::TestCase
156
156
  assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_bin_path)
157
157
  end
158
158
 
159
+ def test_destdir_flag_does_not_try_to_write_to_the_default_gem_home
160
+ FileUtils.chmod "-w", File.join(@gemhome, "plugins")
161
+
162
+ destdir = File.join(@tempdir, 'foo')
163
+
164
+ @cmd.options[:destdir] = destdir
165
+ @cmd.execute
166
+
167
+ spec = Gem::Specification.load("bundler/bundler.gemspec")
168
+
169
+ spec.executables.each do |e|
170
+ assert_path_exist File.join destdir, @gemhome.gsub(/^[a-zA-Z]:/, ''), 'gems', spec.full_name, spec.bindir, e
171
+ end
172
+ end
173
+
159
174
  def test_files_in
160
175
  assert_equal %w[rubygems.rb rubygems/requirement.rb rubygems/ssl_certs/rubygems.org/foo.pem],
161
176
  @cmd.files_in('lib').sort
@@ -245,6 +260,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
245
260
  def test_install_default_bundler_gem_with_destdir_flag
246
261
  @cmd.extend FileUtils
247
262
 
263
+ FileUtils.chmod "-w", @gemhome
264
+
248
265
  destdir = File.join(@tempdir, 'foo')
249
266
  bin_dir = File.join(destdir, 'bin')
250
267
 
@@ -288,6 +288,33 @@ gem 'other', version
288
288
  "(SyntaxError)", e.message
289
289
  end
290
290
 
291
+ def test_ensure_no_race_conditions_between_installing_and_loading_gemspecs
292
+ a, a_gem = util_gem 'a', 2
293
+
294
+ Gem::Installer.at(a_gem).install
295
+
296
+ t1 = Thread.new do
297
+ 5.times do
298
+ Gem::Installer.at(a_gem).install
299
+ sleep 0.1
300
+ end
301
+ end
302
+
303
+ t2 = Thread.new do
304
+ _, err = capture_output do
305
+ 20.times do
306
+ Gem::Specification.load(a.spec_file)
307
+ Gem::Specification.send(:clear_load_cache)
308
+ end
309
+ end
310
+
311
+ assert_empty err
312
+ end
313
+
314
+ t1.join
315
+ t2.join
316
+ end
317
+
291
318
  def test_ensure_loadable_spec_security_policy
292
319
  pend 'openssl is missing' unless Gem::HAVE_OPENSSL
293
320
 
@@ -948,7 +975,6 @@ gem 'other', version
948
975
 
949
976
  Gem.pre_install do
950
977
  assert_path_not_exist cache_file, 'cache file must not exist yet'
951
- assert_path_not_exist spec_file, 'spec file must not exist yet'
952
978
  true
953
979
  end
954
980
 
@@ -956,13 +982,11 @@ gem 'other', version
956
982
  assert_path_exist gemdir, 'gem install dir must exist'
957
983
  assert_path_exist rakefile, 'gem executable must exist'
958
984
  assert_path_not_exist stub_exe, 'gem executable must not exist'
959
- assert_path_not_exist spec_file, 'spec file must not exist yet'
960
985
  true
961
986
  end
962
987
 
963
988
  Gem.post_install do
964
989
  assert_path_exist cache_file, 'cache file must exist'
965
- assert_path_exist spec_file, 'spec file must exist'
966
990
  end
967
991
 
968
992
  @newspec = nil
@@ -1237,7 +1261,11 @@ gem 'other', version
1237
1261
  end
1238
1262
 
1239
1263
  def test_install_post_build_false
1240
- installer = setup_base_installer
1264
+ @spec = util_spec 'a'
1265
+
1266
+ util_build_gem @spec
1267
+
1268
+ installer = util_installer @spec, @gemhome
1241
1269
 
1242
1270
  Gem.post_build do
1243
1271
  false
@@ -1279,7 +1307,11 @@ gem 'other', version
1279
1307
  end
1280
1308
 
1281
1309
  def test_install_pre_install_false
1282
- installer = setup_base_installer
1310
+ @spec = util_spec 'a'
1311
+
1312
+ util_build_gem @spec
1313
+
1314
+ installer = util_installer @spec, @gemhome
1283
1315
 
1284
1316
  Gem.pre_install do
1285
1317
  false
@@ -24,16 +24,6 @@ class TestGemRequire < Gem::TestCase
24
24
  end
25
25
  end
26
26
 
27
- def setup
28
- super
29
-
30
- @old_loaded_features = $LOADED_FEATURES.dup
31
- assert_raise LoadError do
32
- require 'test_gem_require_a'
33
- end
34
- $LOADED_FEATURES.replace @old_loaded_features
35
- end
36
-
37
27
  def assert_require(path)
38
28
  assert require(path), "'#{path}' was already required"
39
29
  end
@@ -88,8 +78,6 @@ class TestGemRequire < Gem::TestCase
88
78
  FileUtils.mkdir_p File.dirname c_rb
89
79
  File.open(c_rb, 'w') {|f| f.write "class Object; HELLO = 'world' end" }
90
80
 
91
- lp = $LOAD_PATH.dup
92
-
93
81
  # Pretend to provide a commandline argument that overrides a file in gem b
94
82
  $LOAD_PATH.unshift dash_i_arg
95
83
 
@@ -98,7 +86,6 @@ class TestGemRequire < Gem::TestCase
98
86
  assert_equal "world", ::Object::HELLO
99
87
  assert_equal %w[a-1 b-1], loaded_spec_names
100
88
  ensure
101
- $LOAD_PATH.replace lp
102
89
  Object.send :remove_const, :HELLO if Object.const_defined? :HELLO
103
90
  end
104
91
 
@@ -132,8 +119,6 @@ class TestGemRequire < Gem::TestCase
132
119
 
133
120
  assert_require 'test_gem_require_a'
134
121
 
135
- lp = $LOAD_PATH.dup
136
-
137
122
  # Pretend to provide a commandline argument that overrides a file in gem b
138
123
  $LOAD_PATH.unshift dash_i_arg
139
124
 
@@ -142,7 +127,6 @@ class TestGemRequire < Gem::TestCase
142
127
  assert_equal "world", ::Object::HELLO
143
128
  assert_equal %w[a-1 b-1], loaded_spec_names
144
129
  ensure
145
- $LOAD_PATH.replace lp
146
130
  Object.send :remove_const, :HELLO if Object.const_defined? :HELLO
147
131
  end
148
132
 
@@ -153,16 +137,10 @@ class TestGemRequire < Gem::TestCase
153
137
  dash_i_ext_arg = util_install_extension_file('a')
154
138
  dash_i_lib_arg = util_install_ruby_file('a')
155
139
 
156
- lp = $LOAD_PATH.dup
157
-
158
- begin
159
- $LOAD_PATH.unshift dash_i_lib_arg
160
- $LOAD_PATH.unshift dash_i_ext_arg
161
- assert_require 'a'
162
- assert_match(/a\.rb$/, $LOADED_FEATURES.last)
163
- ensure
164
- $LOAD_PATH.replace lp
165
- end
140
+ $LOAD_PATH.unshift dash_i_lib_arg
141
+ $LOAD_PATH.unshift dash_i_ext_arg
142
+ assert_require 'a'
143
+ assert_match(/a\.rb$/, $LOADED_FEATURES.last)
166
144
  end
167
145
 
168
146
  def test_concurrent_require
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.32
4
+ version: 3.2.33
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-11-23 00:00:00.000000000 Z
19
+ date: 2021-12-07 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
@@ -268,6 +268,7 @@ files:
268
268
  - bundler/lib/bundler/templates/newgem/newgem.gemspec.tt
269
269
  - bundler/lib/bundler/templates/newgem/rspec.tt
270
270
  - bundler/lib/bundler/templates/newgem/rubocop.yml.tt
271
+ - bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt
271
272
  - bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
272
273
  - bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
273
274
  - bundler/lib/bundler/templates/newgem/standard.yml.tt
@@ -281,6 +282,7 @@ files:
281
282
  - bundler/lib/bundler/ui/shell.rb
282
283
  - bundler/lib/bundler/ui/silent.rb
283
284
  - bundler/lib/bundler/uri_credentials_filter.rb
285
+ - bundler/lib/bundler/vendor/.document
284
286
  - bundler/lib/bundler/vendor/connection_pool/LICENSE
285
287
  - bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb
286
288
  - bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
@@ -451,6 +453,7 @@ files:
451
453
  - lib/rubygems/name_tuple.rb
452
454
  - lib/rubygems/openssl.rb
453
455
  - lib/rubygems/optparse.rb
456
+ - lib/rubygems/optparse/.document
454
457
  - lib/rubygems/optparse/COPYING
455
458
  - lib/rubygems/optparse/lib/optionparser.rb
456
459
  - lib/rubygems/optparse/lib/optparse.rb
@@ -564,6 +567,7 @@ files:
564
567
  - lib/rubygems/stub_specification.rb
565
568
  - lib/rubygems/text.rb
566
569
  - lib/rubygems/tsort.rb
570
+ - lib/rubygems/tsort/.document
567
571
  - lib/rubygems/tsort/LICENSE.txt
568
572
  - lib/rubygems/tsort/lib/tsort.rb
569
573
  - lib/rubygems/uninstaller.rb
@@ -798,7 +802,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
798
802
  - !ruby/object:Gem::Version
799
803
  version: '0'
800
804
  requirements: []
801
- rubygems_version: 3.2.32
805
+ rubygems_version: 3.2.33
802
806
  signing_key:
803
807
  specification_version: 4
804
808
  summary: RubyGems is a package management framework for Ruby.