rubygems-update 2.7.11 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +66 -0
- data/.travis.yml +22 -18
- data/CONTRIBUTING.md +141 -0
- data/History.txt +289 -19
- data/MAINTAINERS.txt +1 -0
- data/Manifest.txt +16 -11
- data/POLICIES.md +92 -0
- data/README.md +47 -26
- data/Rakefile +47 -207
- data/{UPGRADING.rdoc → UPGRADING.md} +31 -32
- data/appveyor.yml +20 -45
- data/bin/gem +1 -2
- data/bin/update_rubygems +2 -3
- data/bundler/CHANGELOG.md +54 -0
- data/bundler/bundler.gemspec +7 -1
- data/bundler/lib/bundler.rb +26 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +63 -21
- data/bundler/lib/bundler/cli/add.rb +15 -5
- data/bundler/lib/bundler/cli/binstubs.rb +8 -2
- data/bundler/lib/bundler/cli/doctor.rb +47 -1
- data/bundler/lib/bundler/cli/install.rb +8 -5
- data/bundler/lib/bundler/cli/list.rb +41 -5
- data/bundler/lib/bundler/cli/outdated.rb +7 -1
- data/bundler/lib/bundler/cli/pristine.rb +4 -0
- data/bundler/lib/bundler/cli/remove.rb +18 -0
- data/bundler/lib/bundler/definition.rb +15 -16
- data/bundler/lib/bundler/dependency.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +19 -3
- data/bundler/lib/bundler/feature_flag.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +4 -2
- data/bundler/lib/bundler/injector.rb +168 -9
- data/bundler/lib/bundler/installer.rb +29 -6
- data/bundler/lib/bundler/installer/parallel_installer.rb +5 -0
- data/bundler/lib/bundler/plugin.rb +10 -3
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/resolver.rb +2 -2
- data/bundler/lib/bundler/runtime.rb +8 -2
- data/bundler/lib/bundler/settings.rb +24 -3
- data/bundler/lib/bundler/settings/validator.rb +23 -0
- data/bundler/lib/bundler/shared_helpers.rb +19 -3
- data/bundler/lib/bundler/source.rb +9 -9
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.ronn +13 -2
- data/bundler/man/bundle-config.ronn +21 -0
- data/bundler/man/bundle-install.ronn +1 -1
- data/bundler/man/bundle-list.ronn +19 -1
- data/bundler/man/bundle-outdated.ronn +4 -0
- data/bundler/man/bundle-remove.ronn +23 -0
- data/bundler/man/bundle-update.ronn +1 -1
- data/lib/rubygems.rb +70 -96
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +12 -12
- data/lib/rubygems/bundler_version_finder.rb +3 -3
- data/lib/rubygems/command.rb +22 -15
- data/lib/rubygems/command_manager.rb +20 -11
- data/lib/rubygems/commands/build_command.rb +27 -8
- data/lib/rubygems/commands/cert_command.rb +45 -24
- data/lib/rubygems/commands/check_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +14 -7
- data/lib/rubygems/commands/contents_command.rb +14 -15
- data/lib/rubygems/commands/dependency_command.rb +17 -17
- data/lib/rubygems/commands/environment_command.rb +20 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -3
- data/lib/rubygems/commands/help_command.rb +12 -13
- data/lib/rubygems/commands/info_command.rb +33 -0
- data/lib/rubygems/commands/install_command.rb +21 -17
- data/lib/rubygems/commands/list_command.rb +0 -1
- data/lib/rubygems/commands/lock_command.rb +3 -4
- data/lib/rubygems/commands/open_command.rb +16 -10
- data/lib/rubygems/commands/owner_command.rb +20 -11
- data/lib/rubygems/commands/pristine_command.rb +23 -16
- data/lib/rubygems/commands/push_command.rb +17 -8
- data/lib/rubygems/commands/query_command.rb +24 -24
- data/lib/rubygems/commands/rdoc_command.rb +3 -4
- data/lib/rubygems/commands/search_command.rb +0 -1
- data/lib/rubygems/commands/server_command.rb +1 -2
- data/lib/rubygems/commands/setup_command.rb +78 -38
- data/lib/rubygems/commands/signin_command.rb +2 -1
- data/lib/rubygems/commands/signout_command.rb +2 -2
- data/lib/rubygems/commands/sources_command.rb +11 -12
- data/lib/rubygems/commands/specification_command.rb +7 -7
- data/lib/rubygems/commands/uninstall_command.rb +41 -19
- data/lib/rubygems/commands/unpack_command.rb +16 -7
- data/lib/rubygems/commands/update_command.rb +28 -23
- data/lib/rubygems/commands/which_command.rb +4 -5
- data/lib/rubygems/commands/yank_command.rb +1 -2
- data/lib/rubygems/compatibility.rb +1 -21
- data/lib/rubygems/config_file.rb +36 -36
- data/lib/rubygems/core_ext/kernel_require.rb +6 -6
- data/lib/rubygems/core_ext/kernel_warn.rb +45 -0
- data/lib/rubygems/defaults.rb +31 -12
- data/lib/rubygems/dependency.rb +14 -14
- data/lib/rubygems/dependency_installer.rb +29 -31
- data/lib/rubygems/dependency_list.rb +8 -9
- data/lib/rubygems/deprecate.rb +2 -3
- data/lib/rubygems/doctor.rb +5 -6
- data/lib/rubygems/errors.rb +3 -3
- data/lib/rubygems/exceptions.rb +11 -4
- data/lib/rubygems/ext.rb +0 -1
- data/lib/rubygems/ext/build_error.rb +0 -1
- data/lib/rubygems/ext/builder.rb +50 -23
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +2 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -7
- data/lib/rubygems/ext/rake_builder.rb +16 -18
- data/lib/rubygems/gem_runner.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +40 -13
- data/lib/rubygems/indexer.rb +19 -12
- data/lib/rubygems/install_default_message.rb +0 -1
- data/lib/rubygems/install_message.rb +0 -1
- data/lib/rubygems/install_update_options.rb +2 -28
- data/lib/rubygems/installer.rb +95 -75
- data/lib/rubygems/installer_test_case.rb +0 -14
- data/lib/rubygems/local_remote_options.rb +5 -4
- data/lib/rubygems/mock_gem_ui.rb +3 -4
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/package.rb +90 -73
- data/lib/rubygems/package/digest_io.rb +3 -4
- data/lib/rubygems/package/file_source.rb +3 -4
- data/lib/rubygems/package/io_source.rb +1 -2
- data/lib/rubygems/package/old.rb +8 -16
- data/lib/rubygems/package/source.rb +0 -1
- data/lib/rubygems/package/tar_header.rb +2 -2
- data/lib/rubygems/package/tar_reader.rb +2 -4
- data/lib/rubygems/package/tar_reader/entry.rb +20 -4
- data/lib/rubygems/package/tar_test_case.rb +2 -8
- data/lib/rubygems/package/tar_writer.rb +13 -15
- data/lib/rubygems/package_task.rb +0 -1
- data/lib/rubygems/path_support.rb +16 -6
- data/lib/rubygems/platform.rb +4 -5
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/rdoc.rb +0 -311
- data/lib/rubygems/remote_fetcher.rb +34 -48
- data/lib/rubygems/request.rb +16 -15
- data/lib/rubygems/request/connection_pools.rb +24 -13
- data/lib/rubygems/request/http_pool.rb +3 -4
- data/lib/rubygems/request/https_pool.rb +1 -3
- data/lib/rubygems/request_set.rb +52 -25
- data/lib/rubygems/request_set/gem_dependency_api.rb +36 -40
- data/lib/rubygems/request_set/lockfile.rb +12 -12
- data/lib/rubygems/request_set/lockfile/parser.rb +18 -29
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +9 -9
- data/lib/rubygems/requirement.rb +16 -16
- data/lib/rubygems/resolver.rb +10 -15
- data/lib/rubygems/resolver/activation_request.rb +6 -6
- data/lib/rubygems/resolver/api_set.rb +5 -6
- data/lib/rubygems/resolver/api_specification.rb +2 -3
- data/lib/rubygems/resolver/best_set.rb +5 -6
- data/lib/rubygems/resolver/composed_set.rb +5 -6
- data/lib/rubygems/resolver/conflict.rb +5 -5
- data/lib/rubygems/resolver/current_set.rb +1 -2
- data/lib/rubygems/resolver/dependency_request.rb +4 -4
- data/lib/rubygems/resolver/git_set.rb +5 -6
- data/lib/rubygems/resolver/git_specification.rb +4 -5
- data/lib/rubygems/resolver/index_set.rb +5 -6
- data/lib/rubygems/resolver/index_specification.rb +3 -4
- data/lib/rubygems/resolver/installed_specification.rb +3 -4
- data/lib/rubygems/resolver/installer_set.rb +12 -12
- data/lib/rubygems/resolver/local_specification.rb +1 -2
- data/lib/rubygems/resolver/lock_set.rb +5 -6
- data/lib/rubygems/resolver/lock_specification.rb +7 -8
- data/lib/rubygems/resolver/requirement_list.rb +1 -1
- data/lib/rubygems/resolver/set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +4 -5
- data/lib/rubygems/resolver/spec_specification.rb +1 -2
- data/lib/rubygems/resolver/specification.rb +10 -7
- data/lib/rubygems/resolver/stats.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +4 -5
- data/lib/rubygems/resolver/vendor_specification.rb +2 -3
- data/lib/rubygems/safe_yaml.rb +18 -10
- data/lib/rubygems/security.rb +21 -22
- data/lib/rubygems/security/policies.rb +1 -2
- data/lib/rubygems/security/policy.rb +25 -25
- data/lib/rubygems/security/signer.rb +72 -24
- data/lib/rubygems/security/trust_dir.rb +10 -10
- data/lib/rubygems/server.rb +21 -21
- data/lib/rubygems/source.rb +16 -25
- data/lib/rubygems/source/git.rb +9 -10
- data/lib/rubygems/source/installed.rb +3 -4
- data/lib/rubygems/source/local.rb +7 -7
- data/lib/rubygems/source/lock.rb +4 -4
- data/lib/rubygems/source/specific_file.rb +5 -5
- data/lib/rubygems/source/vendor.rb +2 -3
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/source_local.rb +0 -1
- data/lib/rubygems/spec_fetcher.rb +5 -6
- data/lib/rubygems/specification.rb +199 -536
- data/lib/rubygems/specification_policy.rb +407 -0
- data/lib/rubygems/ssl_certs/{rubygems.org → index.rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/stub_specification.rb +11 -15
- data/lib/rubygems/test_case.rb +141 -66
- data/lib/rubygems/test_utilities.rb +20 -35
- data/lib/rubygems/text.rb +6 -6
- data/lib/rubygems/uninstaller.rb +37 -26
- data/lib/rubygems/uri_formatter.rb +1 -2
- data/lib/rubygems/user_interaction.rb +38 -93
- data/lib/rubygems/util.rb +20 -14
- data/lib/rubygems/util/licenses.rb +27 -1
- data/lib/rubygems/util/list.rb +1 -1
- data/lib/rubygems/validator.rb +4 -5
- data/lib/rubygems/version.rb +15 -15
- data/lib/rubygems/version_option.rb +2 -3
- data/rubygems-update.gemspec +43 -0
- data/setup.rb +2 -8
- data/test/rubygems/rubygems_plugin.rb +0 -1
- data/test/rubygems/simple_gem.rb +1 -1
- data/test/rubygems/test_bundled_ca.rb +4 -7
- data/test/rubygems/test_config.rb +7 -2
- data/test/rubygems/test_gem.rb +161 -130
- data/test/rubygems/test_gem_command.rb +0 -1
- data/test/rubygems/test_gem_command_manager.rb +8 -3
- data/test/rubygems/test_gem_commands_build_command.rb +219 -15
- data/test/rubygems/test_gem_commands_cert_command.rb +69 -8
- data/test/rubygems/test_gem_commands_check_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +27 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -2
- data/test/rubygems/test_gem_commands_dependency_command.rb +33 -34
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -1
- data/test/rubygems/test_gem_commands_help_command.rb +7 -4
- data/test/rubygems/test_gem_commands_info_command.rb +44 -0
- data/test/rubygems/test_gem_commands_install_command.rb +79 -12
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -1
- data/test/rubygems/test_gem_commands_open_command.rb +29 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +93 -57
- data/test/rubygems/test_gem_commands_pristine_command.rb +65 -30
- data/test/rubygems/test_gem_commands_push_command.rb +39 -0
- data/test/rubygems/test_gem_commands_query_command.rb +102 -100
- data/test/rubygems/test_gem_commands_search_command.rb +0 -1
- data/test/rubygems/test_gem_commands_server_command.rb +0 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +39 -8
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -1
- data/test/rubygems/test_gem_commands_specification_command.rb +2 -3
- data/test/rubygems/test_gem_commands_stale_command.rb +3 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +81 -7
- data/test/rubygems/test_gem_commands_unpack_command.rb +17 -1
- data/test/rubygems/test_gem_commands_update_command.rb +19 -2
- data/test/rubygems/test_gem_commands_which_command.rb +0 -1
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -1
- data/test/rubygems/test_gem_config_file.rb +4 -2
- data/test/rubygems/test_gem_dependency.rb +0 -1
- data/test/rubygems/test_gem_dependency_installer.rb +8 -5
- data/test/rubygems/test_gem_dependency_list.rb +6 -7
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -1
- data/test/rubygems/test_gem_doctor.rb +1 -2
- data/test/rubygems/test_gem_ext_builder.rb +10 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +3 -3
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -9
- data/test/rubygems/test_gem_ext_rake_builder.rb +20 -5
- data/test/rubygems/test_gem_gem_runner.rb +0 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +32 -6
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -1
- data/test/rubygems/test_gem_indexer.rb +1 -2
- data/test/rubygems/test_gem_install_update_options.rb +1 -20
- data/test/rubygems/test_gem_installer.rb +69 -203
- data/test/rubygems/test_gem_local_remote_options.rb +3 -3
- data/test/rubygems/test_gem_name_tuple.rb +0 -1
- data/test/rubygems/test_gem_package.rb +59 -50
- data/test/rubygems/test_gem_package_old.rb +0 -1
- data/test/rubygems/test_gem_package_tar_header.rb +1 -2
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +11 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +40 -7
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +28 -11
- data/test/rubygems/test_gem_platform.rb +4 -5
- data/test/rubygems/test_gem_rdoc.rb +1 -2
- data/test/rubygems/test_gem_remote_fetcher.rb +111 -130
- data/test/rubygems/test_gem_request.rb +5 -5
- data/test/rubygems/test_gem_request_connection_pools.rb +24 -3
- data/test/rubygems/test_gem_request_set.rb +5 -5
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +2 -7
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -2
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +18 -4
- data/test/rubygems/test_gem_resolver.rb +13 -17
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +2 -3
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -1
- data/test/rubygems/test_gem_security.rb +1 -3
- data/test/rubygems/test_gem_security_policy.rb +4 -5
- data/test/rubygems/test_gem_security_signer.rb +4 -3
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -2
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +0 -13
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
- data/test/rubygems/test_gem_source_git.rb +0 -1
- data/test/rubygems/test_gem_source_installed.rb +0 -1
- data/test/rubygems/test_gem_source_lock.rb +0 -1
- data/test/rubygems/test_gem_source_vendor.rb +0 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -1
- data/test/rubygems/test_gem_specification.rb +334 -198
- data/test/rubygems/test_gem_stream_ui.rb +13 -30
- data/test/rubygems/test_gem_stub_specification.rb +0 -2
- data/test/rubygems/test_gem_text.rb +4 -5
- data/test/rubygems/test_gem_uninstaller.rb +21 -1
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -1
- data/test/rubygems/test_gem_uri_formatter.rb +0 -1
- data/test/rubygems/test_gem_util.rb +6 -11
- data/test/rubygems/test_gem_validator.rb +0 -1
- data/test/rubygems/test_gem_version.rb +11 -11
- data/test/rubygems/test_gem_version_option.rb +0 -1
- data/test/rubygems/test_remote_fetch_error.rb +0 -1
- data/test/rubygems/test_require.rb +67 -52
- data/util/CL2notes +1 -2
- data/util/ci +15 -12
- data/util/create_certs.rb +6 -7
- data/util/create_encrypted_key.rb +0 -1
- data/util/patch_with_prs.rb +1 -1
- data/util/rubocop +8 -0
- data/util/update_bundled_ca_certificates.rb +15 -14
- data/util/update_changelog.rb +1 -1
- metadata +67 -59
- data/.autotest +0 -71
- data/.document +0 -5
- data/CONTRIBUTING.rdoc +0 -130
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/POLICIES.rdoc +0 -74
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
@@ -236,5 +236,31 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
236
236
|
refute_path_exists d_1.gem_dir
|
237
237
|
refute_path_exists e_1.gem_dir
|
238
238
|
end
|
239
|
-
end
|
240
239
|
|
240
|
+
def test_execute_user_install
|
241
|
+
c_1, = util_gem 'c', '1.0'
|
242
|
+
c_2, = util_gem 'c', '1.1'
|
243
|
+
|
244
|
+
d_1, = util_gem 'd', '1.0'
|
245
|
+
d_2, = util_gem 'd', '1.1'
|
246
|
+
|
247
|
+
c_1 = install_gem c_1, :user_install => true # pick up user install path
|
248
|
+
c_2 = install_gem c_2, :user_install => true # pick up user install path
|
249
|
+
|
250
|
+
d_1 = install_gem d_1
|
251
|
+
d_2 = install_gem d_2
|
252
|
+
|
253
|
+
Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
|
254
|
+
|
255
|
+
@cmd.handle_options %w[--user-install]
|
256
|
+
@cmd.options[:args] = []
|
257
|
+
|
258
|
+
@cmd.execute
|
259
|
+
|
260
|
+
refute_path_exists c_1.gem_dir
|
261
|
+
assert_path_exists c_2.gem_dir
|
262
|
+
|
263
|
+
assert_path_exists d_1.gem_dir
|
264
|
+
assert_path_exists d_2.gem_dir
|
265
|
+
end
|
266
|
+
end
|
@@ -10,7 +10,7 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|
10
10
|
@cmd = Gem::Commands::ContentsCommand.new
|
11
11
|
end
|
12
12
|
|
13
|
-
def gem
|
13
|
+
def gem(name, version = 2)
|
14
14
|
spec = quick_gem name, version do |gem|
|
15
15
|
gem.files = %W[lib/#{name}.rb Rakefile]
|
16
16
|
end
|
@@ -237,4 +237,3 @@ lib/foo.rb
|
|
237
237
|
end
|
238
238
|
|
239
239
|
end
|
240
|
-
|
@@ -6,7 +6,7 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
|
|
6
6
|
|
7
7
|
def setup
|
8
8
|
super
|
9
|
-
|
9
|
+
@stub_ui = Gem::MockGemUi.new
|
10
10
|
@cmd = Gem::Commands::DependencyCommand.new
|
11
11
|
@cmd.options[:domain] = :local
|
12
12
|
end
|
@@ -19,17 +19,17 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
|
|
19
19
|
|
20
20
|
@cmd.options[:args] = %w[foo]
|
21
21
|
|
22
|
-
use_ui @
|
22
|
+
use_ui @stub_ui do
|
23
23
|
@cmd.execute
|
24
24
|
end
|
25
25
|
|
26
26
|
assert_equal "Gem foo-2\n bar (> 1)\n baz (> 1)\n\n",
|
27
|
-
@
|
28
|
-
assert_equal '', @
|
27
|
+
@stub_ui.output
|
28
|
+
assert_equal '', @stub_ui.error
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_execute_no_args
|
32
|
-
install_specs
|
32
|
+
install_specs util_spec 'x', '2'
|
33
33
|
|
34
34
|
spec_fetcher do |fetcher|
|
35
35
|
fetcher.spec 'a', 1
|
@@ -40,7 +40,7 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
|
|
40
40
|
|
41
41
|
@cmd.options[:args] = []
|
42
42
|
|
43
|
-
use_ui @
|
43
|
+
use_ui @stub_ui do
|
44
44
|
@cmd.execute
|
45
45
|
end
|
46
46
|
|
@@ -58,21 +58,21 @@ Gem x-2
|
|
58
58
|
|
59
59
|
EOF
|
60
60
|
|
61
|
-
assert_equal expected, @
|
62
|
-
assert_equal '', @
|
61
|
+
assert_equal expected, @stub_ui.output
|
62
|
+
assert_equal '', @stub_ui.error
|
63
63
|
end
|
64
64
|
|
65
65
|
def test_execute_no_match
|
66
66
|
@cmd.options[:args] = %w[foo]
|
67
67
|
|
68
68
|
assert_raises Gem::MockGemUi::TermError do
|
69
|
-
use_ui @
|
69
|
+
use_ui @stub_ui do
|
70
70
|
@cmd.execute
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
assert_equal "No gems found matching foo (>= 0)\n", @
|
75
|
-
assert_equal '', @
|
74
|
+
assert_equal "No gems found matching foo (>= 0)\n", @stub_ui.output
|
75
|
+
assert_equal '', @stub_ui.error
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_execute_pipe_format
|
@@ -85,12 +85,12 @@ Gem x-2
|
|
85
85
|
@cmd.options[:args] = %w[foo]
|
86
86
|
@cmd.options[:pipe_format] = true
|
87
87
|
|
88
|
-
use_ui @
|
88
|
+
use_ui @stub_ui do
|
89
89
|
@cmd.execute
|
90
90
|
end
|
91
91
|
|
92
|
-
assert_equal "bar --version '> 1'\n", @
|
93
|
-
assert_equal '', @
|
92
|
+
assert_equal "bar --version '> 1'\n", @stub_ui.output
|
93
|
+
assert_equal '', @stub_ui.error
|
94
94
|
end
|
95
95
|
|
96
96
|
def test_execute_regexp
|
@@ -103,7 +103,7 @@ Gem x-2
|
|
103
103
|
|
104
104
|
@cmd.options[:args] = %w[/[ab]/]
|
105
105
|
|
106
|
-
use_ui @
|
106
|
+
use_ui @stub_ui do
|
107
107
|
@cmd.execute
|
108
108
|
end
|
109
109
|
|
@@ -118,8 +118,8 @@ Gem b-2
|
|
118
118
|
|
119
119
|
EOF
|
120
120
|
|
121
|
-
assert_equal expected, @
|
122
|
-
assert_equal '', @
|
121
|
+
assert_equal expected, @stub_ui.output
|
122
|
+
assert_equal '', @stub_ui.error
|
123
123
|
end
|
124
124
|
|
125
125
|
def test_execute_reverse
|
@@ -135,7 +135,7 @@ Gem b-2
|
|
135
135
|
@cmd.options[:args] = %w[foo]
|
136
136
|
@cmd.options[:reverse_dependencies] = true
|
137
137
|
|
138
|
-
use_ui @
|
138
|
+
use_ui @stub_ui do
|
139
139
|
@cmd.execute
|
140
140
|
end
|
141
141
|
|
@@ -147,8 +147,8 @@ Gem foo-2
|
|
147
147
|
|
148
148
|
EOF
|
149
149
|
|
150
|
-
assert_equal expected, @
|
151
|
-
assert_equal '', @
|
150
|
+
assert_equal expected, @stub_ui.output
|
151
|
+
assert_equal '', @stub_ui.error
|
152
152
|
end
|
153
153
|
|
154
154
|
def test_execute_reverse_remote
|
@@ -157,7 +157,7 @@ Gem foo-2
|
|
157
157
|
@cmd.options[:domain] = :remote
|
158
158
|
|
159
159
|
assert_raises Gem::MockGemUi::TermError do
|
160
|
-
use_ui @
|
160
|
+
use_ui @stub_ui do
|
161
161
|
@cmd.execute
|
162
162
|
end
|
163
163
|
end
|
@@ -166,12 +166,12 @@ Gem foo-2
|
|
166
166
|
ERROR: Only reverse dependencies for local gems are supported.
|
167
167
|
EOF
|
168
168
|
|
169
|
-
assert_equal '', @
|
170
|
-
assert_equal expected, @
|
169
|
+
assert_equal '', @stub_ui.output
|
170
|
+
assert_equal expected, @stub_ui.error
|
171
171
|
end
|
172
172
|
|
173
173
|
def test_execute_remote
|
174
|
-
install_specs
|
174
|
+
install_specs util_spec 'bar', '2'
|
175
175
|
|
176
176
|
spec_fetcher do |fetcher|
|
177
177
|
fetcher.spec 'foo', 2, 'bar' => '> 1'
|
@@ -180,12 +180,12 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|
180
180
|
@cmd.options[:args] = %w[foo]
|
181
181
|
@cmd.options[:domain] = :remote
|
182
182
|
|
183
|
-
use_ui @
|
183
|
+
use_ui @stub_ui do
|
184
184
|
@cmd.execute
|
185
185
|
end
|
186
186
|
|
187
|
-
assert_equal "Gem foo-2\n bar (> 1)\n\n", @
|
188
|
-
assert_equal '', @
|
187
|
+
assert_equal "Gem foo-2\n bar (> 1)\n\n", @stub_ui.output
|
188
|
+
assert_equal '', @stub_ui.error
|
189
189
|
end
|
190
190
|
|
191
191
|
def test_execute_remote_version
|
@@ -201,12 +201,12 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|
201
201
|
@cmd.options[:domain] = :remote
|
202
202
|
@cmd.options[:version] = req '= 1'
|
203
203
|
|
204
|
-
use_ui @
|
204
|
+
use_ui @stub_ui do
|
205
205
|
@cmd.execute
|
206
206
|
end
|
207
207
|
|
208
|
-
assert_equal "Gem a-1\n\n", @
|
209
|
-
assert_equal '', @
|
208
|
+
assert_equal "Gem a-1\n\n", @stub_ui.output
|
209
|
+
assert_equal '', @stub_ui.error
|
210
210
|
end
|
211
211
|
|
212
212
|
def test_execute_prerelease
|
@@ -218,13 +218,12 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|
218
218
|
@cmd.options[:domain] = :remote
|
219
219
|
@cmd.options[:prerelease] = true
|
220
220
|
|
221
|
-
use_ui @
|
221
|
+
use_ui @stub_ui do
|
222
222
|
@cmd.execute
|
223
223
|
end
|
224
224
|
|
225
|
-
assert_equal "Gem a-2.a\n\n", @
|
226
|
-
assert_equal '', @
|
225
|
+
assert_equal "Gem a-2.a\n\n", @stub_ui.output
|
226
|
+
assert_equal '', @stub_ui.error
|
227
227
|
end
|
228
228
|
|
229
229
|
end
|
230
|
-
|
@@ -29,6 +29,7 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase
|
|
29
29
|
assert_match %r|RUBYGEMS PREFIX: |, @ui.output
|
30
30
|
assert_match %r|RUBY EXECUTABLE:.*#{RbConfig::CONFIG['ruby_install_name']}|,
|
31
31
|
@ui.output
|
32
|
+
assert_match %r|GIT EXECUTABLE: #{@cmd.send(:git_path)}|, @ui.output
|
32
33
|
assert_match %r|SYSTEM CONFIGURATION DIRECTORY:|, @ui.output
|
33
34
|
assert_match %r|EXECUTABLE DIRECTORY:|, @ui.output
|
34
35
|
assert_match %r|RUBYGEMS PLATFORMS:|, @ui.output
|
@@ -7,13 +7,16 @@ require "rubygems/command_manager"
|
|
7
7
|
require File.expand_path('../rubygems_plugin', __FILE__)
|
8
8
|
|
9
9
|
class TestGemCommandsHelpCommand < Gem::TestCase
|
10
|
+
# previously this was calc'd in setup, but 1.8.7 had
|
11
|
+
# intermittent failures, but no issues with above require
|
12
|
+
PLUGIN = File.expand_path('../rubygems_plugin.rb', __FILE__)
|
13
|
+
|
10
14
|
def setup
|
11
15
|
super
|
12
16
|
|
13
17
|
@cmd = Gem::Commands::HelpCommand.new
|
14
18
|
|
15
|
-
load
|
16
|
-
Gem::Commands.const_defined? :InterruptCommand
|
19
|
+
load PLUGIN unless Gem::Commands.const_defined? :InterruptCommand
|
17
20
|
end
|
18
21
|
|
19
22
|
def test_gem_help_bad
|
@@ -45,7 +48,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
|
|
45
48
|
assert_match(/\s+#{cmd}\s+\S+/, out)
|
46
49
|
end
|
47
50
|
|
48
|
-
if defined?(OpenSSL::SSL)
|
51
|
+
if defined?(OpenSSL::SSL)
|
49
52
|
assert_empty err
|
50
53
|
|
51
54
|
refute_match 'No command found for ', out
|
@@ -61,7 +64,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
|
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
64
|
-
def util_gem
|
67
|
+
def util_gem(*args)
|
65
68
|
@cmd.options[:args] = args
|
66
69
|
|
67
70
|
use_ui @ui do
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'rubygems/test_case'
|
3
|
+
require 'rubygems/commands/info_command'
|
4
|
+
|
5
|
+
class TestGemCommandsInfoCommand < Gem::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
super
|
9
|
+
|
10
|
+
@cmd = Gem::Commands::InfoCommand.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def gem(name, version = "1.0")
|
14
|
+
spec = quick_gem name do |gem|
|
15
|
+
gem.summary = "test gem"
|
16
|
+
gem.homepage = "https://github.com/rubygems/rubygems"
|
17
|
+
gem.files = %W[lib/#{name}.rb Rakefile]
|
18
|
+
gem.authors = ["Colby", "Jack"]
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.version = version
|
21
|
+
end
|
22
|
+
write_file File.join(*%W[gems #{spec.full_name} lib #{name}.rb])
|
23
|
+
write_file File.join(*%W[gems #{spec.full_name} Rakefile])
|
24
|
+
spec
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_execute
|
28
|
+
@gem = gem "foo", "1.0.0"
|
29
|
+
|
30
|
+
@cmd.handle_options %w[foo]
|
31
|
+
|
32
|
+
use_ui @ui do
|
33
|
+
@cmd.execute
|
34
|
+
end
|
35
|
+
|
36
|
+
assert_match %r%#{@gem.name} \(#{@gem.version}\)\n%, @ui.output
|
37
|
+
assert_match %r%Authors: #{@gem.authors.join(', ')}\n%, @ui.output
|
38
|
+
assert_match %r%Homepage: #{@gem.homepage}\n%, @ui.output
|
39
|
+
assert_match %r%License: #{@gem.license}\n%, @ui.output
|
40
|
+
assert_match %r%Installed at: #{@gem.base_dir}\n%, @ui.output
|
41
|
+
assert_match %r%#{@gem.summary}\n%, @ui.output
|
42
|
+
assert_match "", @ui.error
|
43
|
+
end
|
44
|
+
end
|
@@ -55,7 +55,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
55
55
|
a2_pre = specs['a-2.a']
|
56
56
|
|
57
57
|
@cmd.handle_options [a2_pre.name, '--version', a2_pre.version.to_s,
|
58
|
-
"--no-
|
58
|
+
"--no-document"]
|
59
59
|
assert @cmd.options[:prerelease]
|
60
60
|
assert @cmd.options[:version].satisfied_by?(a2_pre.version)
|
61
61
|
|
@@ -201,6 +201,38 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
201
201
|
assert_match(/ould not find a valid gem 'nonexistent'/, @ui.error)
|
202
202
|
end
|
203
203
|
|
204
|
+
def test_execute_dependency_nonexistent
|
205
|
+
spec_fetcher do |fetcher|
|
206
|
+
fetcher.spec 'foo', 2, 'bar' => '0.5'
|
207
|
+
end
|
208
|
+
|
209
|
+
@cmd.options[:args] = ['foo']
|
210
|
+
|
211
|
+
use_ui @ui do
|
212
|
+
e = assert_raises Gem::MockGemUi::TermError do
|
213
|
+
@cmd.execute
|
214
|
+
end
|
215
|
+
|
216
|
+
assert_equal 2, e.exit_code
|
217
|
+
end
|
218
|
+
|
219
|
+
expected = <<-EXPECTED
|
220
|
+
ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in any repository
|
221
|
+
EXPECTED
|
222
|
+
|
223
|
+
assert_equal expected, @ui.error
|
224
|
+
end
|
225
|
+
|
226
|
+
def test_execute_http_proxy
|
227
|
+
use_ui @ui do
|
228
|
+
e = assert_raises ArgumentError, @ui.error do
|
229
|
+
@cmd.handle_options %w[-p=foo.bar.com]
|
230
|
+
end
|
231
|
+
|
232
|
+
assert_match "Invalid uri scheme for =foo.bar.com\nPreface URLs with one of [\"http://\", \"https://\", \"file://\", \"s3://\"]", e.message
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
204
236
|
def test_execute_bad_source
|
205
237
|
spec_fetcher
|
206
238
|
|
@@ -361,6 +393,23 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
361
393
|
assert_equal %w[a-2.a], @cmd.installed_specs.map { |spec| spec.full_name }
|
362
394
|
end
|
363
395
|
|
396
|
+
def test_execute_with_version_specified_by_colon
|
397
|
+
spec_fetcher do |fetcher|
|
398
|
+
fetcher.download 'a', 1
|
399
|
+
fetcher.download 'a', 2
|
400
|
+
end
|
401
|
+
|
402
|
+
@cmd.options[:args] = %w[a:1]
|
403
|
+
|
404
|
+
use_ui @ui do
|
405
|
+
assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
|
406
|
+
@cmd.execute
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
assert_equal %w[a-1], @cmd.installed_specs.map { |spec| spec.full_name }
|
411
|
+
end
|
412
|
+
|
364
413
|
def test_execute_prerelease_skipped_when_non_pre_available
|
365
414
|
spec_fetcher do |fetcher|
|
366
415
|
fetcher.gem 'a', '2.pre'
|
@@ -380,7 +429,6 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
380
429
|
end
|
381
430
|
|
382
431
|
def test_execute_rdoc
|
383
|
-
skip if RUBY_VERSION <= "1.8.7"
|
384
432
|
specs = spec_fetcher do |fetcher|
|
385
433
|
fetcher.gem 'a', 2
|
386
434
|
end
|
@@ -417,27 +465,26 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
417
465
|
end
|
418
466
|
|
419
467
|
def test_execute_rdoc_with_path
|
420
|
-
skip if RUBY_VERSION <= "1.8.7"
|
421
468
|
specs = spec_fetcher do |fetcher|
|
422
469
|
fetcher.gem 'a', 2
|
423
470
|
end
|
424
|
-
|
471
|
+
|
425
472
|
Gem.done_installing(&Gem::RDoc.method(:generation_hook))
|
426
|
-
|
473
|
+
|
427
474
|
@cmd.options[:document] = %w[rdoc ri]
|
428
475
|
@cmd.options[:domain] = :local
|
429
476
|
@cmd.options[:install_dir] = 'whatever'
|
430
|
-
|
477
|
+
|
431
478
|
a2 = specs['a-2']
|
432
479
|
FileUtils.mv a2.cache_file, @tempdir
|
433
|
-
|
480
|
+
|
434
481
|
@cmd.options[:args] = %w[a]
|
435
|
-
|
482
|
+
|
436
483
|
use_ui @ui do
|
437
484
|
# Don't use Dir.chdir with a block, it warnings a lot because
|
438
485
|
# of a downstream Dir.chdir with a block
|
439
486
|
old = Dir.getwd
|
440
|
-
|
487
|
+
|
441
488
|
begin
|
442
489
|
Dir.chdir @tempdir
|
443
490
|
assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
|
@@ -447,9 +494,9 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
447
494
|
Dir.chdir old
|
448
495
|
end
|
449
496
|
end
|
450
|
-
|
497
|
+
|
451
498
|
wait_for_child_process_to_exit
|
452
|
-
|
499
|
+
|
453
500
|
assert_path_exists 'whatever/doc/a-2', 'documentation not installed'
|
454
501
|
end
|
455
502
|
|
@@ -618,12 +665,32 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
618
665
|
|
619
666
|
assert_empty @cmd.installed_specs
|
620
667
|
|
621
|
-
msg = "ERROR: Can't use --version
|
668
|
+
msg = "ERROR: Can't use --version with multiple gems. You can specify multiple gems with" \
|
669
|
+
" version requirements using `gem install 'my_gem:1.0.0' 'my_other_gem:~>2.0.0'`"
|
622
670
|
|
623
671
|
assert_empty @ui.output
|
624
672
|
assert_equal msg, @ui.error.chomp
|
625
673
|
end
|
626
674
|
|
675
|
+
def test_execute_two_version_specified_by_colon
|
676
|
+
spec_fetcher do |fetcher|
|
677
|
+
fetcher.gem 'a', 1
|
678
|
+
fetcher.gem 'a', 2
|
679
|
+
fetcher.gem 'b', 1
|
680
|
+
fetcher.gem 'b', 2
|
681
|
+
end
|
682
|
+
|
683
|
+
@cmd.options[:args] = %w[a:1 b:1]
|
684
|
+
|
685
|
+
use_ui @ui do
|
686
|
+
assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
|
687
|
+
@cmd.execute
|
688
|
+
end
|
689
|
+
end
|
690
|
+
|
691
|
+
assert_equal %w[a-1 b-1], @cmd.installed_specs.map { |spec| spec.full_name }
|
692
|
+
end
|
693
|
+
|
627
694
|
def test_execute_conservative
|
628
695
|
spec_fetcher do |fetcher|
|
629
696
|
fetcher.download 'b', 2
|