rubygems-update 3.3.21 → 3.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/Manifest.txt +8 -0
  4. data/POLICIES.md +38 -5
  5. data/bundler/CHANGELOG.md +40 -0
  6. data/bundler/bundler.gemspec +6 -8
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/init.rb +5 -1
  9. data/bundler/lib/bundler/cli.rb +2 -1
  10. data/bundler/lib/bundler/current_ruby.rb +14 -5
  11. data/bundler/lib/bundler/definition.rb +7 -20
  12. data/bundler/lib/bundler/dependency.rb +18 -85
  13. data/bundler/lib/bundler/dsl.rb +0 -1
  14. data/bundler/lib/bundler/endpoint_specification.rb +1 -1
  15. data/bundler/lib/bundler/feature_flag.rb +0 -1
  16. data/bundler/lib/bundler/gem_version_promoter.rb +10 -25
  17. data/bundler/lib/bundler/index.rb +3 -26
  18. data/bundler/lib/bundler/injector.rb +2 -1
  19. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  20. data/bundler/lib/bundler/man/bundle-add.1 +6 -2
  21. data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
  22. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-console.1 +53 -0
  28. data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
  29. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-help.1 +13 -0
  33. data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
  34. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-version.1 +35 -0
  49. data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
  50. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle.1 +6 -2
  52. data/bundler/lib/bundler/man/bundle.1.ronn +4 -1
  53. data/bundler/lib/bundler/man/gemfile.5 +8 -38
  54. data/bundler/lib/bundler/man/gemfile.5.ronn +9 -27
  55. data/bundler/lib/bundler/man/index.txt +3 -0
  56. data/bundler/lib/bundler/match_remote_metadata.rb +4 -1
  57. data/bundler/lib/bundler/resolver/base.rb +50 -0
  58. data/bundler/lib/bundler/resolver.rb +72 -93
  59. data/bundler/lib/bundler/rubygems_ext.rb +24 -3
  60. data/bundler/lib/bundler/settings.rb +0 -1
  61. data/bundler/lib/bundler/spec_set.rb +11 -1
  62. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
  63. data/bundler/lib/bundler/version.rb +1 -1
  64. data/lib/rubygems/gemcutter_utilities.rb +8 -1
  65. data/lib/rubygems/package.rb +9 -4
  66. data/lib/rubygems/platform.rb +17 -1
  67. data/lib/rubygems/query_utils.rb +2 -2
  68. data/lib/rubygems/resolver.rb +1 -1
  69. data/lib/rubygems.rb +1 -1
  70. data/rubygems-update.gemspec +1 -1
  71. data/test/rubygems/helper.rb +23 -19
  72. data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
  73. data/test/rubygems/test_gem.rb +254 -212
  74. data/test/rubygems/test_gem_commands_info_command.rb +26 -0
  75. data/test/rubygems/test_gem_commands_owner_command.rb +105 -24
  76. data/test/rubygems/test_gem_commands_push_command.rb +44 -23
  77. data/test/rubygems/test_gem_commands_signin_command.rb +28 -3
  78. data/test/rubygems/test_gem_commands_yank_command.rb +9 -9
  79. data/test/rubygems/test_gem_gemcutter_utilities.rb +16 -12
  80. data/test/rubygems/test_gem_package.rb +15 -0
  81. data/test/rubygems/test_gem_platform.rb +67 -0
  82. data/test/rubygems/test_gem_resolver.rb +33 -0
  83. data/test/rubygems/test_require.rb +5 -5
  84. data/test/rubygems/utilities.rb +36 -14
  85. metadata +11 -3
@@ -444,10 +444,10 @@ EOM
444
444
  directories << mkdir
445
445
  end
446
446
 
447
- File.open destination, "wb" do |out|
448
- out.write entry.read
447
+ if entry.file?
448
+ File.open(destination, "wb") {|out| out.write entry.read }
449
449
  FileUtils.chmod file_mode(entry.header.mode), destination
450
- end if entry.file?
450
+ end
451
451
 
452
452
  verbose destination
453
453
  end
@@ -467,7 +467,12 @@ EOM
467
467
  end
468
468
 
469
469
  def file_mode(mode) # :nodoc:
