rubygems-update 3.3.19 → 3.3.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -0
- data/Manifest.txt +11 -1
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +71 -0
- data/bundler/UPGRADING.md +11 -4
- data/bundler/bundler.gemspec +6 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/install.rb +5 -2
- data/bundler/lib/bundler/cli/outdated.rb +12 -3
- data/bundler/lib/bundler/cli/platform.rb +1 -1
- data/bundler/lib/bundler/cli.rb +7 -4
- data/bundler/lib/bundler/current_ruby.rb +14 -5
- data/bundler/lib/bundler/definition.rb +85 -33
- data/bundler/lib/bundler/dependency.rb +18 -85
- data/bundler/lib/bundler/endpoint_specification.rb +2 -13
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher.rb +6 -6
- data/bundler/lib/bundler/gem_helpers.rb +7 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +8 -18
- data/bundler/lib/bundler/injector.rb +2 -1
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer/standalone.rb +1 -1
- data/bundler/lib/bundler/installer.rb +14 -12
- data/bundler/lib/bundler/lazy_specification.rb +23 -25
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/man/bundle-add.1 +6 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +7 -1
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +7 -0
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +13 -4
- data/bundler/lib/bundler/man/bundle-config.1.ronn +7 -4
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +5 -1
- data/bundler/lib/bundler/man/bundle-install.1.ronn +6 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +16 -6
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +13 -8
- data/bundler/lib/bundler/man/bundle.1.ronn +10 -5
- data/bundler/lib/bundler/man/gemfile.5 +8 -38
- data/bundler/lib/bundler/man/gemfile.5.ronn +9 -27
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/plugin.rb +2 -0
- data/bundler/lib/bundler/remote_specification.rb +1 -7
- data/bundler/lib/bundler/resolver/base.rb +50 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +11 -8
- data/bundler/lib/bundler/resolver.rb +94 -88
- data/bundler/lib/bundler/ruby_dsl.rb +1 -1
- data/bundler/lib/bundler/ruby_version.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +52 -1
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source/metadata.rb +1 -1
- data/bundler/lib/bundler/source_list.rb +4 -0
- data/bundler/lib/bundler/spec_set.rb +41 -34
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +3 -4
- data/lib/rubygems/available_set.rb +3 -3
- data/lib/rubygems/basic_specification.rb +2 -2
- data/lib/rubygems/command.rb +6 -6
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +1 -1
- data/lib/rubygems/commands/contents_command.rb +1 -1
- data/lib/rubygems/commands/dependency_command.rb +4 -4
- data/lib/rubygems/commands/fetch_command.rb +2 -2
- data/lib/rubygems/commands/generate_index_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +7 -7
- data/lib/rubygems/commands/pristine_command.rb +5 -5
- data/lib/rubygems/commands/setup_command.rb +4 -4
- data/lib/rubygems/commands/sources_command.rb +3 -3
- data/lib/rubygems/commands/specification_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +4 -4
- data/lib/rubygems/commands/update_command.rb +5 -5
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/config_file.rb +7 -7
- data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/dependency.rb +5 -5
- data/lib/rubygems/dependency_installer.rb +5 -5
- data/lib/rubygems/dependency_list.rb +4 -4
- data/lib/rubygems/doctor.rb +4 -4
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +1 -1
- data/lib/rubygems/indexer.rb +3 -3
- data/lib/rubygems/installer.rb +5 -13
- data/lib/rubygems/name_tuple.rb +3 -3
- data/lib/rubygems/package/tar_header.rb +17 -17
- data/lib/rubygems/package/tar_writer.rb +1 -1
- data/lib/rubygems/package.rb +19 -8
- data/lib/rubygems/platform.rb +30 -19
- data/lib/rubygems/query_utils.rb +8 -8
- data/lib/rubygems/remote_fetcher.rb +3 -3
- data/lib/rubygems/request/connection_pools.rb +2 -2
- data/lib/rubygems/request/http_pool.rb +1 -1
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- data/lib/rubygems/request_set/lockfile/parser.rb +12 -12
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +2 -2
- data/lib/rubygems/request_set.rb +3 -3
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/api_specification.rb +4 -4
- data/lib/rubygems/resolver/best_set.rb +3 -3
- data/lib/rubygems/resolver/conflict.rb +3 -3
- data/lib/rubygems/resolver/git_specification.rb +3 -3
- data/lib/rubygems/resolver/index_specification.rb +3 -2
- data/lib/rubygems/resolver/installed_specification.rb +2 -2
- data/lib/rubygems/resolver/installer_set.rb +7 -12
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver/lock_specification.rb +1 -1
- data/lib/rubygems/resolver/vendor_specification.rb +3 -3
- data/lib/rubygems/resolver.rb +4 -4
- data/lib/rubygems/security/policy.rb +6 -6
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/source/git.rb +4 -4
- data/lib/rubygems/source.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +1 -1
- data/lib/rubygems/specification.rb +26 -24
- data/lib/rubygems/specification_policy.rb +4 -4
- data/lib/rubygems/uninstaller.rb +4 -4
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/version.rb +12 -4
- data/lib/rubygems.rb +8 -8
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -1
- data/test/rubygems/helper.rb +5 -7
- data/test/rubygems/test_gem_commands_info_command.rb +26 -0
- data/test/rubygems/test_gem_config_file.rb +17 -5
- data/test/rubygems/test_gem_dependency_installer.rb +2 -2
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +4 -4
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +4 -4
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +1 -1
- data/test/rubygems/test_gem_installer.rb +6 -3
- data/test/rubygems/test_gem_package.rb +22 -0
- data/test/rubygems/test_gem_package_tar_reader.rb +1 -1
- data/test/rubygems/test_gem_platform.rb +73 -2
- data/test/rubygems/test_gem_requirement.rb +9 -3
- data/test/rubygems/test_gem_resolver.rb +37 -3
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +44 -0
- data/test/rubygems/test_gem_specification.rb +11 -2
- data/test/rubygems/test_gem_version.rb +9 -2
- data/test/rubygems/test_require.rb +1 -1
- data/test/rubygems/utilities.rb +4 -4
- metadata +14 -4
- data/bundler/lib/bundler/incomplete_specification.rb +0 -12
data/lib/rubygems.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
require "rbconfig"
|
9
9
|
|
10
10
|
module Gem
|
11
|
-
VERSION = "3.3.
|
11
|
+
VERSION = "3.3.22".freeze
|
12
12
|
end
|
13
13
|
|
14
14
|
# Must be first since it unloads the prelude from 1.9.2
|
@@ -121,7 +121,7 @@ module Gem
|
|
121
121
|
|
122
122
|
# When https://bugs.ruby-lang.org/issues/17259 is available, there is no need to override Kernel#warn
|
123
123
|
KERNEL_WARN_IGNORES_INTERNAL_ENTRIES = RUBY_ENGINE == "truffleruby" ||
|
124
|
-
|
124
|
+
(RUBY_ENGINE == "ruby" && RUBY_VERSION >= "3.0")
|
125
125
|
|
126
126
|
##
|
127
127
|
# An Array of Regexps that match windows Ruby platforms.
|
@@ -741,8 +741,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
741
741
|
def self.prefix
|
742
742
|
prefix = File.dirname RUBYGEMS_DIR
|
743
743
|
|
744
|
-
if prefix != File.expand_path(RbConfig::CONFIG["sitelibdir"])
|
745
|
-
prefix != File.expand_path(RbConfig::CONFIG["libdir"])
|
744
|
+
if prefix != File.expand_path(RbConfig::CONFIG["sitelibdir"]) &&
|
745
|
+
prefix != File.expand_path(RbConfig::CONFIG["libdir"]) &&
|
746
746
|
"lib" == File.basename(RUBYGEMS_DIR)
|
747
747
|
prefix
|
748
748
|
end
|
@@ -845,8 +845,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
845
845
|
# Returns the latest release version of RubyGems.
|
846
846
|
|
847
847
|
def self.latest_rubygems_version
|
848
|
-
latest_version_for("rubygems-update")
|
849
|
-
raise
|
848
|
+
latest_version_for("rubygems-update") ||
|
849
|
+
raise("Can't find 'rubygems-update' in any repo. Check `gem source list`.")
|
850
850
|
end
|
851
851
|
|
852
852
|
##
|
@@ -854,7 +854,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
854
854
|
|
855
855
|
def self.latest_version_for(name)
|
856
856
|
spec = latest_spec_for name
|
857
|
-
spec
|
857
|
+
spec && spec.version
|
858
858
|
end
|
859
859
|
|
860
860
|
##
|
@@ -944,7 +944,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
944
944
|
".rb",
|
945
945
|
*%w[DLEXT DLEXT2].map do |key|
|
946
946
|
val = RbConfig::CONFIG[key]
|
947
|
-
next unless val
|
947
|
+
next unless val && !val.empty?
|
948
948
|
".#{val}"
|
949
949
|
end,
|
950
950
|
].compact.uniq
|
data/rubygems-update.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rubygems-update"
|
5
|
-
s.version = "3.3.
|
5
|
+
s.version = "3.3.22"
|
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
|
|
data/setup.rb
CHANGED
data/test/rubygems/helper.rb
CHANGED
@@ -334,8 +334,6 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
334
334
|
# capture output
|
335
335
|
Gem::DefaultUserInteraction.ui = Gem::MockGemUi.new
|
336
336
|
|
337
|
-
ENV["TMPDIR"] = @tempdir
|
338
|
-
|
339
337
|
@orig_SYSTEM_WIDE_CONFIG_FILE = Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
|
340
338
|
Gem::ConfigFile.send :remove_const, :SYSTEM_WIDE_CONFIG_FILE
|
341
339
|
Gem::ConfigFile.send :const_set, :SYSTEM_WIDE_CONFIG_FILE,
|
@@ -599,7 +597,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
599
597
|
end
|
600
598
|
|
601
599
|
def in_path?(executable) # :nodoc:
|
602
|
-
return true if %r{\A([A-Z]:|/)} =~ executable
|
600
|
+
return true if %r{\A([A-Z]:|/)} =~ executable && File.exist?(executable)
|
603
601
|
|
604
602
|
ENV["PATH"].split(File::PATH_SEPARATOR).any? do |directory|
|
605
603
|
File.exist? File.join directory, executable
|
@@ -849,7 +847,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
849
847
|
# or a +block+ can be given for full customization of the specification.
|
850
848
|
|
851
849
|
def util_spec(name, version = 2, deps = nil, *files) # :yields: specification
|
852
|
-
raise "deps or block, not both" if deps
|
850
|
+
raise "deps or block, not both" if deps && block_given?
|
853
851
|
|
854
852
|
spec = Gem::Specification.new do |s|
|
855
853
|
s.platform = Gem::Platform::RUBY
|
@@ -1279,10 +1277,10 @@ Also, a list:
|
|
1279
1277
|
rubyexe = "#{ruby}.exe"
|
1280
1278
|
|
1281
1279
|
3.times do
|
1282
|
-
if File.exist?
|
1280
|
+
if File.exist?(ruby) && File.executable?(ruby) && !File.directory?(ruby)
|
1283
1281
|
return File.expand_path(ruby)
|
1284
1282
|
end
|
1285
|
-
if File.exist?
|
1283
|
+
if File.exist?(rubyexe) && File.executable?(rubyexe)
|
1286
1284
|
return File.expand_path(rubyexe)
|
1287
1285
|
end
|
1288
1286
|
ruby = File.join("..", ruby)
|
@@ -1592,7 +1590,7 @@ class Object
|
|
1592
1590
|
|
1593
1591
|
metaclass = class << self; self; end
|
1594
1592
|
|
1595
|
-
if respond_to?
|
1593
|
+
if respond_to?(name) && !methods.map(&:to_s).include?(name.to_s)
|
1596
1594
|
metaclass.send :define_method, name do |*args|
|
1597
1595
|
super(*args)
|
1598
1596
|
end
|
@@ -40,4 +40,30 @@ class TestGemCommandsInfoCommand < Gem::TestCase
|
|
40
40
|
assert_match %r{#{@gem.summary}\n}, @ui.output
|
41
41
|
assert_match "", @ui.error
|
42
42
|
end
|
43
|
+
|
44
|
+
def test_execute_with_version_flag
|
45
|
+
spec_fetcher do |fetcher|
|
46
|
+
fetcher.spec "coolgem", "1.0"
|
47
|
+
fetcher.spec "coolgem", "2.0"
|
48
|
+
end
|
49
|
+
|
50
|
+
@cmd.handle_options %w[coolgem --remote --version 1.0]
|
51
|
+
|
52
|
+
use_ui @ui do
|
53
|
+
@cmd.execute
|
54
|
+
end
|
55
|
+
|
56
|
+
expected = <<-EOF
|
57
|
+
|
58
|
+
*** REMOTE GEMS ***
|
59
|
+
|
60
|
+
coolgem (1.0)
|
61
|
+
Author: A User
|
62
|
+
Homepage: http://example.com
|
63
|
+
|
64
|
+
this is a summary
|
65
|
+
EOF
|
66
|
+
|
67
|
+
assert_equal expected, @ui.output
|
68
|
+
end
|
43
69
|
end
|
@@ -35,7 +35,7 @@ class TestGemConfigFile < Gem::TestCase
|
|
35
35
|
def test_initialize
|
36
36
|
assert_equal @temp_conf, @cfg.config_file_name
|
37
37
|
|
38
|
-
assert_equal
|
38
|
+
assert_equal true, @cfg.backtrace
|
39
39
|
assert_equal true, @cfg.update_sources
|
40
40
|
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
|
41
41
|
assert_equal true, @cfg.verbose
|
@@ -239,6 +239,12 @@ if you believe they were disclosed to a third party.
|
|
239
239
|
end
|
240
240
|
|
241
241
|
def test_handle_arguments_backtrace
|
242
|
+
File.open @temp_conf, "w" do |fp|
|
243
|
+
fp.puts ":backtrace: false"
|
244
|
+
end
|
245
|
+
|
246
|
+
util_config_file %W[--config-file=#{@temp_conf}]
|
247
|
+
|
242
248
|
assert_equal false, @cfg.backtrace
|
243
249
|
|
244
250
|
args = %w[--backtrace]
|
@@ -275,6 +281,12 @@ if you believe they were disclosed to a third party.
|
|
275
281
|
end
|
276
282
|
|
277
283
|
def test_handle_arguments_traceback
|
284
|
+
File.open @temp_conf, "w" do |fp|
|
285
|
+
fp.puts ":backtrace: false"
|
286
|
+
end
|
287
|
+
|
288
|
+
util_config_file %W[--config-file=#{@temp_conf}]
|
289
|
+
|
278
290
|
assert_equal false, @cfg.backtrace
|
279
291
|
|
280
292
|
args = %w[--traceback]
|
@@ -288,7 +300,7 @@ if you believe they were disclosed to a third party.
|
|
288
300
|
assert_equal @temp_conf, @cfg.config_file_name
|
289
301
|
|
290
302
|
File.open @temp_conf, "w" do |fp|
|
291
|
-
fp.puts ":backtrace:
|
303
|
+
fp.puts ":backtrace: false"
|
292
304
|
fp.puts ":update_sources: false"
|
293
305
|
fp.puts ":bulk_threshold: 10"
|
294
306
|
fp.puts ":verbose: false"
|
@@ -300,7 +312,7 @@ if you believe they were disclosed to a third party.
|
|
300
312
|
|
301
313
|
util_config_file args
|
302
314
|
|
303
|
-
assert_equal
|
315
|
+
assert_equal true, @cfg.backtrace
|
304
316
|
assert_equal true, @cfg.update_sources
|
305
317
|
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
|
306
318
|
assert_equal true, @cfg.verbose
|
@@ -386,7 +398,7 @@ if you believe they were disclosed to a third party.
|
|
386
398
|
end
|
387
399
|
|
388
400
|
def test_write
|
389
|
-
@cfg.backtrace =
|
401
|
+
@cfg.backtrace = false
|
390
402
|
@cfg.update_sources = false
|
391
403
|
@cfg.bulk_threshold = 10
|
392
404
|
@cfg.verbose = false
|
@@ -398,7 +410,7 @@ if you believe they were disclosed to a third party.
|
|
398
410
|
util_config_file
|
399
411
|
|
400
412
|
# These should not be written out to the config file.
|
401
|
-
assert_equal
|
413
|
+
assert_equal true, @cfg.backtrace, "backtrace"
|
402
414
|
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold,
|
403
415
|
"bulk_threshold"
|
404
416
|
assert_equal true, @cfg.update_sources, "update_sources"
|
@@ -1051,8 +1051,8 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
1051
1051
|
|
1052
1052
|
releases = set.all_specs
|
1053
1053
|
|
1054
|
-
assert releases.any? {|s| s.name == "a"
|
1055
|
-
refute releases.any? {|s| s.name == "a"
|
1054
|
+
assert releases.any? {|s| s.name == "a" && s.version.to_s == "1" }
|
1055
|
+
refute releases.any? {|s| s.name == "a" && s.version.to_s == "1.a" }
|
1056
1056
|
|
1057
1057
|
dependency.prerelease = true
|
1058
1058
|
|
@@ -160,9 +160,9 @@ dependencies = [
|
|
160
160
|
|
161
161
|
[[package]]
|
162
162
|
name = "rb-sys"
|
163
|
-
version = "0.9.
|
163
|
+
version = "0.9.30"
|
164
164
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
165
|
-
checksum = "
|
165
|
+
checksum = "24b22a374fc2e92eb6f49d7efe4eb7663655c6e9455d9259ed3342cc1599da85"
|
166
166
|
dependencies = [
|
167
167
|
"bindgen",
|
168
168
|
"linkify",
|
@@ -171,9 +171,9 @@ dependencies = [
|
|
171
171
|
|
172
172
|
[[package]]
|
173
173
|
name = "rb-sys-build"
|
174
|
-
version = "0.9.
|
174
|
+
version = "0.9.30"
|
175
175
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
176
|
-
checksum = "
|
176
|
+
checksum = "3cd23b6dd929b7d50ccb35a6d3aa77dec364328ab9cb304dd32c629332491671"
|
177
177
|
dependencies = [
|
178
178
|
"regex",
|
179
179
|
"shell-words",
|
@@ -153,9 +153,9 @@ dependencies = [
|
|
153
153
|
|
154
154
|
[[package]]
|
155
155
|
name = "rb-sys"
|
156
|
-
version = "0.9.
|
156
|
+
version = "0.9.30"
|
157
157
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
158
|
-
checksum = "
|
158
|
+
checksum = "24b22a374fc2e92eb6f49d7efe4eb7663655c6e9455d9259ed3342cc1599da85"
|
159
159
|
dependencies = [
|
160
160
|
"bindgen",
|
161
161
|
"linkify",
|
@@ -164,9 +164,9 @@ dependencies = [
|
|
164
164
|
|
165
165
|
[[package]]
|
166
166
|
name = "rb-sys-build"
|
167
|
-
version = "0.9.
|
167
|
+
version = "0.9.30"
|
168
168
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
169
|
-
checksum = "
|
169
|
+
checksum = "3cd23b6dd929b7d50ccb35a6d3aa77dec364328ab9cb304dd32c629332491671"
|
170
170
|
dependencies = [
|
171
171
|
"regex",
|
172
172
|
"shell-words",
|
@@ -473,7 +473,7 @@ gem 'other', version
|
|
473
473
|
end
|
474
474
|
end
|
475
475
|
ensure
|
476
|
-
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG
|
476
|
+
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG || win_platform?)
|
477
477
|
end
|
478
478
|
|
479
479
|
def test_generate_bin_script_no_shebang
|
@@ -577,7 +577,7 @@ gem 'other', version
|
|
577
577
|
end
|
578
578
|
end
|
579
579
|
ensure
|
580
|
-
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG
|
580
|
+
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG || win_platform?)
|
581
581
|
end
|
582
582
|
|
583
583
|
def test_generate_bin_symlink_update_newer
|
@@ -756,7 +756,10 @@ gem 'other', version
|
|
756
756
|
end
|
757
757
|
end
|
758
758
|
|
759
|
-
|
759
|
+
errors = @ui.error.split("\n")
|
760
|
+
assert_equal "WARNING: ascii_binder-0.1.10.1 ships with a dangling symlink named bin/ascii_binder pointing to missing bin/asciibinder file. Ignoring", errors.shift
|
761
|
+
assert_empty errors
|
762
|
+
|
760
763
|
assert_empty @ui.output
|
761
764
|
end
|
762
765
|
|
@@ -529,6 +529,7 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|
529
529
|
|
530
530
|
def test_extract_tar_gz_symlink_relative_path
|
531
531
|
package = Gem::Package.new @gem
|
532
|
+
package.verify
|
532
533
|
|
533
534
|
tgz_io = util_tar_gz do |tar|
|
534
535
|
tar.add_file "relative.rb", 0644 do |io|
|
@@ -557,6 +558,27 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|
557
558
|
File.read(extracted)
|
558
559
|
end
|
559
560
|
|
561
|
+
def test_extract_tar_gz_symlink_broken_relative_path
|
562
|
+
package = Gem::Package.new @gem
|
563
|
+
package.verify
|
564
|
+
|
565
|
+
tgz_io = util_tar_gz do |tar|
|
566
|
+
tar.mkdir "lib", 0755
|
567
|
+
tar.add_symlink "lib/foo.rb", "../broken.rb", 0644
|
568
|
+
end
|
569
|
+
|
570
|
+
ui = Gem::MockGemUi.new
|
571
|
+
|
572
|
+
use_ui ui do
|
573
|
+
package.extract_tar_gz tgz_io, @destination
|
574
|
+
end
|
575
|
+
|
576
|
+
assert_equal "WARNING: a-2 ships with a dangling symlink named lib/foo.rb pointing to missing ../broken.rb file. Ignoring\n", ui.error
|
577
|
+
|
578
|
+
extracted = File.join @destination, "lib/foo.rb"
|
579
|
+
assert_path_not_exist extracted
|
580
|
+
end
|
581
|
+
|
560
582
|
def test_extract_symlink_parent
|
561
583
|
package = Gem::Package.new @gem
|
562
584
|
|
@@ -29,7 +29,7 @@ class TestGemPackageTarReader < Gem::Package::TarTestCase
|
|
29
29
|
|
30
30
|
str =
|
31
31
|
tar_file_header("lib/foo", "", 010644, content.size, Time.now) +
|
32
|
-
|
32
|
+
content + "\0" * (512 - content.size)
|
33
33
|
str << "\0" * 1024
|
34
34
|
|
35
35
|
io = TempIO.new(str)
|
@@ -119,8 +119,8 @@ class TestGemPlatform < Gem::TestCase
|
|
119
119
|
"i586-linux" => ["x86", "linux", nil],
|
120
120
|
"i486-linux" => ["x86", "linux", nil],
|
121
121
|
"i386-linux" => ["x86", "linux", nil],
|
122
|
-
"i586-linux-gnu" => ["x86", "linux",
|
123
|
-
"i386-linux-gnu" => ["x86", "linux",
|
122
|
+
"i586-linux-gnu" => ["x86", "linux", "gnu"],
|
123
|
+
"i386-linux-gnu" => ["x86", "linux", "gnu"],
|
124
124
|
"i386-mingw32" => ["x86", "mingw32", nil],
|
125
125
|
"x64-mingw-ucrt" => ["x64", "mingw", "ucrt"],
|
126
126
|
"i386-mswin32" => ["x86", "mswin32", nil],
|
@@ -135,7 +135,13 @@ class TestGemPlatform < Gem::TestCase
|
|
135
135
|
"i386-solaris2.8" => ["x86", "solaris", "2.8"],
|
136
136
|
"mswin32" => ["x86", "mswin32", nil],
|
137
137
|
"x86_64-linux" => ["x86_64", "linux", nil],
|
138
|
+
"x86_64-linux-gnu" => ["x86_64", "linux", "gnu"],
|
138
139
|
"x86_64-linux-musl" => ["x86_64", "linux", "musl"],
|
140
|
+
"x86_64-linux-uclibc" => ["x86_64", "linux", "uclibc"],
|
141
|
+
"arm-linux-eabi" => ["arm", "linux", "eabi"],
|
142
|
+
"arm-linux-gnueabi" => ["arm", "linux", "gnueabi"],
|
143
|
+
"arm-linux-musleabi" => ["arm", "linux", "musleabi"],
|
144
|
+
"arm-linux-uclibceabi" => ["arm", "linux", "uclibceabi"],
|
139
145
|
"x86_64-openbsd3.9" => ["x86_64", "openbsd", "3.9"],
|
140
146
|
"x86_64-openbsd4.0" => ["x86_64", "openbsd", "4.0"],
|
141
147
|
"x86_64-openbsd" => ["x86_64", "openbsd", nil],
|
@@ -144,6 +150,7 @@ class TestGemPlatform < Gem::TestCase
|
|
144
150
|
test_cases.each do |arch, expected|
|
145
151
|
platform = Gem::Platform.new arch
|
146
152
|
assert_equal expected, platform.to_a, arch.inspect
|
153
|
+
assert_equal expected, Gem::Platform.new(platform.to_s).to_a, arch.inspect
|
147
154
|
end
|
148
155
|
end
|
149
156
|
|
@@ -262,6 +269,70 @@ class TestGemPlatform < Gem::TestCase
|
|
262
269
|
assert((with_x86_arch === with_nil_arch), "x86 =~ nil")
|
263
270
|
end
|
264
271
|
|
272
|
+
def test_nil_version_is_treated_as_any_version
|
273
|
+
x86_darwin_8 = Gem::Platform.new "i686-darwin8.0"
|
274
|
+
x86_darwin_nil = Gem::Platform.new "i686-darwin"
|
275
|
+
|
276
|
+
assert((x86_darwin_8 === x86_darwin_nil), "8.0 =~ nil")
|
277
|
+
assert((x86_darwin_nil === x86_darwin_8), "nil =~ 8.0")
|
278
|
+
end
|
279
|
+
|
280
|
+
def test_nil_version_is_stricter_for_linux_os
|
281
|
+
x86_linux = Gem::Platform.new "i686-linux"
|
282
|
+
x86_linux_gnu = Gem::Platform.new "i686-linux-gnu"
|
283
|
+
x86_linux_musl = Gem::Platform.new "i686-linux-musl"
|
284
|
+
x86_linux_uclibc = Gem::Platform.new "i686-linux-uclibc"
|
285
|
+
|
286
|
+
# a naked linux runtime is implicit gnu, as it represents the common glibc-linked runtime
|
287
|
+
assert(x86_linux === x86_linux_gnu, "linux =~ linux-gnu")
|
288
|
+
assert(x86_linux_gnu === x86_linux, "linux-gnu =~ linux")
|
289
|
+
|
290
|
+
# musl and explicit gnu should differ
|
291
|
+
refute(x86_linux_gnu === x86_linux_musl, "linux-gnu =~ linux-musl")
|
292
|
+
refute(x86_linux_musl === x86_linux_gnu, "linux-musl =~ linux-gnu")
|
293
|
+
|
294
|
+
# explicit libc differ
|
295
|
+
refute(x86_linux_uclibc === x86_linux_musl, "linux-uclibc =~ linux-musl")
|
296
|
+
refute(x86_linux_musl === x86_linux_uclibc, "linux-musl =~ linux-uclibc")
|
297
|
+
|
298
|
+
# musl host runtime accepts libc-generic or statically linked gems...
|
299
|
+
assert(x86_linux === x86_linux_musl, "linux =~ linux-musl")
|
300
|
+
# ...but implicit gnu runtime generally does not accept musl-specific gems
|
301
|
+
refute(x86_linux_musl === x86_linux, "linux-musl =~ linux")
|
302
|
+
|
303
|
+
# other libc are not glibc compatible
|
304
|
+
refute(x86_linux === x86_linux_uclibc, "linux =~ linux-uclibc")
|
305
|
+
refute(x86_linux_uclibc === x86_linux, "linux-uclibc =~ linux")
|
306
|
+
end
|
307
|
+
|
308
|
+
def test_eabi_version_is_stricter_for_linux_os
|
309
|
+
arm_linux_eabi = Gem::Platform.new "arm-linux-eabi"
|
310
|
+
arm_linux_gnueabi = Gem::Platform.new "arm-linux-gnueabi"
|
311
|
+
arm_linux_musleabi = Gem::Platform.new "arm-linux-musleabi"
|
312
|
+
arm_linux_uclibceabi = Gem::Platform.new "arm-linux-uclibceabi"
|
313
|
+
|
314
|
+
# a naked linux runtime is implicit gnu, as it represents the common glibc-linked runtime
|
315
|
+
assert(arm_linux_eabi === arm_linux_gnueabi, "linux-eabi =~ linux-gnueabi")
|
316
|
+
assert(arm_linux_gnueabi === arm_linux_eabi, "linux-gnueabi =~ linux-eabi")
|
317
|
+
|
318
|
+
# musl and explicit gnu should differ
|
319
|
+
refute(arm_linux_gnueabi === arm_linux_musleabi, "linux-gnueabi =~ linux-musleabi")
|
320
|
+
refute(arm_linux_musleabi === arm_linux_gnueabi, "linux-musleabi =~ linux-gnueabi")
|
321
|
+
|
322
|
+
# explicit libc differ
|
323
|
+
refute(arm_linux_uclibceabi === arm_linux_musleabi, "linux-uclibceabi =~ linux-musleabi")
|
324
|
+
refute(arm_linux_musleabi === arm_linux_uclibceabi, "linux-musleabi =~ linux-uclibceabi")
|
325
|
+
|
326
|
+
# musl host runtime accepts libc-generic or statically linked gems...
|
327
|
+
assert(arm_linux_eabi === arm_linux_musleabi, "linux-eabi =~ linux-musleabi")
|
328
|
+
# ...but implicit gnu runtime generally does not accept musl-specific gems
|
329
|
+
refute(arm_linux_musleabi === arm_linux_eabi, "linux-musleabi =~ linux-eabi")
|
330
|
+
|
331
|
+
# other libc are not glibc compatible
|
332
|
+
refute(arm_linux_eabi === arm_linux_uclibceabi, "linux-eabi =~ linux-uclibceabi")
|
333
|
+
refute(arm_linux_uclibceabi === arm_linux_eabi, "linux-uclibceabi =~ linux-eabi")
|
334
|
+
end
|
335
|
+
|
265
336
|
def test_equals3_cpu_arm
|
266
337
|
arm = Gem::Platform.new "arm-linux"
|
267
338
|
armv5 = Gem::Platform.new "armv5-linux"
|
@@ -129,7 +129,9 @@ class TestGemRequirement < Gem::TestCase
|
|
129
129
|
assert_satisfied_by "1.3", r
|
130
130
|
|
131
131
|
assert_raise ArgumentError do
|
132
|
-
|
132
|
+
Gem::Deprecate.skip_during do
|
133
|
+
assert_satisfied_by nil, r
|
134
|
+
end
|
133
135
|
end
|
134
136
|
end
|
135
137
|
|
@@ -141,7 +143,9 @@ class TestGemRequirement < Gem::TestCase
|
|
141
143
|
refute_satisfied_by "1.3", r
|
142
144
|
|
143
145
|
assert_raise ArgumentError do
|
144
|
-
|
146
|
+
Gem::Deprecate.skip_during do
|
147
|
+
assert_satisfied_by nil, r
|
148
|
+
end
|
145
149
|
end
|
146
150
|
end
|
147
151
|
|
@@ -153,7 +157,9 @@ class TestGemRequirement < Gem::TestCase
|
|
153
157
|
refute_satisfied_by "1.3", r
|
154
158
|
|
155
159
|
assert_raise ArgumentError do
|
156
|
-
|
160
|
+
Gem::Deprecate.skip_during do
|
161
|
+
assert_satisfied_by nil, r
|
162
|
+
end
|
157
163
|
end
|
158
164
|
end
|
159
165
|
|
@@ -322,16 +322,15 @@ class TestGemResolver < Gem::TestCase
|
|
322
322
|
def test_picks_best_platform
|
323
323
|
is = Gem::Resolver::IndexSpecification
|
324
324
|
unknown = Gem::Platform.new "unknown"
|
325
|
-
a2_p1 = a3_p2 = nil
|
326
325
|
|
327
326
|
spec_fetcher do |fetcher|
|
328
327
|
fetcher.spec "a", 2
|
329
328
|
|
330
|
-
|
329
|
+
fetcher.spec "a", 2 do |s|
|
331
330
|
s.platform = Gem::Platform.local
|
332
331
|
end
|
333
332
|
|
334
|
-
|
333
|
+
fetcher.spec "a", 3 do |s|
|
335
334
|
s.platform = unknown
|
336
335
|
end
|
337
336
|
end
|
@@ -357,6 +356,41 @@ class TestGemResolver < Gem::TestCase
|
|
357
356
|
assert_resolves_to [a2_p1.spec], res
|
358
357
|
end
|
359
358
|
|
359
|
+
def test_does_not_pick_musl_variants_on_non_musl_linux
|
360
|
+
util_set_arch "aarch64-linux" do
|
361
|
+
is = Gem::Resolver::IndexSpecification
|
362
|
+
|
363
|
+
linux_musl = Gem::Platform.new("aarch64-linux-musl")
|
364
|
+
|
365
|
+
spec_fetcher do |fetcher|
|
366
|
+
fetcher.spec "libv8-node", "15.14.0.1" do |s|
|
367
|
+
s.platform = Gem::Platform.local
|
368
|
+
end
|
369
|
+
|
370
|
+
fetcher.spec "libv8-node", "15.14.0.1" do |s|
|
371
|
+
s.platform = linux_musl
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
v15 = v("15.14.0.1")
|
376
|
+
source = Gem::Source.new @gem_repo
|
377
|
+
|
378
|
+
s = set
|
379
|
+
|
380
|
+
v15_linux = is.new s, "libv8-node", v15, source, Gem::Platform.local.to_s
|
381
|
+
v15_linux_musl = is.new s, "libv8-node", v15, source, linux_musl.to_s
|
382
|
+
|
383
|
+
s.add v15_linux
|
384
|
+
s.add v15_linux_musl
|
385
|
+
|
386
|
+
ad = make_dep "libv8-node", "= 15.14.0.1"
|
387
|
+
|
388
|
+
res = Gem::Resolver.new([ad], s)
|
389
|
+
|
390
|
+
assert_resolves_to [v15_linux.spec], res
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
360
394
|
def test_only_returns_spec_once
|
361
395
|
a1 = util_spec "a", "1", "c" => "= 1"
|
362
396
|
b1 = util_spec "b", "1", "c" => "= 1"
|
@@ -26,7 +26,7 @@ class TestGemResolverIndexSpecification < Gem::TestCase
|
|
26
26
|
spec = Gem::Resolver::IndexSpecification.new(
|
27
27
|
set, "rails", version, source, Gem::Platform.local)
|
28
28
|
|
29
|
-
assert_equal Gem::Platform.local
|
29
|
+
assert_equal Gem::Platform.local, spec.platform
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_install
|
@@ -51,6 +51,38 @@ class TestGemResolverInstallerSet < Gem::TestCase
|
|
51
51
|
assert_equal %w[a-1], set.always_install.map {|s| s.full_name }
|
52
52
|
end
|
53
53
|
|
54
|
+
def test_add_always_install_platform_if_gem_platforms_modified_by_platform_flag
|
55
|
+
freebsd = Gem::Platform.new "x86-freebsd-9"
|
56
|
+
|
57
|
+
spec_fetcher do |fetcher|
|
58
|
+
fetcher.download "a", 1
|
59
|
+
fetcher.download "a", 1 do |s|
|
60
|
+
s.platform = freebsd
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# equivalent to --platform=x86-freebsd-9
|
65
|
+
Gem.platforms << freebsd
|
66
|
+
set = Gem::Resolver::InstallerSet.new :both
|
67
|
+
|
68
|
+
set.add_always_install dep("a")
|
69
|
+
|
70
|
+
assert_equal %w[a-1-x86-freebsd-9], set.always_install.map {|s| s.full_name }
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_add_always_install_index_spec_platform
|
74
|
+
_, a_1_local_gem = util_gem "a", 1 do |s|
|
75
|
+
s.platform = Gem::Platform.local
|
76
|
+
end
|
77
|
+
|
78
|
+
FileUtils.mv a_1_local_gem, @tempdir
|
79
|
+
|
80
|
+
set = Gem::Resolver::InstallerSet.new :both
|
81
|
+
set.add_always_install dep("a")
|
82
|
+
|
83
|
+
assert_equal [Gem::Platform.local], set.always_install.map {|s| s.platform }
|
84
|
+
end
|
85
|
+
|
54
86
|
def test_add_always_install_prerelease
|
55
87
|
spec_fetcher do |fetcher|
|
56
88
|
fetcher.gem "a", 1
|
@@ -187,6 +219,18 @@ class TestGemResolverInstallerSet < Gem::TestCase
|
|
187
219
|
set.find_all(req).map {|spec| spec.full_name }.sort
|
188
220
|
end
|
189
221
|
|
222
|
+
def test_find_all_prerelease_dependencies_with_add_local
|
223
|
+
activesupport_7_1_0_alpha = util_spec "activesupport", "7.1.0.alpha"
|
224
|
+
|
225
|
+
install_gem activesupport_7_1_0_alpha
|
226
|
+
|
227
|
+
set = Gem::Resolver::InstallerSet.new :both
|
228
|
+
|
229
|
+
req = Gem::Resolver::DependencyRequest.new dep("activesupport", ">= 4.2.0"), nil
|
230
|
+
|
231
|
+
assert_equal %w[activesupport-7.1.0.alpha], set.find_all(req).map {|spec| spec.full_name }
|
232
|
+
end
|
233
|
+
|
190
234
|
def test_load_spec
|
191
235
|
specs = spec_fetcher do |fetcher|
|
192
236
|
fetcher.spec "a", 2
|