rubygems-update 3.4.20 → 3.4.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 +55 -0
- data/Manifest.txt +6 -0
- data/bundler/CHANGELOG.md +55 -3
- data/bundler/README.md +1 -2
- data/bundler/lib/bundler/build_metadata.rb +3 -3
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +4 -3
- data/bundler/lib/bundler/cli/install.rb +2 -2
- data/bundler/lib/bundler/cli/lock.rb +26 -23
- data/bundler/lib/bundler/cli/open.rb +5 -7
- data/bundler/lib/bundler/definition.rb +43 -26
- data/bundler/lib/bundler/endpoint_specification.rb +1 -1
- data/bundler/lib/bundler/env.rb +2 -2
- data/bundler/lib/bundler/errors.rb +15 -0
- data/bundler/lib/bundler/gem_helpers.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
- data/bundler/lib/bundler/injector.rb +1 -1
- data/bundler/lib/bundler/installer/gem_installer.rb +5 -5
- data/bundler/lib/bundler/installer/parallel_installer.rb +0 -26
- data/bundler/lib/bundler/installer/standalone.rb +13 -6
- data/bundler/lib/bundler/lazy_specification.rb +4 -0
- data/bundler/lib/bundler/lockfile_parser.rb +29 -24
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- 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 +1 -1
- data/bundler/lib/bundler/man/bundle-console.1 +1 -1
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +2 -3
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- 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 +1 -1
- 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 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +17 -17
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +5 -5
- 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 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin/index.rb +8 -0
- data/bundler/lib/bundler/plugin.rb +9 -2
- data/bundler/lib/bundler/resolver/package.rb +5 -0
- data/bundler/lib/bundler/resolver.rb +27 -7
- data/bundler/lib/bundler/ruby_version.rb +8 -1
- data/bundler/lib/bundler/rubygems_ext.rb +3 -4
- data/bundler/lib/bundler/rubygems_gem_installer.rb +23 -8
- data/bundler/lib/bundler/settings.rb +53 -16
- data/bundler/lib/bundler/shared_helpers.rb +16 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +21 -4
- data/bundler/lib/bundler/source/metadata.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +7 -4
- data/bundler/lib/bundler/stub_specification.rb +4 -2
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +6 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/ui/shell.rb +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +1 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +21 -9
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +8 -10
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +15 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +15 -15
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +16 -25
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +44 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +26 -150
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +4 -46
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -45
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +155 -8
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +12 -8
- data/bundler/lib/bundler.rb +0 -8
- data/lib/rubygems/basic_specification.rb +1 -1
- data/lib/rubygems/command.rb +5 -5
- data/lib/rubygems/command_manager.rb +1 -1
- data/lib/rubygems/commands/cert_command.rb +3 -3
- data/lib/rubygems/commands/check_command.rb +5 -1
- data/lib/rubygems/commands/cleanup_command.rb +1 -1
- data/lib/rubygems/commands/contents_command.rb +2 -2
- data/lib/rubygems/commands/environment_command.rb +2 -2
- data/lib/rubygems/commands/help_command.rb +3 -3
- data/lib/rubygems/commands/open_command.rb +1 -3
- data/lib/rubygems/commands/owner_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +10 -10
- data/lib/rubygems/commands/specification_command.rb +5 -1
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +4 -4
- data/lib/rubygems/commands/unpack_command.rb +3 -3
- data/lib/rubygems/commands/update_command.rb +4 -4
- data/lib/rubygems/commands/yank_command.rb +1 -1
- data/lib/rubygems/config_file.rb +63 -16
- data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
- data/lib/rubygems/core_ext/kernel_require.rb +2 -2
- data/lib/rubygems/defaults.rb +6 -2
- data/lib/rubygems/dependency_installer.rb +4 -4
- data/lib/rubygems/deprecate.rb +2 -1
- data/lib/rubygems/doctor.rb +2 -2
- data/lib/rubygems/errors.rb +1 -1
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/ext/builder.rb +5 -4
- data/lib/rubygems/ext/cargo_builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +1 -1
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/gem_runner.rb +5 -1
- data/lib/rubygems/gemcutter_utilities.rb +2 -2
- data/lib/rubygems/indexer.rb +1 -1
- data/lib/rubygems/install_update_options.rb +1 -1
- data/lib/rubygems/installer.rb +15 -20
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/package/digest_io.rb +1 -1
- data/lib/rubygems/package/old.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +2 -2
- data/lib/rubygems/package/tar_reader.rb +9 -2
- data/lib/rubygems/package/tar_writer.rb +2 -2
- data/lib/rubygems/package.rb +9 -9
- data/lib/rubygems/path_support.rb +1 -1
- data/lib/rubygems/platform.rb +12 -6
- data/lib/rubygems/query_utils.rb +4 -4
- data/lib/rubygems/remote_fetcher.rb +12 -4
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set.rb +2 -1
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/api_set.rb +2 -1
- data/lib/rubygems/resolver/api_specification.rb +1 -1
- data/lib/rubygems/resolver.rb +3 -3
- data/lib/rubygems/security/signer.rb +10 -2
- data/lib/rubygems/security/trust_dir.rb +5 -5
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/security_option.rb +1 -1
- data/lib/rubygems/source/local.rb +2 -1
- data/lib/rubygems/source.rb +5 -1
- data/lib/rubygems/source_list.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +2 -2
- data/lib/rubygems/specification.rb +30 -23
- data/lib/rubygems/specification_policy.rb +11 -11
- data/lib/rubygems/uninstaller.rb +3 -3
- data/lib/rubygems/update_suggestion.rb +1 -1
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/util/licenses.rb +48 -0
- data/lib/rubygems/util.rb +5 -1
- data/lib/rubygems/validator.rb +1 -1
- data/lib/rubygems/version.rb +6 -5
- data/lib/rubygems/yaml_serializer.rb +93 -0
- data/lib/rubygems.rb +9 -9
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +2 -0
- data/test/rubygems/bundler_test_gem.rb +6 -3
- data/test/rubygems/helper.rb +29 -21
- data/test/rubygems/package/tar_test_case.rb +2 -2
- data/test/rubygems/test_gem.rb +51 -26
- data/test/rubygems/test_gem_command.rb +3 -1
- data/test/rubygems/test_gem_command_manager.rb +6 -6
- data/test/rubygems/test_gem_commands_cert_command.rb +23 -23
- data/test/rubygems/test_gem_commands_cleanup_command.rb +2 -2
- data/test/rubygems/test_gem_commands_environment_command.rb +2 -1
- data/test/rubygems/test_gem_commands_exec_command.rb +5 -1
- data/test/rubygems/test_gem_commands_install_command.rb +5 -5
- data/test/rubygems/test_gem_commands_open_command.rb +5 -2
- data/test/rubygems/test_gem_commands_pristine_command.rb +2 -2
- data/test/rubygems/test_gem_commands_push_command.rb +7 -6
- data/test/rubygems/test_gem_commands_signin_command.rb +8 -8
- data/test/rubygems/test_gem_commands_uninstall_command.rb +21 -1
- data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
- data/test/rubygems/test_gem_config_file.rb +46 -12
- data/test/rubygems/test_gem_ext_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder.rb +2 -2
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -5
- data/test/rubygems/test_gem_install_update_options.rb +3 -3
- data/test/rubygems/test_gem_installer.rb +16 -16
- data/test/rubygems/test_gem_package.rb +35 -34
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +3 -3
- data/test/rubygems/test_gem_package_tar_reader.rb +19 -4
- data/test/rubygems/test_gem_package_tar_writer.rb +28 -28
- data/test/rubygems/test_gem_rdoc.rb +2 -2
- data/test/rubygems/test_gem_remote_fetcher.rb +13 -9
- data/test/rubygems/test_gem_request.rb +5 -5
- data/test/rubygems/test_gem_request_connection_pools.rb +2 -1
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +14 -7
- data/test/rubygems/test_gem_security.rb +2 -2
- data/test/rubygems/test_gem_security_policy.rb +2 -2
- data/test/rubygems/test_gem_security_signer.rb +2 -2
- data/test/rubygems/test_gem_security_trust_dir.rb +6 -6
- data/test/rubygems/test_gem_spec_fetcher.rb +2 -2
- data/test/rubygems/test_gem_specification.rb +29 -29
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_update_suggestion.rb +12 -6
- data/test/rubygems/test_gem_util.rb +2 -2
- data/test/rubygems/test_gem_version.rb +4 -2
- data/test/rubygems/utilities.rb +4 -3
- metadata +9 -3
data/test/rubygems/helper.rb
CHANGED
@@ -120,9 +120,11 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
120
120
|
_synchronize do
|
121
121
|
require "tempfile"
|
122
122
|
|
123
|
-
captured_stdout
|
123
|
+
captured_stdout = Tempfile.new("out")
|
124
|
+
captured_stderr = Tempfile.new("err")
|
124
125
|
|
125
|
-
orig_stdout
|
126
|
+
orig_stdout = $stdout.dup
|
127
|
+
orig_stderr = $stderr.dup
|
126
128
|
$stdout.reopen captured_stdout
|
127
129
|
$stderr.reopen captured_stderr
|
128
130
|
|
@@ -335,14 +337,18 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
335
337
|
ruby
|
336
338
|
end
|
337
339
|
|
338
|
-
@git = ENV["GIT"] || "git#{RbConfig::CONFIG[
|
340
|
+
@git = ENV["GIT"] || "git#{RbConfig::CONFIG["EXEEXT"]}"
|
339
341
|
|
340
342
|
Gem.ensure_gem_subdirectories @gemhome
|
341
343
|
Gem.ensure_default_gem_subdirectories @gemhome
|
342
344
|
|
343
345
|
@orig_LOAD_PATH = $LOAD_PATH.dup
|
344
346
|
$LOAD_PATH.map! do |s|
|
345
|
-
expand_path =
|
347
|
+
expand_path = begin
|
348
|
+
File.realpath(s)
|
349
|
+
rescue StandardError
|
350
|
+
File.expand_path(s)
|
351
|
+
end
|
346
352
|
if expand_path != s
|
347
353
|
expand_path.tap(&Gem::UNTAINT)
|
348
354
|
if s.instance_variable_defined?(:@gem_prelude_index)
|
@@ -484,7 +490,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
484
490
|
@temp_cred = File.join(@userhome, ".gem", "credentials")
|
485
491
|
FileUtils.mkdir_p File.dirname(@temp_cred)
|
486
492
|
File.write @temp_cred, ":rubygems_api_key: 701229f217cdf23b1344c7b4b54ca97"
|
487
|
-
File.chmod
|
493
|
+
File.chmod 0o600, @temp_cred
|
488
494
|
end
|
489
495
|
|
490
496
|
def credential_teardown
|
@@ -570,7 +576,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
570
576
|
head = Gem::Util.popen(@git, "rev-parse", "HEAD").strip
|
571
577
|
end
|
572
578
|
|
573
|
-
|
579
|
+
[name, git_spec.version, directory, head]
|
574
580
|
end
|
575
581
|
|
576
582
|
##
|
@@ -686,11 +692,8 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
686
692
|
# Load a YAML file, the psych 3 way
|
687
693
|
|
688
694
|
def load_yaml_file(file)
|
689
|
-
|
690
|
-
|
691
|
-
else
|
692
|
-
Psych.load_file(file)
|
693
|
-
end
|
695
|
+
require "rubygems/config_file"
|
696
|
+
Gem::ConfigFile.load_with_rubygems_config_hash(File.read(file))
|
694
697
|
end
|
695
698
|
|
696
699
|
def all_spec_names
|
@@ -731,7 +734,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
731
734
|
|
732
735
|
Gem::Specification.reset
|
733
736
|
|
734
|
-
|
737
|
+
spec
|
735
738
|
end
|
736
739
|
|
737
740
|
##
|
@@ -866,7 +869,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
866
869
|
FileUtils.rm spec.spec_file
|
867
870
|
end
|
868
871
|
|
869
|
-
|
872
|
+
spec
|
870
873
|
end
|
871
874
|
|
872
875
|
##
|
@@ -1044,7 +1047,7 @@ Also, a list:
|
|
1044
1047
|
spec_fetcher.prerelease_specs[@uri] << spec.name_tuple
|
1045
1048
|
end
|
1046
1049
|
|
1047
|
-
# HACK for test_download_to_cache
|
1050
|
+
# HACK: for test_download_to_cache
|
1048
1051
|
unless Gem::RemoteFetcher === @fetcher
|
1049
1052
|
v = Gem.marshal_version
|
1050
1053
|
|
@@ -1274,7 +1277,7 @@ Also, a list:
|
|
1274
1277
|
ruby = ENV["RUBY"]
|
1275
1278
|
return ruby if ruby
|
1276
1279
|
ruby = "ruby"
|
1277
|
-
rubyexe = "#{ruby}#{RbConfig::CONFIG[
|
1280
|
+
rubyexe = "#{ruby}#{RbConfig::CONFIG["EXEEXT"]}"
|
1278
1281
|
|
1279
1282
|
3.times do
|
1280
1283
|
if File.exist?(ruby) && File.executable?(ruby) && !File.directory?(ruby)
|
@@ -1325,7 +1328,8 @@ Also, a list:
|
|
1325
1328
|
end
|
1326
1329
|
|
1327
1330
|
def silence_warnings
|
1328
|
-
old_verbose
|
1331
|
+
old_verbose = $VERBOSE
|
1332
|
+
$VERBOSE = false
|
1329
1333
|
yield
|
1330
1334
|
ensure
|
1331
1335
|
$VERBOSE = old_verbose
|
@@ -1341,7 +1345,7 @@ Also, a list:
|
|
1341
1345
|
|
1342
1346
|
def escape_path(*path)
|
1343
1347
|
path = File.join(*path)
|
1344
|
-
if %r{\A[-+:/=@,.\w]+\z}
|
1348
|
+
if %r{\A[-+:/=@,.\w]+\z}.match?(path)
|
1345
1349
|
path
|
1346
1350
|
else
|
1347
1351
|
"\"#{path.gsub(/[`$"]/, '\\&')}\""
|
@@ -1349,8 +1353,8 @@ Also, a list:
|
|
1349
1353
|
end
|
1350
1354
|
end
|
1351
1355
|
|
1352
|
-
@@good_rake = "#{rubybin} #{escape_path(__dir__,
|
1353
|
-
@@bad_rake = "#{rubybin} #{escape_path(__dir__,
|
1356
|
+
@@good_rake = "#{rubybin} #{escape_path(__dir__, "good_rake.rb")}"
|
1357
|
+
@@bad_rake = "#{rubybin} #{escape_path(__dir__, "bad_rake.rb")}"
|
1354
1358
|
|
1355
1359
|
##
|
1356
1360
|
# Construct a new Gem::Dependency.
|
@@ -1456,7 +1460,7 @@ Also, a list:
|
|
1456
1460
|
io.write vendor_spec.to_ruby
|
1457
1461
|
end
|
1458
1462
|
|
1459
|
-
|
1463
|
+
[name, vendor_spec.version, directory]
|
1460
1464
|
end
|
1461
1465
|
|
1462
1466
|
##
|
@@ -1536,7 +1540,11 @@ Also, a list:
|
|
1536
1540
|
# <tt>test/rubygems/</tt>.
|
1537
1541
|
|
1538
1542
|
def self.cert_path(cert_name)
|
1539
|
-
if 32 ==
|
1543
|
+
if 32 == begin
|
1544
|
+
Time.at(2**32)
|
1545
|
+
rescue StandardError
|
1546
|
+
32
|
1547
|
+
end
|
1540
1548
|
cert_file = "#{__dir__}/#{cert_name}_cert_32.pem"
|
1541
1549
|
|
1542
1550
|
return cert_file if File.exist? cert_file
|
@@ -163,11 +163,11 @@ class Gem::Package::TarTestCase < Gem::TestCase
|
|
163
163
|
data_tgz = util_tar_gz(&block)
|
164
164
|
util_tar do |tar|
|
165
165
|
if spec
|
166
|
-
tar.add_file "metadata.gz",
|
166
|
+
tar.add_file "metadata.gz", 0o444 do |io|
|
167
167
|
io.write util_gzip(spec.to_yaml)
|
168
168
|
end
|
169
169
|
end
|
170
|
-
tar.add_file "data.tar.gz",
|
170
|
+
tar.add_file "data.tar.gz", 0o644 do |io|
|
171
171
|
io.write data_tgz.string
|
172
172
|
end
|
173
173
|
end
|
data/test/rubygems/test_gem.rb
CHANGED
@@ -132,7 +132,7 @@ class TestGem < Gem::TestCase
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def test_self_install_permissions_umask_077
|
135
|
-
umask = File.umask(
|
135
|
+
umask = File.umask(0o77)
|
136
136
|
assert_self_install_permissions
|
137
137
|
ensure
|
138
138
|
File.umask(umask)
|
@@ -152,11 +152,11 @@ class TestGem < Gem::TestCase
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def assert_self_install_permissions(format_executable: false)
|
155
|
-
mask = win_platform? ?
|
155
|
+
mask = win_platform? ? 0o700 : 0o777
|
156
156
|
options = {
|
157
|
-
:dir_mode =>
|
158
|
-
:prog_mode => win_platform? ?
|
159
|
-
:data_mode =>
|
157
|
+
:dir_mode => 0o500,
|
158
|
+
:prog_mode => win_platform? ? 0o410 : 0o510,
|
159
|
+
:data_mode => 0o640,
|
160
160
|
:wrappers => true,
|
161
161
|
:format_executable => format_executable,
|
162
162
|
}
|
@@ -165,7 +165,7 @@ class TestGem < Gem::TestCase
|
|
165
165
|
Dir.mkdir "data"
|
166
166
|
|
167
167
|
File.write "bin/foo", "#!/usr/bin/env ruby\n"
|
168
|
-
File.chmod
|
168
|
+
File.chmod 0o755, "bin/foo"
|
169
169
|
|
170
170
|
File.write "data/foo.txt", "blah\n"
|
171
171
|
|
@@ -201,7 +201,7 @@ class TestGem < Gem::TestCase
|
|
201
201
|
end
|
202
202
|
assert_equal(expected, result)
|
203
203
|
ensure
|
204
|
-
File.chmod(
|
204
|
+
File.chmod(0o755, *Dir.glob(@gemhome + "/gems/**/").map {|path| path.tap(&Gem::UNTAINT) })
|
205
205
|
end
|
206
206
|
|
207
207
|
def test_require_missing
|
@@ -639,12 +639,12 @@ class TestGem < Gem::TestCase
|
|
639
639
|
FileUtils.rm_r @gemhome
|
640
640
|
Gem.use_paths @gemhome
|
641
641
|
|
642
|
-
Gem.ensure_gem_subdirectories @gemhome,
|
642
|
+
Gem.ensure_gem_subdirectories @gemhome, 0o750
|
643
643
|
|
644
644
|
assert_directory_exists File.join(@gemhome, "cache")
|
645
645
|
|
646
|
-
assert_equal
|
647
|
-
assert_equal
|
646
|
+
assert_equal 0o750, File::Stat.new(@gemhome).mode & 0o777
|
647
|
+
assert_equal 0o750, File::Stat.new(File.join(@gemhome, "cache")).mode & 0o777
|
648
648
|
end unless win_platform?
|
649
649
|
|
650
650
|
def test_self_ensure_gem_directories_safe_permissions
|
@@ -655,17 +655,21 @@ class TestGem < Gem::TestCase
|
|
655
655
|
File.umask 0
|
656
656
|
Gem.ensure_gem_subdirectories @gemhome
|
657
657
|
|
658
|
-
assert_equal 0, File::Stat.new(@gemhome).mode &
|
659
|
-
assert_equal 0, File::Stat.new(File.join(@gemhome, "cache")).mode &
|
658
|
+
assert_equal 0, File::Stat.new(@gemhome).mode & 0o02
|
659
|
+
assert_equal 0, File::Stat.new(File.join(@gemhome, "cache")).mode & 0o02
|
660
660
|
ensure
|
661
661
|
File.umask old_umask
|
662
662
|
end unless win_platform?
|
663
663
|
|
664
664
|
def test_self_ensure_gem_directories_missing_parents
|
665
665
|
gemdir = File.join @tempdir, "a/b/c/gemdir"
|
666
|
-
|
666
|
+
begin
|
667
|
+
FileUtils.rm_rf File.join(@tempdir, "a")
|
668
|
+
rescue StandardError
|
669
|
+
nil
|
670
|
+
end
|
667
671
|
refute File.exist?(File.join(@tempdir, "a")),
|
668
|
-
"manually remove #{File.join @tempdir,
|
672
|
+
"manually remove #{File.join @tempdir, "a"}, tests are broken"
|
669
673
|
Gem.use_paths gemdir
|
670
674
|
|
671
675
|
Gem.ensure_gem_subdirectories gemdir
|
@@ -676,34 +680,42 @@ class TestGem < Gem::TestCase
|
|
676
680
|
unless win_platform? || Process.uid.zero? # only for FS that support write protection
|
677
681
|
def test_self_ensure_gem_directories_write_protected
|
678
682
|
gemdir = File.join @tempdir, "egd"
|
679
|
-
|
683
|
+
begin
|
684
|
+
FileUtils.rm_r gemdir
|
685
|
+
rescue StandardError
|
686
|
+
nil
|
687
|
+
end
|
680
688
|
refute File.exist?(gemdir), "manually remove #{gemdir}, tests are broken"
|
681
689
|
FileUtils.mkdir_p gemdir
|
682
|
-
FileUtils.chmod
|
690
|
+
FileUtils.chmod 0o400, gemdir
|
683
691
|
Gem.use_paths gemdir
|
684
692
|
|
685
693
|
Gem.ensure_gem_subdirectories gemdir
|
686
694
|
|
687
695
|
refute File.exist?(util_cache_dir)
|
688
696
|
ensure
|
689
|
-
FileUtils.chmod
|
697
|
+
FileUtils.chmod 0o600, gemdir
|
690
698
|
end
|
691
699
|
|
692
700
|
def test_self_ensure_gem_directories_write_protected_parents
|
693
701
|
parent = File.join(@tempdir, "egd")
|
694
702
|
gemdir = "#{parent}/a/b/c"
|
695
703
|
|
696
|
-
|
704
|
+
begin
|
705
|
+
FileUtils.rm_r parent
|
706
|
+
rescue StandardError
|
707
|
+
nil
|
708
|
+
end
|
697
709
|
refute File.exist?(parent), "manually remove #{parent}, tests are broken"
|
698
710
|
FileUtils.mkdir_p parent
|
699
|
-
FileUtils.chmod
|
711
|
+
FileUtils.chmod 0o400, parent
|
700
712
|
Gem.use_paths(gemdir)
|
701
713
|
|
702
714
|
Gem.ensure_gem_subdirectories gemdir
|
703
715
|
|
704
716
|
refute File.exist? File.join(gemdir, "gems")
|
705
717
|
ensure
|
706
|
-
FileUtils.chmod
|
718
|
+
FileUtils.chmod 0o600, parent
|
707
719
|
end
|
708
720
|
|
709
721
|
def test_self_ensure_gem_directories_non_existent_paths
|
@@ -965,11 +977,11 @@ class TestGem < Gem::TestCase
|
|
965
977
|
pend "chmod not supported" if Gem.win_platform?
|
966
978
|
|
967
979
|
begin
|
968
|
-
File.chmod
|
980
|
+
File.chmod 0o444, "test"
|
969
981
|
|
970
982
|
assert_equal ["\xCF", "\x80"], Gem.read_binary("test").chars.to_a
|
971
983
|
ensure
|
972
|
-
File.chmod
|
984
|
+
File.chmod 0o644, "test"
|
973
985
|
end
|
974
986
|
end
|
975
987
|
|
@@ -1030,7 +1042,8 @@ class TestGem < Gem::TestCase
|
|
1030
1042
|
end
|
1031
1043
|
|
1032
1044
|
def test_self_ruby_api_version
|
1033
|
-
orig_ruby_version
|
1045
|
+
orig_ruby_version = RbConfig::CONFIG["ruby_version"]
|
1046
|
+
RbConfig::CONFIG["ruby_version"] = "1.2.3"
|
1034
1047
|
|
1035
1048
|
Gem.instance_variable_set :@ruby_api_version, nil
|
1036
1049
|
|
@@ -1503,19 +1516,31 @@ class TestGem < Gem::TestCase
|
|
1503
1516
|
|
1504
1517
|
def test_load_env_plugins
|
1505
1518
|
with_plugin("load") { Gem.load_env_plugins }
|
1506
|
-
|
1519
|
+
begin
|
1520
|
+
assert_equal :loaded, TEST_PLUGIN_LOAD
|
1521
|
+
rescue StandardError
|
1522
|
+
nil
|
1523
|
+
end
|
1507
1524
|
|
1508
1525
|
util_remove_interrupt_command
|
1509
1526
|
|
1510
1527
|
# Should attempt to cause a StandardError
|
1511
1528
|
with_plugin("standarderror") { Gem.load_env_plugins }
|
1512
|
-
|
1529
|
+
begin
|
1530
|
+
assert_equal :loaded, TEST_PLUGIN_STANDARDERROR
|
1531
|
+
rescue StandardError
|
1532
|
+
nil
|
1533
|
+
end
|
1513
1534
|
|
1514
1535
|
util_remove_interrupt_command
|
1515
1536
|
|
1516
1537
|
# Should attempt to cause an Exception
|
1517
1538
|
with_plugin("exception") { Gem.load_env_plugins }
|
1518
|
-
|
1539
|
+
begin
|
1540
|
+
assert_equal :loaded, TEST_PLUGIN_EXCEPTION
|
1541
|
+
rescue StandardError
|
1542
|
+
nil
|
1543
|
+
end
|
1519
1544
|
end
|
1520
1545
|
|
1521
1546
|
def test_gem_path_ordering
|
@@ -56,7 +56,9 @@ class TestGemCommand < Gem::TestCase
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_self_extra_args
|
59
|
-
verbose
|
59
|
+
verbose = $VERBOSE
|
60
|
+
$VERBOSE = nil
|
61
|
+
separator = $;
|
60
62
|
extra_args = Gem::Command.extra_args
|
61
63
|
|
62
64
|
Gem::Command.extra_args = %w[--all]
|
@@ -177,7 +177,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
177
177
|
assert_match(/invalid option: --bad-arg/i, @ui.error)
|
178
178
|
end
|
179
179
|
|
180
|
-
# HACK move to install command test
|
180
|
+
# HACK: move to install command test
|
181
181
|
def test_process_args_install
|
182
182
|
#capture all install options
|
183
183
|
use_ui @ui do
|
@@ -228,7 +228,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
228
228
|
end
|
229
229
|
end
|
230
230
|
|
231
|
-
# HACK move to uninstall command test
|
231
|
+
# HACK: move to uninstall command test
|
232
232
|
def test_process_args_uninstall
|
233
233
|
#capture all uninstall options
|
234
234
|
check_options = nil
|
@@ -248,7 +248,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
248
248
|
assert_equal Gem::Requirement.new("3.0"), check_options[:version]
|
249
249
|
end
|
250
250
|
|
251
|
-
# HACK move to check command test
|
251
|
+
# HACK: move to check command test
|
252
252
|
def test_process_args_check
|
253
253
|
#capture all check options
|
254
254
|
check_options = nil
|
@@ -267,7 +267,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
267
267
|
assert_equal true, check_options[:alien]
|
268
268
|
end
|
269
269
|
|
270
|
-
# HACK move to build command test
|
270
|
+
# HACK: move to build command test
|
271
271
|
def test_process_args_build
|
272
272
|
#capture all build options
|
273
273
|
check_options = nil
|
@@ -286,7 +286,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
286
286
|
assert_equal "foobar.rb", check_options[:args].first
|
287
287
|
end
|
288
288
|
|
289
|
-
# HACK move to query command test
|
289
|
+
# HACK: move to query command test
|
290
290
|
def test_process_args_query
|
291
291
|
#capture all query options
|
292
292
|
check_options = nil
|
@@ -327,7 +327,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
327
327
|
assert_equal :both, check_options[:domain]
|
328
328
|
end
|
329
329
|
|
330
|
-
# HACK move to update command test
|
330
|
+
# HACK: move to update command test
|
331
331
|
def test_process_args_update
|
332
332
|
#capture all update options
|
333
333
|
check_options = nil
|
@@ -47,7 +47,7 @@ class TestGemCommandsCertCommand < Gem::TestCase
|
|
47
47
|
|
48
48
|
matches = @cmd.certificates_matching ""
|
49
49
|
|
50
|
-
# HACK OpenSSL::X509::Certificate#== is Object#==, so do this the hard way
|
50
|
+
# HACK: OpenSSL::X509::Certificate#== is Object#==, so do this the hard way
|
51
51
|
match = matches.next
|
52
52
|
assert_equal ALTERNATE_CERT.to_pem, match.first.to_pem
|
53
53
|
assert_equal @trust_dir.cert_path(ALTERNATE_CERT), match.last
|
@@ -129,9 +129,9 @@ Added '/CN=alternate/DC=example'
|
|
129
129
|
output.shift
|
130
130
|
assert_equal "Please repeat the passphrase for your Private Key: ",
|
131
131
|
output.shift
|
132
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
132
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
133
133
|
output.shift
|
134
|
-
assert_equal "Private Key: #{File.join @tempdir,
|
134
|
+
assert_equal "Private Key: #{File.join @tempdir, "gem-private_key.pem"}",
|
135
135
|
output.shift
|
136
136
|
|
137
137
|
assert_equal "Don't forget to move the key file to somewhere private!",
|
@@ -161,9 +161,9 @@ Added '/CN=alternate/DC=example'
|
|
161
161
|
output.shift
|
162
162
|
assert_equal "Please repeat the passphrase for your Private Key: ",
|
163
163
|
output.shift
|
164
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
164
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
165
165
|
output.shift
|
166
|
-
assert_equal "Private Key: #{File.join @tempdir,
|
166
|
+
assert_equal "Private Key: #{File.join @tempdir, "gem-private_key.pem"}",
|
167
167
|
output.shift
|
168
168
|
|
169
169
|
assert_equal "Don't forget to move the key file to somewhere private!",
|
@@ -221,9 +221,9 @@ Added '/CN=alternate/DC=example'
|
|
221
221
|
output.shift
|
222
222
|
assert_equal "Please repeat the passphrase for your Private Key: ",
|
223
223
|
output.shift
|
224
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
224
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
225
225
|
output.shift
|
226
|
-
assert_equal "Private Key: #{File.join @tempdir,
|
226
|
+
assert_equal "Private Key: #{File.join @tempdir, "gem-private_key.pem"}",
|
227
227
|
output.shift
|
228
228
|
|
229
229
|
assert_equal "Don't forget to move the key file to somewhere private!",
|
@@ -284,7 +284,7 @@ Added '/CN=alternate/DC=example'
|
|
284
284
|
|
285
285
|
output = @ui.output.split "\n"
|
286
286
|
|
287
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
287
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
288
288
|
output.shift
|
289
289
|
|
290
290
|
assert_empty output
|
@@ -306,7 +306,7 @@ Added '/CN=alternate/DC=example'
|
|
306
306
|
|
307
307
|
output = @ui.output.split "\n"
|
308
308
|
|
309
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
309
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
310
310
|
output.shift
|
311
311
|
|
312
312
|
assert_empty output
|
@@ -327,7 +327,7 @@ Added '/CN=alternate/DC=example'
|
|
327
327
|
|
328
328
|
output = @ui.output.split "\n"
|
329
329
|
|
330
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
330
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
331
331
|
output.shift
|
332
332
|
|
333
333
|
assert_empty output
|
@@ -476,7 +476,7 @@ Removed '/CN=alternate/DC=example'
|
|
476
476
|
|
477
477
|
def test_execute_sign
|
478
478
|
path = File.join @tempdir, "cert.pem"
|
479
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
479
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
480
480
|
|
481
481
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
482
482
|
|
@@ -498,14 +498,14 @@ Removed '/CN=alternate/DC=example'
|
|
498
498
|
|
499
499
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
500
500
|
|
501
|
-
mask =
|
501
|
+
mask = 0o100600 & (~File.umask)
|
502
502
|
|
503
503
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
504
504
|
end
|
505
505
|
|
506
506
|
def test_execute_sign_encrypted_key
|
507
507
|
path = File.join @tempdir, "cert.pem"
|
508
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
508
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
509
509
|
|
510
510
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
511
511
|
|
@@ -527,7 +527,7 @@ Removed '/CN=alternate/DC=example'
|
|
527
527
|
|
528
528
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
529
529
|
|
530
|
-
mask =
|
530
|
+
mask = 0o100600 & (~File.umask)
|
531
531
|
|
532
532
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
533
533
|
end
|
@@ -542,7 +542,7 @@ Removed '/CN=alternate/DC=example'
|
|
542
542
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
543
543
|
|
544
544
|
path = File.join @tempdir, "cert.pem"
|
545
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
545
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
546
546
|
|
547
547
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
548
548
|
|
@@ -559,7 +559,7 @@ Removed '/CN=alternate/DC=example'
|
|
559
559
|
|
560
560
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
561
561
|
|
562
|
-
mask =
|
562
|
+
mask = 0o100600 & (~File.umask)
|
563
563
|
|
564
564
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
565
565
|
end
|
@@ -568,13 +568,13 @@ Removed '/CN=alternate/DC=example'
|
|
568
568
|
FileUtils.mkdir_p File.join(Gem.user_home, ".gem")
|
569
569
|
|
570
570
|
private_key_path = File.join Gem.user_home, ".gem", "gem-private_key.pem"
|
571
|
-
Gem::Security.write ENCRYPTED_PRIVATE_KEY, private_key_path,
|
571
|
+
Gem::Security.write ENCRYPTED_PRIVATE_KEY, private_key_path, 0o600, PRIVATE_KEY_PASSPHRASE
|
572
572
|
|
573
573
|
public_cert_path = File.join Gem.user_home, ".gem", "gem-public_cert.pem"
|
574
574
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
575
575
|
|
576
576
|
path = File.join @tempdir, "cert.pem"
|
577
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
577
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
578
578
|
|
579
579
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
580
580
|
|
@@ -591,7 +591,7 @@ Removed '/CN=alternate/DC=example'
|
|
591
591
|
|
592
592
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
593
593
|
|
594
|
-
mask =
|
594
|
+
mask = 0o100600 & (~File.umask)
|
595
595
|
|
596
596
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
597
597
|
end
|
@@ -603,7 +603,7 @@ Removed '/CN=alternate/DC=example'
|
|
603
603
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
604
604
|
|
605
605
|
path = File.join @tempdir, "cert.pem"
|
606
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
606
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
607
607
|
|
608
608
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
609
609
|
|
@@ -631,7 +631,7 @@ ERROR: --certificate not specified and ~/.gem/gem-public_cert.pem does not exis
|
|
631
631
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
632
632
|
|
633
633
|
path = File.join @tempdir, "cert.pem"
|
634
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
634
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
635
635
|
|
636
636
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
637
637
|
|
@@ -657,7 +657,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
|
|
657
657
|
Dir.mkdir gem_path
|
658
658
|
|
659
659
|
path = File.join @tempdir, "cert.pem"
|
660
|
-
Gem::Security.write EXPIRED_PUBLIC_CERT, path,
|
660
|
+
Gem::Security.write EXPIRED_PUBLIC_CERT, path, 0o600
|
661
661
|
|
662
662
|
assert_equal "/CN=nobody/DC=example", EXPIRED_PUBLIC_CERT.issuer.to_s
|
663
663
|
|
@@ -689,7 +689,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
|
|
689
689
|
Dir.mkdir gem_path
|
690
690
|
|
691
691
|
path = File.join @tempdir, "cert.pem"
|
692
|
-
Gem::Security.write EXPIRED_PUBLIC_CERT, path,
|
692
|
+
Gem::Security.write EXPIRED_PUBLIC_CERT, path, 0o600
|
693
693
|
|
694
694
|
assert_equal "/CN=nobody/DC=example", EXPIRED_PUBLIC_CERT.issuer.to_s
|
695
695
|
|
@@ -166,7 +166,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def test_execute_all_user_no_sudo
|
169
|
-
FileUtils.chmod
|
169
|
+
FileUtils.chmod 0o555, @gemhome
|
170
170
|
|
171
171
|
@a_1_1, = util_gem "a", "1.1"
|
172
172
|
@a_1_1 = install_gem @a_1_1, :user_install => true # pick up user install path
|
@@ -183,7 +183,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
183
183
|
assert_path_exist @a_1.gem_dir
|
184
184
|
assert_path_exist @a_1_1.gem_dir
|
185
185
|
ensure
|
186
|
-
FileUtils.chmod
|
186
|
+
FileUtils.chmod 0o755, @gemhome
|
187
187
|
end unless win_platform? || Process.uid.zero?
|
188
188
|
|
189
189
|
def test_execute_dry_run
|
@@ -12,7 +12,8 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase
|
|
12
12
|
|
13
13
|
def test_execute
|
14
14
|
orig_sources = Gem.sources.dup
|
15
|
-
orig_path
|
15
|
+
orig_path = ENV["PATH"]
|
16
|
+
ENV["PATH"] = %w[/usr/local/bin /usr/bin /bin].join(File::PATH_SEPARATOR)
|
16
17
|
Gem.sources.replace %w[http://gems.example.com]
|
17
18
|
Gem.configuration["gemcutter_key"] = "blah"
|
18
19
|
|
@@ -731,7 +731,11 @@ class TestGemCommandsExecCommand < Gem::TestCase
|
|
731
731
|
assert_includes @ui.output, "a (2)\n"
|
732
732
|
assert_includes @ui.output, "b (2)\n"
|
733
733
|
|
734
|
-
|
734
|
+
begin
|
735
|
+
invoke "gem", "uninstall", "--verbose", "-x", "a"
|
736
|
+
rescue StandardError
|
737
|
+
nil
|
738
|
+
end
|
735
739
|
refute_includes @ui.output, "running gem exec with"
|
736
740
|
assert_includes @ui.output, "Successfully uninstalled a-2\n"
|
737
741
|
|
@@ -205,8 +205,8 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|
205
205
|
use_ui @ui do
|
206
206
|
orig_dir = Dir.pwd
|
207
207
|
begin
|
208
|
-
FileUtils.chmod
|
209
|
-
FileUtils.chmod
|
208
|
+
FileUtils.chmod 0o755, @userhome
|
209
|
+
FileUtils.chmod 0o555, @gemhome
|
210
210
|
|
211
211
|
Dir.chdir @tempdir
|
212
212
|
assert_raise Gem::FilePermissionError do
|
@@ -214,7 +214,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|
214
214
|
end
|
215
215
|
ensure
|
216
216
|
Dir.chdir orig_dir
|
217
|
-
FileUtils.chmod
|
217
|
+
FileUtils.chmod 0o755, @gemhome
|
218
218
|
end
|
219
219
|
end
|
220
220
|
end
|
@@ -233,7 +233,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|
233
233
|
assert_equal 2, e.exit_code
|
234
234
|
end
|
235
235
|
|
236
|
-
# HACK no repository was checked
|
236
|
+
# HACK: no repository was checked
|
237
237
|
assert_match(/ould not find a valid gem 'no_such_gem'/, @ui.error)
|
238
238
|
end
|
239
239
|
|
@@ -252,7 +252,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|
252
252
|
assert_equal 2, e.exit_code
|
253
253
|
end
|
254
254
|
|
255
|
-
# HACK no repository was checked
|
255
|
+
# HACK: no repository was checked
|
256
256
|
assert_match(/ould not find a valid gem 'no_such_gem'/, @ui.error)
|
257
257
|
end
|
258
258
|
|