470
- ((mode & 0111).zero? ? data_mode : prog_mode) || mode
470
+ ((mode & 0111).zero? ? data_mode : prog_mode) ||
471
+ # If we're not using one of the default modes, then we're going to fall
472
+ # back to the mode from the tarball. In this case we need to mask it down
473
+ # to fit into 2^16 bits (the maximum value for a mode in CRuby since it
474
+ # gets put into an unsigned short).
475
+ (mode & ((1 << 16) - 1))
471
476
  end
472
477
 
473
478
  ##
@@ -22,6 +22,7 @@ class Gem::Platform
22
22
  end
23
23
 
24
24
  def self.match_platforms?(platform, platforms)
25
+ platform = Gem::Platform.new(platform) unless platform.is_a?(Gem::Platform)
25
26
  platforms.any? do |local_platform|
26
27
  platform.nil? ||
27
28
  local_platform == platform ||
@@ -162,6 +163,9 @@ class Gem::Platform
162
163
  # runtime platform "no version" stands for 'gnu'. To be able to disinguish
163
164
  # these, the method receiver is the gem platform, while the argument is
164
165
  # the runtime platform.
166
+ #
167
+ #--
168
+ # NOTE: Until it can be removed, changes to this method must also be reflected in `bundler/lib/bundler/rubygems_ext.rb`
165
169
 
166
170
  def ===(other)
167
171
  return nil unless Gem::Platform === other
@@ -180,11 +184,23 @@ class Gem::Platform
180
184
  # version
