rubygems-update 3.2.24 → 3.2.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -0
- data/Manifest.txt +7 -7
- data/bundler/CHANGELOG.md +62 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/cache.rb +1 -1
- data/bundler/lib/bundler/cli/doctor.rb +1 -1
- data/bundler/lib/bundler/cli/exec.rb +1 -6
- data/bundler/lib/bundler/cli/gem.rb +3 -2
- data/bundler/lib/bundler/cli/install.rb +4 -17
- data/bundler/lib/bundler/cli/list.rb +7 -1
- data/bundler/lib/bundler/cli/open.rb +1 -2
- data/bundler/lib/bundler/cli/remove.rb +1 -2
- data/bundler/lib/bundler/cli/update.rb +1 -1
- data/bundler/lib/bundler/cli.rb +12 -9
- data/bundler/lib/bundler/definition.rb +25 -29
- data/bundler/lib/bundler/dsl.rb +14 -1
- data/bundler/lib/bundler/errors.rb +1 -1
- data/bundler/lib/bundler/installer/gem_installer.rb +3 -16
- data/bundler/lib/bundler/installer/standalone.rb +13 -8
- data/bundler/lib/bundler/installer.rb +0 -1
- data/bundler/lib/bundler/lockfile_parser.rb +1 -0
- data/bundler/lib/bundler/plugin/installer.rb +2 -0
- data/bundler/lib/bundler/plugin.rb +23 -6
- data/bundler/lib/bundler/resolver.rb +10 -17
- data/bundler/lib/bundler/rubygems_gem_installer.rb +5 -1
- data/bundler/lib/bundler/rubygems_integration.rb +2 -0
- data/bundler/lib/bundler/runtime.rb +15 -6
- data/bundler/lib/bundler/settings.rb +13 -1
- data/bundler/lib/bundler/setup.rb +2 -2
- data/bundler/lib/bundler/shared_helpers.rb +0 -7
- data/bundler/lib/bundler/source/git/git_proxy.rb +1 -2
- data/bundler/lib/bundler/source/rubygems.rb +23 -2
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +4 -0
- data/bundler/lib/bundler/source.rb +4 -0
- data/bundler/lib/bundler/source_list.rb +16 -3
- data/bundler/lib/bundler/spec_set.rb +13 -35
- data/bundler/lib/bundler/templates/Executable.bundler +6 -6
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +13 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/worker.rb +17 -2
- data/bundler/lib/bundler.rb +11 -21
- data/lib/rubygems/command_manager.rb +3 -3
- data/lib/rubygems/commands/build_command.rb +3 -3
- data/lib/rubygems/commands/cert_command.rb +2 -2
- data/lib/rubygems/commands/check_command.rb +4 -4
- data/lib/rubygems/commands/cleanup_command.rb +3 -3
- data/lib/rubygems/commands/contents_command.rb +2 -2
- data/lib/rubygems/commands/dependency_command.rb +3 -3
- data/lib/rubygems/commands/environment_command.rb +1 -1
- data/lib/rubygems/commands/fetch_command.rb +3 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -2
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/info_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +12 -11
- data/lib/rubygems/commands/list_command.rb +2 -2
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/mirror_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +2 -2
- data/lib/rubygems/commands/outdated_command.rb +4 -4
- data/lib/rubygems/commands/owner_command.rb +4 -4
- data/lib/rubygems/commands/pristine_command.rb +5 -5
- data/lib/rubygems/commands/push_command.rb +4 -4
- data/lib/rubygems/commands/query_command.rb +3 -3
- data/lib/rubygems/commands/rdoc_command.rb +3 -3
- data/lib/rubygems/commands/search_command.rb +2 -2
- data/lib/rubygems/commands/server_command.rb +3 -3
- data/lib/rubygems/commands/setup_command.rb +5 -5
- data/lib/rubygems/commands/signin_command.rb +2 -2
- data/lib/rubygems/commands/signout_command.rb +1 -1
- data/lib/rubygems/commands/sources_command.rb +4 -4
- data/lib/rubygems/commands/specification_command.rb +4 -4
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +3 -3
- data/lib/rubygems/commands/unpack_command.rb +5 -5
- data/lib/rubygems/commands/update_command.rb +9 -9
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +4 -4
- data/lib/rubygems/config_file.rb +5 -5
- data/lib/rubygems/dependency_installer.rb +8 -8
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/doctor.rb +2 -2
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/ext/builder.rb +1 -0
- data/lib/rubygems/ext/ext_conf_builder.rb +1 -2
- data/lib/rubygems/ext/rake_builder.rb +1 -2
- data/lib/rubygems/gem_runner.rb +3 -3
- data/lib/rubygems/gemcutter_utilities.rb +2 -2
- data/lib/rubygems/indexer.rb +2 -2
- data/lib/rubygems/install_default_message.rb +2 -2
- data/lib/rubygems/install_message.rb +2 -2
- data/lib/rubygems/install_update_options.rb +2 -2
- data/lib/rubygems/installer.rb +17 -8
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/mock_gem_ui.rb +1 -1
- data/lib/rubygems/package/tar_reader.rb +1 -1
- data/lib/rubygems/package.rb +12 -12
- data/lib/rubygems/package_task.rb +2 -2
- data/lib/rubygems/platform.rb +2 -1
- data/lib/rubygems/rdoc.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +14 -21
- data/lib/rubygems/request.rb +5 -5
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +1 -1
- data/lib/rubygems/request_set.rb +4 -4
- data/lib/rubygems/requirement.rb +3 -22
- data/lib/rubygems/resolver/git_specification.rb +1 -1
- data/lib/rubygems/resolver/installer_set.rb +3 -3
- data/lib/rubygems/resolver/molinillo.rb +1 -1
- data/lib/rubygems/resolver/set.rb +0 -1
- data/lib/rubygems/resolver/specification.rb +1 -1
- data/lib/rubygems/resolver.rb +31 -31
- data/lib/rubygems/s3_uri_signer.rb +0 -1
- data/lib/rubygems/safe_yaml.rb +0 -2
- data/lib/rubygems/security/policy.rb +1 -1
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/security.rb +5 -5
- data/lib/rubygems/security_option.rb +2 -2
- data/lib/rubygems/server.rb +2 -2
- data/lib/rubygems/source.rb +6 -6
- data/lib/rubygems/spec_fetcher.rb +5 -5
- data/lib/rubygems/specification.rb +9 -15
- data/lib/rubygems/specification_policy.rb +2 -2
- data/lib/rubygems/uninstaller.rb +6 -6
- data/lib/rubygems/uri.rb +111 -0
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/util/licenses.rb +1 -1
- data/lib/rubygems/validator.rb +2 -2
- data/lib/rubygems/version_option.rb +1 -1
- data/lib/rubygems.rb +37 -47
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/{lib/rubygems/test_case.rb → test/rubygems/helper.rb} +16 -19
- data/{lib → test}/rubygems/installer_test_case.rb +1 -1
- data/{lib → test}/rubygems/package/tar_test_case.rb +1 -1
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +1 -1
- data/test/rubygems/test_deprecate.rb +1 -1
- data/test/rubygems/test_gem.rb +190 -136
- data/test/rubygems/test_gem_available_set.rb +1 -1
- data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
- data/test/rubygems/test_gem_command.rb +1 -1
- data/test/rubygems/test_gem_command_manager.rb +1 -1
- data/test/rubygems/test_gem_commands_build_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +1 -1
- data/test/rubygems/test_gem_commands_check_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -1
- data/test/rubygems/test_gem_commands_dependency_command.rb +1 -1
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +1 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -1
- data/test/rubygems/test_gem_commands_help_command.rb +1 -1
- data/test/rubygems/test_gem_commands_info_command.rb +1 -1
- data/test/rubygems/test_gem_commands_install_command.rb +26 -1
- data/test/rubygems/test_gem_commands_list_command.rb +1 -1
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_mirror.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +1 -1
- data/test/rubygems/test_gem_commands_outdated_command.rb +1 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +1 -1
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
- data/test/rubygems/test_gem_commands_push_command.rb +1 -1
- data/test/rubygems/test_gem_commands_query_command.rb +1 -1
- data/test/rubygems/test_gem_commands_search_command.rb +1 -1
- data/test/rubygems/test_gem_commands_server_command.rb +1 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +3 -3
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_signout_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +1 -1
- data/test/rubygems/test_gem_commands_specification_command.rb +1 -1
- data/test/rubygems/test_gem_commands_stale_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
- data/test/rubygems/test_gem_commands_unpack_command.rb +1 -1
- data/test/rubygems/test_gem_commands_update_command.rb +1 -1
- data/test/rubygems/test_gem_commands_which_command.rb +1 -1
- data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +1 -1
- data/test/rubygems/test_gem_dependency.rb +1 -1
- data/test/rubygems/test_gem_dependency_installer.rb +1 -1
- data/test/rubygems/test_gem_dependency_list.rb +1 -1
- data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +1 -1
- data/test/rubygems/test_gem_ext_builder.rb +4 -1
- data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
- data/test/rubygems/test_gem_gem_runner.rb +1 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +1 -1
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +1 -1
- data/test/rubygems/test_gem_indexer.rb +1 -1
- data/test/rubygems/test_gem_install_update_options.rb +1 -1
- data/test/rubygems/test_gem_installer.rb +4 -2
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_name_tuple.rb +1 -1
- data/test/rubygems/test_gem_package.rb +1 -1
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +1 -1
- data/test/rubygems/test_gem_package_tar_reader.rb +1 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +1 -1
- data/test/rubygems/test_gem_package_tar_writer.rb +1 -1
- data/test/rubygems/test_gem_package_task.rb +1 -1
- data/test/rubygems/test_gem_path_support.rb +1 -1
- data/test/rubygems/test_gem_platform.rb +2 -1
- data/test/rubygems/test_gem_rdoc.rb +1 -1
- data/test/rubygems/test_gem_remote_fetcher.rb +31 -1
- data/test/rubygems/test_gem_request.rb +36 -10
- data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
- data/test/rubygems/test_gem_request_set.rb +1 -1
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +35 -1
- data/test/rubygems/test_gem_resolver.rb +1 -1
- data/test/rubygems/test_gem_resolver_activation_request.rb +1 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +2 -1
- data/test/rubygems/test_gem_resolver_index_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installed_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +19 -1
- data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_lock_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +1 -1
- data/test/rubygems/test_gem_security.rb +1 -1
- data/test/rubygems/test_gem_security_policy.rb +1 -1
- data/test/rubygems/test_gem_security_signer.rb +1 -1
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -1
- data/test/rubygems/test_gem_server.rb +1 -1
- data/test/rubygems/test_gem_silent_ui.rb +1 -1
- data/test/rubygems/test_gem_source.rb +1 -1
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
- data/test/rubygems/test_gem_source_git.rb +1 -1
- data/test/rubygems/test_gem_source_installed.rb +1 -1
- data/test/rubygems/test_gem_source_list.rb +1 -1
- data/test/rubygems/test_gem_source_local.rb +1 -1
- data/test/rubygems/test_gem_source_lock.rb +1 -1
- data/test/rubygems/test_gem_source_specific_file.rb +1 -1
- data/test/rubygems/test_gem_source_subpath_problem.rb +1 -1
- data/test/rubygems/test_gem_source_vendor.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +15 -165
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_stub_specification.rb +1 -1
- data/test/rubygems/test_gem_text.rb +1 -1
- data/test/rubygems/test_gem_uninstaller.rb +1 -1
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +1 -1
- data/test/rubygems/test_gem_uri.rb +39 -0
- data/test/rubygems/test_gem_uri_formatter.rb +1 -1
- data/test/rubygems/test_gem_util.rb +1 -1
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_gem_version.rb +1 -1
- data/test/rubygems/test_gem_version_option.rb +1 -1
- data/test/rubygems/test_kernel.rb +1 -1
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +1 -1
- data/test/rubygems/test_rubygems.rb +44 -0
- data/{lib/rubygems/test_utilities.rb → test/rubygems/utilities.rb} +0 -2
- metadata +10 -10
- data/lib/rubygems/syck_hack.rb +0 -77
- data/lib/rubygems/uri_parser.rb +0 -34
- data/lib/rubygems/uri_parsing.rb +0 -23
data/test/rubygems/test_gem.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# coding: US-ASCII
|
2
|
-
|
2
|
+
require_relative 'helper'
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rubygems/command'
|
5
5
|
require 'rubygems/installer'
|
@@ -19,7 +19,6 @@ class TestGem < Gem::TestCase
|
|
19
19
|
|
20
20
|
common_installer_setup
|
21
21
|
|
22
|
-
ENV.delete 'RUBYGEMS_GEMDEPS'
|
23
22
|
@additional = %w[a b].map {|d| File.join @tempdir, d }
|
24
23
|
|
25
24
|
util_remove_interrupt_command
|
@@ -540,7 +539,6 @@ class TestGem < Gem::TestCase
|
|
540
539
|
s.executables = []
|
541
540
|
end
|
542
541
|
install_specs spec
|
543
|
-
# Should not find a-10's non-abin (bug)
|
544
542
|
assert_equal @abin_path, Gem.bin_path('a', 'abin')
|
545
543
|
end
|
546
544
|
|
@@ -664,22 +662,22 @@ class TestGem < Gem::TestCase
|
|
664
662
|
end
|
665
663
|
|
666
664
|
def test_self_use_gemdeps
|
667
|
-
|
665
|
+
with_rubygems_gemdeps('-') do
|
666
|
+
FileUtils.mkdir_p 'detect/a/b'
|
667
|
+
FileUtils.mkdir_p 'detect/a/Isolate'
|
668
668
|
|
669
|
-
|
670
|
-
FileUtils.mkdir_p 'detect/a/Isolate'
|
669
|
+
FileUtils.touch 'detect/Isolate'
|
671
670
|
|
672
|
-
|
671
|
+
begin
|
672
|
+
Dir.chdir 'detect/a/b'
|
673
673
|
|
674
|
-
|
675
|
-
Dir.chdir 'detect/a/b'
|
674
|
+
Gem.use_gemdeps
|
676
675
|
|
677
|
-
|
678
|
-
|
679
|
-
|
676
|
+
assert_equal add_bundler_full_name([]), loaded_spec_names
|
677
|
+
ensure
|
678
|
+
Dir.chdir @tempdir
|
679
|
+
end
|
680
680
|
end
|
681
|
-
ensure
|
682
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
683
681
|
end
|
684
682
|
|
685
683
|
def test_self_dir
|
@@ -1580,6 +1578,31 @@ class TestGem < Gem::TestCase
|
|
1580
1578
|
assert_equal %w[plugin], PLUGINS_LOADED
|
1581
1579
|
end
|
1582
1580
|
|
1581
|
+
def test_load_user_installed_plugins
|
1582
|
+
plugin_path = File.join "lib", "rubygems_plugin.rb"
|
1583
|
+
|
1584
|
+
Dir.chdir @tempdir do
|
1585
|
+
FileUtils.mkdir_p 'lib'
|
1586
|
+
File.open plugin_path, "w" do |fp|
|
1587
|
+
fp.puts "class TestGem; PLUGINS_LOADED << 'plugin'; end"
|
1588
|
+
end
|
1589
|
+
|
1590
|
+
foo = util_spec 'foo', '1' do |s|
|
1591
|
+
s.files << plugin_path
|
1592
|
+
end
|
1593
|
+
|
1594
|
+
install_gem_user foo
|
1595
|
+
end
|
1596
|
+
|
1597
|
+
Gem.paths = { "GEM_PATH" => [Gem.dir, Gem.user_dir].join(File::PATH_SEPARATOR) }
|
1598
|
+
|
1599
|
+
gem 'foo'
|
1600
|
+
|
1601
|
+
Gem.load_plugins
|
1602
|
+
|
1603
|
+
assert_equal %w[plugin], PLUGINS_LOADED
|
1604
|
+
end
|
1605
|
+
|
1583
1606
|
def test_load_env_plugins
|
1584
1607
|
with_plugin('load') { Gem.load_env_plugins }
|
1585
1608
|
assert_equal :loaded, TEST_PLUGIN_LOAD rescue nil
|
@@ -1689,11 +1712,11 @@ class TestGem < Gem::TestCase
|
|
1689
1712
|
f.puts "gem 'c'"
|
1690
1713
|
end
|
1691
1714
|
|
1692
|
-
|
1693
|
-
|
1694
|
-
Gem.use_gemdeps
|
1715
|
+
with_rubygems_gemdeps(path) do
|
1716
|
+
Gem.use_gemdeps
|
1695
1717
|
|
1696
|
-
|
1718
|
+
assert_equal add_bundler_full_name(%W[a-1 b-1 c-1]), loaded_spec_names
|
1719
|
+
end
|
1697
1720
|
end
|
1698
1721
|
|
1699
1722
|
def test_auto_activation_of_used_gemdeps_file
|
@@ -1711,10 +1734,13 @@ class TestGem < Gem::TestCase
|
|
1711
1734
|
f.puts "gem 'c'"
|
1712
1735
|
end
|
1713
1736
|
|
1714
|
-
|
1737
|
+
with_rubygems_gemdeps("-") do
|
1738
|
+
expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact.map(&:full_name)
|
1739
|
+
|
1740
|
+
Gem.use_gemdeps
|
1715
1741
|
|
1716
|
-
|
1717
|
-
|
1742
|
+
assert_equal expected_specs, loaded_spec_names
|
1743
|
+
end
|
1718
1744
|
end
|
1719
1745
|
|
1720
1746
|
BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }
|
@@ -1726,10 +1752,18 @@ class TestGem < Gem::TestCase
|
|
1726
1752
|
names
|
1727
1753
|
end
|
1728
1754
|
|
1729
|
-
def
|
1755
|
+
def test_looks_for_gemdeps_files_automatically_from_binstubs
|
1730
1756
|
pend "Requiring bundler messes things up" if Gem.java_platform?
|
1731
1757
|
|
1732
|
-
a = util_spec "a", "1"
|
1758
|
+
a = util_spec "a", "1" do |s|
|
1759
|
+
s.executables = %w[foo]
|
1760
|
+
s.bindir = "exe"
|
1761
|
+
end
|
1762
|
+
|
1763
|
+
write_file File.join(@tempdir, 'exe', 'foo') do |fp|
|
1764
|
+
fp.puts "puts Gem.loaded_specs.values.map(&:full_name).sort"
|
1765
|
+
end
|
1766
|
+
|
1733
1767
|
b = util_spec "b", "1", nil, "lib/b.rb"
|
1734
1768
|
c = util_spec "c", "1", nil, "lib/c.rb"
|
1735
1769
|
|
@@ -1741,31 +1775,44 @@ class TestGem < Gem::TestCase
|
|
1741
1775
|
install_gem c, :install_dir => path
|
1742
1776
|
|
1743
1777
|
ENV['GEM_PATH'] = path
|
1744
|
-
ENV['RUBYGEMS_GEMDEPS'] = "-"
|
1745
1778
|
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort"
|
1779
|
+
with_rubygems_gemdeps("-") do
|
1780
|
+
new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR)
|
1781
|
+
new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}"
|
1750
1782
|
|
1751
|
-
|
1752
|
-
f.puts "gem 'a'"
|
1753
|
-
end
|
1754
|
-
out0 = IO.popen(cmd, &:read).split(/\n/)
|
1783
|
+
path = File.join @tempdir, "gem.deps.rb"
|
1755
1784
|
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1785
|
+
File.open path, "w" do |f|
|
1786
|
+
f.puts "gem 'a'"
|
1787
|
+
end
|
1788
|
+
out0 = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
|
1789
|
+
IO.popen("foo", &:read).split(/\n/)
|
1790
|
+
end
|
1791
|
+
|
1792
|
+
File.open path, "a" do |f|
|
1793
|
+
f.puts "gem 'b'"
|
1794
|
+
f.puts "gem 'c'"
|
1795
|
+
end
|
1796
|
+
out = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
|
1797
|
+
IO.popen("foo", &:read).split(/\n/)
|
1798
|
+
end
|
1761
1799
|
|
1762
|
-
|
1800
|
+
assert_equal ["b-1", "c-1"], out - out0
|
1801
|
+
end
|
1763
1802
|
end
|
1764
1803
|
|
1765
|
-
def
|
1804
|
+
def test_looks_for_gemdeps_files_automatically_from_binstubs_in_parent_dir
|
1766
1805
|
pend "Requiring bundler messes things up" if Gem.java_platform?
|
1767
1806
|
|
1768
|
-
a = util_spec "a", "1"
|
1807
|
+
a = util_spec "a", "1" do |s|
|
1808
|
+
s.executables = %w[foo]
|
1809
|
+
s.bindir = "exe"
|
1810
|
+
end
|
1811
|
+
|
1812
|
+
write_file File.join(@tempdir, 'exe', 'foo') do |fp|
|
1813
|
+
fp.puts "puts Gem.loaded_specs.values.map(&:full_name).sort"
|
1814
|
+
end
|
1815
|
+
|
1769
1816
|
b = util_spec "b", "1", nil, "lib/b.rb"
|
1770
1817
|
c = util_spec "c", "1", nil, "lib/c.rb"
|
1771
1818
|
|
@@ -1777,29 +1824,34 @@ class TestGem < Gem::TestCase
|
|
1777
1824
|
install_gem c, :install_dir => path
|
1778
1825
|
|
1779
1826
|
ENV['GEM_PATH'] = path
|
1780
|
-
ENV['RUBYGEMS_GEMDEPS'] = "-"
|
1781
1827
|
|
1782
|
-
|
1828
|
+
with_rubygems_gemdeps("-") do
|
1829
|
+
Dir.mkdir "sub1"
|
1783
1830
|
|
1784
|
-
|
1785
|
-
|
1786
|
-
"-I#{BUNDLER_LIB_PATH}"]
|
1787
|
-
cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort"
|
1831
|
+
new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR)
|
1832
|
+
new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}"
|
1788
1833
|
|
1789
|
-
|
1790
|
-
f.puts "gem 'a'"
|
1791
|
-
end
|
1792
|
-
out0 = IO.popen(cmd, &:read).split(/\n/)
|
1834
|
+
path = File.join @tempdir, "gem.deps.rb"
|
1793
1835
|
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1836
|
+
File.open path, "w" do |f|
|
1837
|
+
f.puts "gem 'a'"
|
1838
|
+
end
|
1839
|
+
out0 = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
|
1840
|
+
IO.popen("foo", :chdir => "sub1", &:read).split(/\n/)
|
1841
|
+
end
|
1842
|
+
|
1843
|
+
File.open path, "a" do |f|
|
1844
|
+
f.puts "gem 'b'"
|
1845
|
+
f.puts "gem 'c'"
|
1846
|
+
end
|
1847
|
+
out = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
|
1848
|
+
IO.popen("foo", :chdir => "sub1", &:read).split(/\n/)
|
1849
|
+
end
|
1799
1850
|
|
1800
|
-
|
1851
|
+
Dir.rmdir "sub1"
|
1801
1852
|
|
1802
|
-
|
1853
|
+
assert_equal ["b-1", "c-1"], out - out0
|
1854
|
+
end
|
1803
1855
|
end
|
1804
1856
|
|
1805
1857
|
def test_register_default_spec
|
@@ -1863,21 +1915,19 @@ class TestGem < Gem::TestCase
|
|
1863
1915
|
end
|
1864
1916
|
|
1865
1917
|
def test_use_gemdeps_ENV
|
1866
|
-
|
1867
|
-
|
1868
|
-
spec = util_spec 'a', 1
|
1918
|
+
with_rubygems_gemdeps(nil) do
|
1919
|
+
spec = util_spec 'a', 1
|
1869
1920
|
|
1870
|
-
|
1921
|
+
refute spec.activated?
|
1871
1922
|
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1923
|
+
File.open 'gem.deps.rb', 'w' do |io|
|
1924
|
+
io.write 'gem "a"'
|
1925
|
+
end
|
1875
1926
|
|
1876
|
-
|
1927
|
+
Gem.use_gemdeps
|
1877
1928
|
|
1878
|
-
|
1879
|
-
|
1880
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
1929
|
+
refute spec.activated?
|
1930
|
+
end
|
1881
1931
|
end
|
1882
1932
|
|
1883
1933
|
def test_use_gemdeps_argument_missing
|
@@ -1890,110 +1940,96 @@ class TestGem < Gem::TestCase
|
|
1890
1940
|
end
|
1891
1941
|
|
1892
1942
|
def test_use_gemdeps_argument_missing_match_ENV
|
1893
|
-
|
1894
|
-
|
1943
|
+
with_rubygems_gemdeps('gem.deps.rb') do
|
1944
|
+
e = assert_raise ArgumentError do
|
1945
|
+
Gem.use_gemdeps 'gem.deps.rb'
|
1946
|
+
end
|
1895
1947
|
|
1896
|
-
|
1897
|
-
|
1948
|
+
assert_equal 'Unable to find gem dependencies file at gem.deps.rb',
|
1949
|
+
e.message
|
1898
1950
|
end
|
1899
|
-
|
1900
|
-
assert_equal 'Unable to find gem dependencies file at gem.deps.rb',
|
1901
|
-
e.message
|
1902
|
-
ensure
|
1903
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
1904
1951
|
end
|
1905
1952
|
|
1906
1953
|
def test_use_gemdeps_automatic
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1911
|
-
spec = Gem::Specification.find {|s| s == spec }
|
1954
|
+
with_rubygems_gemdeps('-') do
|
1955
|
+
spec = util_spec 'a', 1
|
1956
|
+
install_specs spec
|
1957
|
+
spec = Gem::Specification.find {|s| s == spec }
|
1912
1958
|
|
1913
|
-
|
1959
|
+
refute spec.activated?
|
1914
1960
|
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1961
|
+
File.open 'Gemfile', 'w' do |io|
|
1962
|
+
io.write 'gem "a"'
|
1963
|
+
end
|
1918
1964
|
|
1919
|
-
|
1965
|
+
Gem.use_gemdeps
|
1920
1966
|
|
1921
|
-
|
1922
|
-
|
1923
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
1967
|
+
assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
|
1968
|
+
end
|
1924
1969
|
end
|
1925
1970
|
|
1926
1971
|
def test_use_gemdeps_automatic_missing
|
1927
|
-
|
1972
|
+
with_rubygems_gemdeps('-') do
|
1973
|
+
Gem.use_gemdeps
|
1928
1974
|
|
1929
|
-
|
1930
|
-
|
1931
|
-
assert true # count
|
1932
|
-
ensure
|
1933
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
1975
|
+
assert true # count
|
1976
|
+
end
|
1934
1977
|
end
|
1935
1978
|
|
1936
1979
|
def test_use_gemdeps_disabled
|
1937
|
-
|
1980
|
+
with_rubygems_gemdeps('') do
|
1981
|
+
spec = util_spec 'a', 1
|
1938
1982
|
|
1939
|
-
|
1983
|
+
refute spec.activated?
|
1940
1984
|
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
io.write 'gem "a"'
|
1945
|
-
end
|
1985
|
+
File.open 'gem.deps.rb', 'w' do |io|
|
1986
|
+
io.write 'gem "a"'
|
1987
|
+
end
|
1946
1988
|
|
1947
|
-
|
1989
|
+
Gem.use_gemdeps
|
1948
1990
|
|
1949
|
-
|
1950
|
-
|
1951
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
1991
|
+
refute spec.activated?
|
1992
|
+
end
|
1952
1993
|
end
|
1953
1994
|
|
1954
1995
|
def test_use_gemdeps_missing_gem
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
end
|
1996
|
+
with_rubygems_gemdeps('x') do
|
1997
|
+
File.open 'x', 'w' do |io|
|
1998
|
+
io.write 'gem "a"'
|
1999
|
+
end
|
1960
2000
|
|
1961
|
-
|
2001
|
+
expected = <<-EXPECTED
|
1962
2002
|
Could not find gem 'a' in locally installed gems.
|
1963
|
-
|
1964
|
-
You may need to `gem install -g` to install missing gems
|
2003
|
+
You may need to `bundle install` to install missing gems
|
1965
2004
|
|
1966
|
-
|
2005
|
+
EXPECTED
|
1967
2006
|
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
2007
|
+
Gem::Deprecate.skip_during do
|
2008
|
+
actual_stdout, actual_stderr = capture_output do
|
2009
|
+
Gem.use_gemdeps
|
2010
|
+
end
|
2011
|
+
assert_empty actual_stdout
|
2012
|
+
assert_equal(expected, actual_stderr)
|
1971
2013
|
end
|
1972
|
-
assert_empty actual_stdout
|
1973
|
-
assert_equal(expected, actual_stderr)
|
1974
2014
|
end
|
1975
|
-
ensure
|
1976
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
1977
2015
|
end
|
1978
2016
|
|
1979
2017
|
def test_use_gemdeps_specific
|
1980
|
-
|
2018
|
+
with_rubygems_gemdeps('x') do
|
2019
|
+
spec = util_spec 'a', 1
|
2020
|
+
install_specs spec
|
1981
2021
|
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
spec = Gem::Specification.find {|s| s == spec }
|
1986
|
-
refute spec.activated?
|
2022
|
+
spec = Gem::Specification.find {|s| s == spec }
|
2023
|
+
refute spec.activated?
|
1987
2024
|
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
2025
|
+
File.open 'x', 'w' do |io|
|
2026
|
+
io.write 'gem "a"'
|
2027
|
+
end
|
1991
2028
|
|
1992
|
-
|
2029
|
+
Gem.use_gemdeps
|
1993
2030
|
|
1994
|
-
|
1995
|
-
|
1996
|
-
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
2031
|
+
assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
|
2032
|
+
end
|
1997
2033
|
end
|
1998
2034
|
|
1999
2035
|
def test_operating_system_defaults
|
@@ -2111,4 +2147,22 @@ You may need to `gem install -g` to install missing gems
|
|
2111
2147
|
def util_cache_dir
|
2112
2148
|
File.join Gem.dir, "cache"
|
2113
2149
|
end
|
2150
|
+
|
2151
|
+
def with_path_and_rubyopt(path_value, rubyopt_value)
|
2152
|
+
path, ENV['PATH'] = ENV['PATH'], path_value
|
2153
|
+
rubyopt, ENV['RUBYOPT'] = ENV['RUBYOPT'], rubyopt_value
|
2154
|
+
|
2155
|
+
yield
|
2156
|
+
ensure
|
2157
|
+
ENV['PATH'] = path
|
2158
|
+
ENV['RUBYOPT'] = rubyopt
|
2159
|
+
end
|
2160
|
+
|
2161
|
+
def with_rubygems_gemdeps(value)
|
2162
|
+
rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], value
|
2163
|
+
|
2164
|
+
yield
|
2165
|
+
ensure
|
2166
|
+
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
2167
|
+
end
|
2114
2168
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require_relative 'helper'
|
3
3
|
require 'rubygems/commands/install_command'
|
4
4
|
require 'rubygems/request_set'
|
5
5
|
require 'rubygems/rdoc'
|
@@ -1067,6 +1067,31 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
1067
1067
|
assert_equal x, e
|
1068
1068
|
end
|
1069
1069
|
|
1070
|
+
def test_redact_credentials_from_uri_on_warning
|
1071
|
+
spec_fetcher do |fetcher|
|
1072
|
+
fetcher.download 'a', 2
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
Gem.sources << "http://username:SECURE_TOKEN@nonexistent.example"
|
1076
|
+
|
1077
|
+
@cmd.options[:args] = %w[a]
|
1078
|
+
|
1079
|
+
use_ui @ui do
|
1080
|
+
assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
|
1081
|
+
@cmd.execute
|
1082
|
+
end
|
1083
|
+
end
|
1084
|
+
|
1085
|
+
assert_equal %w[a-2], @cmd.installed_specs.map {|spec| spec.full_name }
|
1086
|
+
|
1087
|
+
assert_match "1 gem installed", @ui.output
|
1088
|
+
|
1089
|
+
e = @ui.error
|
1090
|
+
|
1091
|
+
x = "WARNING: Unable to pull data from 'http://username:REDACTED@nonexistent.example': no data for http://username:REDACTED@nonexistent.example/specs.4.8.gz (http://username:REDACTED@nonexistent.example/specs.4.8.gz)\n"
|
1092
|
+
assert_equal x, e
|
1093
|
+
end
|
1094
|
+
|
1070
1095
|
def test_execute_uses_from_a_gemdeps
|
1071
1096
|
spec_fetcher do |fetcher|
|
1072
1097
|
fetcher.gem 'a', 2
|