181
185
  (
182
186
  (@os != "linux" && (@version.nil? || other.version.nil?)) ||
183
- (@os == "linux" && ((@version.nil? && ["gnu", "musl"].include?(other.version)) || (@version == "gnu" && other.version.nil?))) ||
187
+ (@os == "linux" && (normalized_linux_version == other.normalized_linux_version || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
184
188
  @version == other.version
185
189
  )
186
190
  end
187
191
 
192
+ #--
193
+ # NOTE: Until it can be removed, changes to this method must also be reflected in `bundler/lib/bundler/rubygems_ext.rb`
194
+
195
+ def normalized_linux_version
196
+ return nil unless @version
197
+
198
+ without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi(hf)?\Z/, "")
199
+ return nil if without_gnu_nor_abi_modifiers.empty?
200
+
201
+ without_gnu_nor_abi_modifiers
202
+ end
203
+
188
204
  ##
189
205
  # Does +other+ match this platform? If +other+ is a String it will be
190
206
  # converted to a Gem::Platform first. See #=== for matching rules.
@@ -151,7 +151,7 @@ module Gem::QueryUtils
151
151
  fetcher.detect(specs_type) { true }
152
152
  else
153
153
  fetcher.detect(specs_type) do |name_tuple|
154
- name === name_tuple.name
154
+ name === name_tuple.name && options[:version].satisfied_by?(name_tuple.version)
155
155
  end
156
156
  end
157
157
 
@@ -159,7 +159,7 @@ module Gem::QueryUtils
159
159
  end
160
160
 
161
161
  def specs_type
162
- if options[:all]
162
+ if options[:all] || options[:version].specific?
163
163
  if options[:prerelease]
164
164
  :complete
165
165
  else
@@ -246,7 +246,7 @@ class Gem::Resolver
246
246
 
247
247
  sources.each do |source|
248
248
  groups[source].
249
- sort_by {|spec| [spec.version, Gem::Platform.local =~ spec.platform ? 1 : 0] }.
249
+ sort_by {|spec| [spec.version, spec.platform =~ Gem::Platform.local ? 1 : 0] }.
250
250
  map {|spec| ActivationRequest.new spec, dependency }.
251
251
  each {|activation_request| activation_requests << activation_request }
252
252
  end
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require "rbconfig"
9
9
 
10
10
  module Gem
11
- VERSION = "3.3.21".freeze
11
+ VERSION = "3.3.23".freeze
12
12
  end
13
13
 
14
14
  # 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.3.21"
5
+ s.version = "3.3.23"
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
 
@@ -2,26 +2,11 @@
2
2
 
3
3
  require "rubygems"
4
4
 
5
- # If bundler gemspec exists, add to stubs
6
- bundler_gemspec = File.expand_path("../../bundler/bundler.gemspec", __dir__)
7
- if File.exist?(bundler_gemspec)
8
- Gem::Specification.dirs.unshift File.dirname(bundler_gemspec)
9
- Gem::Specification.class_variable_set :@@stubs, nil
10
- Gem::Specification.stubs
11
- Gem::Specification.dirs.shift
12
- end
13
-
14
5
  begin
15
6
  gem "test-unit", "~> 3.0"
16
7
  rescue Gem::LoadError
17
8
  end
18
9
 
19
- if File.exist?(bundler_gemspec)
20
- require_relative "../../bundler/lib/bundler"
21
- else
22
- require "bundler"
23
- end
24
-
25
10
  require "test/unit"
26
11
 
27
12
  ENV["JARS_SKIP"] = "true" if Gem.java_platform? # avoid unnecessary and noisy `jar-dependencies` post install hook
@@ -334,8 +319,6 @@ class Gem::TestCase < Test::Unit::TestCase
334
319
  # capture output
335
320
  Gem::DefaultUserInteraction.ui = Gem::MockGemUi.new
336
321
 
337
- ENV["TMPDIR"] = @tempdir
338
-
339
322
  @orig_SYSTEM_WIDE_CONFIG_FILE = Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
340
323
  Gem::ConfigFile.send :remove_const, :SYSTEM_WIDE_CONFIG_FILE
341
324
  Gem::ConfigFile.send :const_set, :SYSTEM_WIDE_CONFIG_FILE,
@@ -411,7 +394,6 @@ class Gem::TestCase < Test::Unit::TestCase
411
394
  Gem.loaded_specs.clear
412
395
  Gem.instance_variable_set(:@activated_gem_paths, 0)
413
396
  Gem.clear_default_specs
414
- Bundler.reset!
415
397
 
416
398
  Gem.configuration.verbose = true
417
399
  Gem.configuration.update_sources = true
@@ -467,7 +449,7 @@ class Gem::TestCase < Test::Unit::TestCase
467
449
 
468
450
  FileUtils.rm_rf @tempdir
469
451
 
470
- ENV.replace(@orig_env)
452
+ restore_env
471
453
 
472
454
  Gem::ConfigFile.send :remove_const, :SYSTEM_WIDE_CONFIG_FILE
473
455
  Gem::ConfigFile.send :const_set, :SYSTEM_WIDE_CONFIG_FILE,
@@ -577,6 +559,7 @@ class Gem::TestCase < Test::Unit::TestCase
577
559
  Dir.chdir directory do
578
560
  unless File.exist? ".git"
579
561
  system @git, "init", "--quiet"
562
+ system @git, "checkout", "-b", "master", "--quiet"
580
563
  system @git, "config", "user.name", "RubyGems Tests"
581
564
  system @git, "config", "user.email", "rubygems@example"
582
565
  end
@@ -1303,6 +1286,10 @@ Also, a list:
1303
1286
  $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) }
1304
1287
  end
1305
1288
 
1289
+ def bundler_path
1290
+ $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/bundler.rb") }) }
1291
+ end
1292
+
1306
1293
  def with_clean_path_to_ruby
1307
1294
  orig_ruby = Gem.ruby
1308
1295
 
@@ -1583,6 +1570,23 @@ Also, a list:
1583
1570
  PUBLIC_KEY = nil
1584
1571
  PUBLIC_CERT = nil
1585
1572
  end if Gem::HAVE_OPENSSL
1573
+
1574
+ private
1575
+
1576
+ def restore_env
1577
+ unless Gem.win_platform?
1578
+ ENV.replace(@orig_env)
1579
+ return
1580
+ end
1581
+
1582
+ # Fallback logic for Windows below to workaround
1583
+ # https://bugs.ruby-lang.org/issues/16798. Can be dropped once all
1584
+ # supported rubies include the fix for that.
1585
+
1586
+ ENV.clear
1587
+
1588
+ @orig_env.each {|k, v| ENV[k] = v }
1589
+ end
1586
1590
  end
1587
1591
 
1588
1592
  # https://github.com/seattlerb/minitest/blob/13c48a03d84a2a87855a4de0c959f96800100357/lib/minitest/mock.rb#L192