rubygems-update 3.3.18 → 3.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +65 -0
- data/Manifest.txt +11 -0
- data/bin/gem +2 -2
- data/bin/update_rubygems +4 -4
- data/bundler/CHANGELOG.md +100 -0
- data/bundler/UPGRADING.md +11 -4
- data/bundler/bundler.gemspec +6 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/common.rb +1 -0
- data/bundler/lib/bundler/cli/install.rb +5 -2
- data/bundler/lib/bundler/cli/outdated.rb +12 -3
- data/bundler/lib/bundler/cli/platform.rb +1 -1
- data/bundler/lib/bundler/cli.rb +7 -4
- data/bundler/lib/bundler/current_ruby.rb +14 -5
- data/bundler/lib/bundler/definition.rb +102 -31
- data/bundler/lib/bundler/dependency.rb +18 -85
- data/bundler/lib/bundler/dsl.rb +2 -2
- data/bundler/lib/bundler/endpoint_specification.rb +2 -13
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher.rb +6 -6
- data/bundler/lib/bundler/gem_helpers.rb +7 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +8 -18
- data/bundler/lib/bundler/index.rb +10 -12
- data/bundler/lib/bundler/injector.rb +2 -1
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer/standalone.rb +1 -1
- data/bundler/lib/bundler/installer.rb +14 -12
- data/bundler/lib/bundler/lazy_specification.rb +30 -23
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/man/bundle-add.1 +6 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +7 -1
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +7 -0
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +25 -6
- data/bundler/lib/bundler/man/bundle-config.1.ronn +16 -6
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +5 -2
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/bundler/lib/bundler/man/bundle-install.1 +5 -1
- data/bundler/lib/bundler/man/bundle-install.1.ronn +6 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +16 -6
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -1
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/bundler/lib/bundler/man/bundle.1 +15 -10
- data/bundler/lib/bundler/man/bundle.1.ronn +12 -7
- data/bundler/lib/bundler/man/gemfile.5 +23 -47
- data/bundler/lib/bundler/man/gemfile.5.ronn +32 -43
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/plugin.rb +2 -0
- data/bundler/lib/bundler/remote_specification.rb +6 -11
- data/bundler/lib/bundler/resolver/base.rb +50 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +11 -8
- data/bundler/lib/bundler/resolver.rb +95 -90
- data/bundler/lib/bundler/ruby_dsl.rb +1 -1
- data/bundler/lib/bundler/ruby_version.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +52 -1
- data/bundler/lib/bundler/rubygems_gem_installer.rb +19 -12
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/source/metadata.rb +1 -1
- data/bundler/lib/bundler/source_list.rb +4 -0
- data/bundler/lib/bundler/spec_set.rb +48 -33
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +3 -3
- data/lib/rubygems/available_set.rb +3 -3
- data/lib/rubygems/basic_specification.rb +4 -4
- data/lib/rubygems/command.rb +25 -25
- data/lib/rubygems/command_manager.rb +9 -9
- data/lib/rubygems/commands/build_command.rb +8 -8
- data/lib/rubygems/commands/cert_command.rb +33 -33
- data/lib/rubygems/commands/check_command.rb +20 -20
- data/lib/rubygems/commands/cleanup_command.rb +17 -17
- data/lib/rubygems/commands/contents_command.rb +13 -13
- data/lib/rubygems/commands/dependency_command.rb +16 -16
- data/lib/rubygems/commands/environment_command.rb +5 -5
- data/lib/rubygems/commands/fetch_command.rb +8 -8
- data/lib/rubygems/commands/generate_index_command.rb +17 -17
- data/lib/rubygems/commands/help_command.rb +3 -3
- data/lib/rubygems/commands/info_command.rb +3 -3
- data/lib/rubygems/commands/install_command.rb +20 -20
- data/lib/rubygems/commands/list_command.rb +3 -3
- data/lib/rubygems/commands/lock_command.rb +4 -4
- data/lib/rubygems/commands/mirror_command.rb +3 -3
- data/lib/rubygems/commands/open_command.rb +9 -9
- data/lib/rubygems/commands/outdated_command.rb +5 -5
- data/lib/rubygems/commands/owner_command.rb +11 -11
- data/lib/rubygems/commands/pristine_command.rb +36 -36
- data/lib/rubygems/commands/push_command.rb +8 -8
- data/lib/rubygems/commands/query_command.rb +8 -8
- data/lib/rubygems/commands/rdoc_command.rb +17 -17
- data/lib/rubygems/commands/search_command.rb +3 -3
- data/lib/rubygems/commands/server_command.rb +3 -3
- data/lib/rubygems/commands/setup_command.rb +96 -106
- data/lib/rubygems/commands/signin_command.rb +9 -9
- data/lib/rubygems/commands/signout_command.rb +7 -7
- data/lib/rubygems/commands/sources_command.rb +21 -21
- data/lib/rubygems/commands/specification_command.rb +13 -13
- data/lib/rubygems/commands/stale_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +40 -40
- data/lib/rubygems/commands/unpack_command.rb +12 -12
- data/lib/rubygems/commands/update_command.rb +40 -56
- data/lib/rubygems/commands/which_command.rb +7 -7
- data/lib/rubygems/commands/yank_command.rb +11 -11
- data/lib/rubygems/config_file.rb +21 -21
- data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
- data/lib/rubygems/core_ext/tcpsocket_init.rb +1 -1
- data/lib/rubygems/defaults.rb +16 -16
- data/lib/rubygems/dependency.rb +9 -9
- data/lib/rubygems/dependency_installer.rb +13 -13
- data/lib/rubygems/dependency_list.rb +6 -6
- data/lib/rubygems/doctor.rb +18 -18
- data/lib/rubygems/errors.rb +2 -2
- data/lib/rubygems/exceptions.rb +5 -5
- data/lib/rubygems/ext/build_error.rb +1 -1
- data/lib/rubygems/ext/builder.rb +16 -16
- data/lib/rubygems/ext/cargo_builder.rb +7 -7
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -8
- data/lib/rubygems/ext/rake_builder.rb +3 -3
- data/lib/rubygems/ext.rb +7 -7
- data/lib/rubygems/gem_runner.rb +5 -5
- data/lib/rubygems/gemcutter_utilities.rb +31 -28
- data/lib/rubygems/indexer.rb +27 -27
- data/lib/rubygems/install_default_message.rb +2 -2
- data/lib/rubygems/install_message.rb +2 -2
- data/lib/rubygems/install_update_options.rb +55 -55
- data/lib/rubygems/installer.rb +32 -40
- data/lib/rubygems/installer_uninstaller_utils.rb +2 -2
- data/lib/rubygems/local_remote_options.rb +18 -20
- data/lib/rubygems/mock_gem_ui.rb +2 -2
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/optparse.rb +1 -1
- data/lib/rubygems/package/file_source.rb +2 -2
- data/lib/rubygems/package/old.rb +8 -8
- data/lib/rubygems/package/tar_header.rb +50 -50
- data/lib/rubygems/package/tar_reader/entry.rb +2 -2
- data/lib/rubygems/package/tar_reader.rb +1 -1
- data/lib/rubygems/package/tar_writer.rb +7 -7
- data/lib/rubygems/package.rb +54 -43
- data/lib/rubygems/package_task.rb +4 -4
- data/lib/rubygems/platform.rb +66 -55
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/query_utils.rb +35 -35
- data/lib/rubygems/rdoc.rb +2 -2
- data/lib/rubygems/remote_fetcher.rb +22 -22
- data/lib/rubygems/request/connection_pools.rb +4 -4
- data/lib/rubygems/request/http_pool.rb +1 -1
- data/lib/rubygems/request.rb +22 -22
- data/lib/rubygems/request_set/gem_dependency_api.rb +18 -18
- data/lib/rubygems/request_set/lockfile/parser.rb +26 -26
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +4 -4
- data/lib/rubygems/request_set/lockfile.rb +5 -5
- data/lib/rubygems/request_set.rb +17 -17
- data/lib/rubygems/requirement.rb +6 -6
- data/lib/rubygems/resolver/activation_request.rb +3 -3
- data/lib/rubygems/resolver/api_set.rb +4 -4
- data/lib/rubygems/resolver/api_specification.rb +6 -6
- data/lib/rubygems/resolver/best_set.rb +5 -5
- data/lib/rubygems/resolver/conflict.rb +10 -10
- data/lib/rubygems/resolver/dependency_request.rb +2 -2
- data/lib/rubygems/resolver/git_set.rb +2 -2
- data/lib/rubygems/resolver/git_specification.rb +6 -6
- data/lib/rubygems/resolver/index_set.rb +3 -3
- data/lib/rubygems/resolver/index_specification.rb +6 -5
- data/lib/rubygems/resolver/installed_specification.rb +4 -4
- data/lib/rubygems/resolver/installer_set.rb +11 -16
- data/lib/rubygems/resolver/local_specification.rb +2 -2
- data/lib/rubygems/resolver/lock_set.rb +4 -4
- data/lib/rubygems/resolver/lock_specification.rb +4 -4
- data/lib/rubygems/resolver/molinillo.rb +1 -1
- data/lib/rubygems/resolver/specification.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +1 -1
- data/lib/rubygems/resolver/vendor_specification.rb +3 -3
- data/lib/rubygems/resolver.rb +39 -39
- data/lib/rubygems/s3_uri_signer.rb +6 -6
- data/lib/rubygems/safe_yaml.rb +2 -2
- data/lib/rubygems/security/policies.rb +11 -11
- data/lib/rubygems/security/policy.rb +18 -18
- data/lib/rubygems/security/signer.rb +5 -5
- data/lib/rubygems/security/trust_dir.rb +3 -3
- data/lib/rubygems/security.rb +28 -28
- data/lib/rubygems/security_option.rb +5 -5
- data/lib/rubygems/source/git.rb +21 -21
- data/lib/rubygems/source/installed.rb +1 -1
- data/lib/rubygems/source/local.rb +2 -2
- data/lib/rubygems/source/specific_file.rb +1 -1
- data/lib/rubygems/source.rb +16 -16
- data/lib/rubygems/spec_fetcher.rb +9 -9
- data/lib/rubygems/specification.rb +63 -62
- data/lib/rubygems/specification_policy.rb +15 -15
- data/lib/rubygems/stub_specification.rb +5 -5
- data/lib/rubygems/tsort.rb +1 -1
- data/lib/rubygems/uninstaller.rb +18 -18
- data/lib/rubygems/uri.rb +4 -4
- data/lib/rubygems/uri_formatter.rb +1 -1
- data/lib/rubygems/user_interaction.rb +33 -19
- data/lib/rubygems/util/licenses.rb +3 -3
- data/lib/rubygems/util.rb +10 -10
- data/lib/rubygems/validator.rb +5 -5
- data/lib/rubygems/version.rb +15 -9
- data/lib/rubygems/version_option.rb +3 -3
- data/lib/rubygems.rb +62 -61
- data/rubygems-update.gemspec +2 -2
- data/setup.rb +9 -9
- data/test/rubygems/helper.rb +132 -134
- data/test/rubygems/installer_test_case.rb +13 -13
- data/test/rubygems/package/tar_test_case.rb +2 -2
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
- data/test/rubygems/rubygems_plugin.rb +2 -2
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +4 -4
- data/test/rubygems/test_bundled_ca.rb +10 -10
- data/test/rubygems/test_config.rb +3 -3
- data/test/rubygems/test_deprecate.rb +3 -3
- data/test/rubygems/test_exit.rb +2 -2
- data/test/rubygems/test_gem.rb +342 -342
- data/test/rubygems/test_gem_available_set.rb +21 -21
- data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
- data/test/rubygems/test_gem_command.rb +44 -44
- data/test/rubygems/test_gem_command_manager.rb +29 -29
- data/test/rubygems/test_gem_commands_build_command.rb +63 -63
- data/test/rubygems/test_gem_commands_cert_command.rb +97 -99
- data/test/rubygems/test_gem_commands_check_command.rb +4 -4
- data/test/rubygems/test_gem_commands_cleanup_command.rb +40 -40
- data/test/rubygems/test_gem_commands_contents_command.rb +27 -27
- data/test/rubygems/test_gem_commands_dependency_command.rb +36 -36
- data/test/rubygems/test_gem_commands_environment_command.rb +16 -16
- data/test/rubygems/test_gem_commands_fetch_command.rb +37 -37
- data/test/rubygems/test_gem_commands_generate_index_command.rb +7 -7
- data/test/rubygems/test_gem_commands_help_command.rb +13 -13
- data/test/rubygems/test_gem_commands_info_command.rb +28 -2
- data/test/rubygems/test_gem_commands_install_command.rb +131 -131
- data/test/rubygems/test_gem_commands_list_command.rb +4 -4
- data/test/rubygems/test_gem_commands_lock_command.rb +10 -10
- data/test/rubygems/test_gem_commands_mirror.rb +2 -2
- data/test/rubygems/test_gem_commands_open_command.rb +4 -4
- data/test/rubygems/test_gem_commands_outdated_command.rb +9 -9
- data/test/rubygems/test_gem_commands_owner_command.rb +41 -41
- data/test/rubygems/test_gem_commands_pristine_command.rb +92 -92
- data/test/rubygems/test_gem_commands_push_command.rb +54 -54
- data/test/rubygems/test_gem_commands_query_command.rb +73 -73
- data/test/rubygems/test_gem_commands_search_command.rb +2 -2
- data/test/rubygems/test_gem_commands_server_command.rb +2 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +119 -85
- data/test/rubygems/test_gem_commands_signin_command.rb +45 -31
- data/test/rubygems/test_gem_commands_signout_command.rb +3 -3
- data/test/rubygems/test_gem_commands_sources_command.rb +28 -29
- data/test/rubygems/test_gem_commands_specification_command.rb +32 -32
- data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
- data/test/rubygems/test_gem_commands_uninstall_command.rb +75 -75
- data/test/rubygems/test_gem_commands_unpack_command.rb +31 -31
- data/test/rubygems/test_gem_commands_update_command.rb +89 -89
- data/test/rubygems/test_gem_commands_which_command.rb +6 -6
- data/test/rubygems/test_gem_commands_yank_command.rb +40 -40
- data/test/rubygems/test_gem_config_file.rb +93 -81
- data/test/rubygems/test_gem_dependency.rb +73 -73
- data/test/rubygems/test_gem_dependency_installer.rb +165 -165
- data/test/rubygems/test_gem_dependency_list.rb +47 -47
- data/test/rubygems/test_gem_dependency_resolution_error.rb +4 -4
- data/test/rubygems/test_gem_doctor.rb +26 -26
- data/test/rubygems/test_gem_ext_builder.rb +59 -59
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +6 -6
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +8 -8
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +6 -6
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +8 -8
- data/test/rubygems/test_gem_ext_cargo_builder.rb +26 -26
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +3 -3
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +23 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +15 -15
- data/test/rubygems/test_gem_ext_configure_builder.rb +13 -13
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +51 -52
- data/test/rubygems/test_gem_ext_rake_builder.rb +15 -15
- data/test/rubygems/test_gem_gem_runner.rb +7 -7
- data/test/rubygems/test_gem_gemcutter_utilities.rb +66 -66
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +4 -4
- data/test/rubygems/test_gem_indexer.rb +48 -48
- data/test/rubygems/test_gem_install_update_options.rb +16 -16
- data/test/rubygems/test_gem_installer.rb +303 -300
- data/test/rubygems/test_gem_local_remote_options.rb +10 -10
- data/test/rubygems/test_gem_name_tuple.rb +4 -4
- data/test/rubygems/test_gem_package.rb +228 -206
- data/test/rubygems/test_gem_package_old.rb +13 -13
- data/test/rubygems/test_gem_package_tar_header.rb +42 -42
- data/test/rubygems/test_gem_package_tar_reader.rb +8 -8
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +10 -10
- data/test/rubygems/test_gem_package_tar_writer.rb +76 -76
- data/test/rubygems/test_gem_package_task.rb +18 -18
- data/test/rubygems/test_gem_path_support.rb +14 -14
- data/test/rubygems/test_gem_platform.rb +298 -227
- data/test/rubygems/test_gem_rdoc.rb +14 -14
- data/test/rubygems/test_gem_remote_fetcher.rb +149 -149
- data/test/rubygems/test_gem_request.rb +55 -55
- data/test/rubygems/test_gem_request_connection_pools.rb +29 -29
- data/test/rubygems/test_gem_request_set.rb +99 -99
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +204 -206
- data/test/rubygems/test_gem_request_set_lockfile.rb +86 -86
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +56 -56
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +62 -62
- data/test/rubygems/test_gem_requirement.rb +47 -41
- data/test/rubygems/test_gem_resolver.rb +133 -99
- data/test/rubygems/test_gem_resolver_activation_request.rb +6 -6
- data/test/rubygems/test_gem_resolver_api_set.rb +33 -33
- data/test/rubygems/test_gem_resolver_api_specification.rb +47 -47
- data/test/rubygems/test_gem_resolver_best_set.rb +22 -22
- data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +12 -12
- data/test/rubygems/test_gem_resolver_dependency_request.rb +15 -15
- data/test/rubygems/test_gem_resolver_git_set.rb +21 -21
- data/test/rubygems/test_gem_resolver_git_specification.rb +21 -21
- data/test/rubygems/test_gem_resolver_index_set.rb +12 -12
- data/test/rubygems/test_gem_resolver_index_specification.rb +16 -16
- data/test/rubygems/test_gem_resolver_installed_specification.rb +5 -5
- data/test/rubygems/test_gem_resolver_installer_set.rb +78 -34
- data/test/rubygems/test_gem_resolver_local_specification.rb +7 -7
- data/test/rubygems/test_gem_resolver_lock_set.rb +12 -12
- data/test/rubygems/test_gem_resolver_lock_specification.rb +17 -17
- data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +8 -8
- data/test/rubygems/test_gem_resolver_vendor_set.rb +6 -6
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +10 -10
- data/test/rubygems/test_gem_security.rb +67 -67
- data/test/rubygems/test_gem_security_policy.rb +62 -62
- data/test/rubygems/test_gem_security_signer.rb +28 -28
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
- data/test/rubygems/test_gem_silent_ui.rb +38 -32
- data/test/rubygems/test_gem_source.rb +44 -44
- data/test/rubygems/test_gem_source_fetch_problem.rb +9 -9
- data/test/rubygems/test_gem_source_git.rb +59 -59
- data/test/rubygems/test_gem_source_installed.rb +16 -16
- data/test/rubygems/test_gem_source_list.rb +5 -5
- data/test/rubygems/test_gem_source_local.rb +14 -14
- data/test/rubygems/test_gem_source_lock.rb +31 -31
- data/test/rubygems/test_gem_source_specific_file.rb +17 -17
- data/test/rubygems/test_gem_source_subpath_problem.rb +7 -7
- data/test/rubygems/test_gem_source_vendor.rb +13 -13
- data/test/rubygems/test_gem_spec_fetcher.rb +72 -72
- data/test/rubygems/test_gem_specification.rb +444 -436
- data/test/rubygems/test_gem_stream_ui.rb +19 -19
- data/test/rubygems/test_gem_stub_specification.rb +32 -32
- data/test/rubygems/test_gem_text.rb +1 -1
- data/test/rubygems/test_gem_uninstaller.rb +112 -112
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +3 -3
- data/test/rubygems/test_gem_uri.rb +4 -4
- data/test/rubygems/test_gem_uri_formatter.rb +14 -14
- data/test/rubygems/test_gem_util.rb +23 -23
- data/test/rubygems/test_gem_validator.rb +8 -8
- data/test/rubygems/test_gem_version.rb +22 -15
- data/test/rubygems/test_gem_version_option.rb +15 -15
- data/test/rubygems/test_kernel.rb +31 -31
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +6 -6
- data/test/rubygems/test_require.rb +43 -43
- data/test/rubygems/test_rubygems.rb +8 -8
- data/test/rubygems/utilities.rb +19 -19
- metadata +14 -3
@@ -5,8 +5,8 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
require_relative
|
9
|
-
require_relative
|
8
|
+
require_relative "../rubygems"
|
9
|
+
require_relative "security_option"
|
10
10
|
|
11
11
|
##
|
12
12
|
# Mixin methods for install and update options for Gem::Commands
|
@@ -18,22 +18,22 @@ module Gem::InstallUpdateOptions
|
|
18
18
|
# Add the install/update options to the option parser.
|
19
19
|
|
20
20
|
def add_install_update_options
|
21
|
-
add_option(:"Install/Update",
|
22
|
-
|
23
|
-
|
21
|
+
add_option(:"Install/Update", "-i", "--install-dir DIR",
|
22
|
+
"Gem repository directory to get installed",
|
23
|
+
"gems") do |value, options|
|
24
24
|
options[:install_dir] = File.expand_path(value)
|
25
25
|
end
|
26
26
|
|
27
|
-
add_option(:"Install/Update",
|
28
|
-
|
29
|
-
|
27
|
+
add_option(:"Install/Update", "-n", "--bindir DIR",
|
28
|
+
"Directory where executables will be",
|
29
|
+
"placed when the gem is installed") do |value, options|
|
30
30
|
options[:bin_dir] = File.expand_path(value)
|
31
31
|
end
|
32
32
|
|
33
|
-
add_option(:"Install/Update",
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
add_option(:"Install/Update", "--document [TYPES]", Array,
|
34
|
+
"Generate documentation for installed gems",
|
35
|
+
"List the documentation types you wish to",
|
36
|
+
"generate. For example: rdoc,ri") do |value, options|
|
37
37
|
options[:document] = case value
|
38
38
|
when nil then %w[ri]
|
39
39
|
when false then []
|
@@ -41,63 +41,63 @@ module Gem::InstallUpdateOptions
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
add_option(:"Install/Update",
|
45
|
-
|
46
|
-
|
44
|
+
add_option(:"Install/Update", "--build-root DIR",
|
45
|
+
"Temporary installation root. Useful for building",
|
46
|
+
"packages. Do not use this when installing remote gems.") do |value, options|
|
47
47
|
options[:build_root] = File.expand_path(value)
|
48
48
|
end
|
49
49
|
|
50
|
-
add_option(:"Install/Update",
|
51
|
-
|
52
|
-
|
50
|
+
add_option(:"Install/Update", "--vendor",
|
51
|
+
"Install gem into the vendor directory.",
|
52
|
+
"Only for use by gem repackagers.") do |value, options|
|
53
53
|
unless Gem.vendor_dir
|
54
|
-
raise Gem::OptionParser::InvalidOption.new
|
54
|
+
raise Gem::OptionParser::InvalidOption.new "your platform is not supported"
|
55
55
|
end
|
56
56
|
|
57
57
|
options[:vendor] = true
|
58
58
|
options[:install_dir] = Gem.vendor_dir
|
59
59
|
end
|
60
60
|
|
61
|
-
add_option(:"Install/Update",
|
62
|
-
|
61
|
+
add_option(:"Install/Update", "-N", "--no-document",
|
62
|
+
"Disable documentation generation") do |value, options|
|
63
63
|
options[:document] = []
|
64
64
|
end
|
65
65
|
|
66
|
-
add_option(:"Install/Update",
|
66
|
+
add_option(:"Install/Update", "-E", "--[no-]env-shebang",
|
67
67
|
"Rewrite the shebang line on installed",
|
68
68
|
"scripts to use /usr/bin/env") do |value, options|
|
69
69
|
options[:env_shebang] = value
|
70
70
|
end
|
71
71
|
|
72
|
-
add_option(:"Install/Update",
|
73
|
-
|
74
|
-
|
72
|
+
add_option(:"Install/Update", "-f", "--[no-]force",
|
73
|
+
"Force gem to install, bypassing dependency",
|
74
|
+
"checks") do |value, options|
|
75
75
|
options[:force] = value
|
76
76
|
end
|
77
77
|
|
78
|
-
add_option(:"Install/Update",
|
79
|
-
|
80
|
-
|
78
|
+
add_option(:"Install/Update", "-w", "--[no-]wrappers",
|
79
|
+
"Use bin wrappers for executables",
|
80
|
+
"Not available on dosish platforms") do |value, options|
|
81
81
|
options[:wrappers] = value
|
82
82
|
end
|
83
83
|
|
84
84
|
add_security_option
|
85
85
|
|
86
|
-
add_option(:"Install/Update",
|
87
|
-
|
86
|
+
add_option(:"Install/Update", "--ignore-dependencies",
|
87
|
+
"Do not install any required dependent gems") do |value, options|
|
88
88
|
options[:ignore_dependencies] = value
|
89
89
|
end
|
90
90
|
|
91
|
-
add_option(:"Install/Update",
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
add_option(:"Install/Update", "--[no-]format-executable",
|
92
|
+
"Make installed executable names match Ruby.",
|
93
|
+
"If Ruby is ruby18, foo_exec will be",
|
94
|
+
"foo_exec18") do |value, options|
|
95
95
|
options[:format_executable] = value
|
96
96
|
end
|
97
97
|
|
98
|
-
add_option(:"Install/Update",
|
99
|
-
|
100
|
-
|
98
|
+
add_option(:"Install/Update", "--[no-]user-install",
|
99
|
+
"Install in user's home directory instead",
|
100
|
+
"of GEM_HOME.") do |value, options|
|
101
101
|
options[:user_install] = value
|
102
102
|
end
|
103
103
|
|
@@ -133,9 +133,9 @@ module Gem::InstallUpdateOptions
|
|
133
133
|
options[:post_install_message] = value
|
134
134
|
end
|
135
135
|
|
136
|
-
add_option(:"Install/Update",
|
137
|
-
|
138
|
-
|
136
|
+
add_option(:"Install/Update", "-g", "--file [FILE]",
|
137
|
+
"Read from a gem dependencies API file and",
|
138
|
+
"install the listed gems") do |v,o|
|
139
139
|
v = Gem::GEM_DEP_FILES.find do |file|
|
140
140
|
File.exist? file
|
141
141
|
end unless v
|
@@ -150,32 +150,32 @@ module Gem::InstallUpdateOptions
|
|
150
150
|
options[:gemdeps] = v
|
151
151
|
end
|
152
152
|
|
153
|
-
add_option(:"Install/Update",
|
154
|
-
|
155
|
-
|
156
|
-
|
153
|
+
add_option(:"Install/Update", "--without GROUPS", Array,
|
154
|
+
"Omit the named groups (comma separated)",
|
155
|
+
"when installing from a gem dependencies",
|
156
|
+
"file") do |v,o|
|
157
157
|
options[:without_groups].concat v.map {|without| without.intern }
|
158
158
|
end
|
159
159
|
|
160
|
-
add_option(:"Install/Update",
|
161
|
-
|
162
|
-
|
160
|
+
add_option(:"Install/Update", "--default",
|
161
|
+
"Add the gem's full specification to",
|
162
|
+
"specifications/default and extract only its bin") do |v,o|
|
163
163
|
options[:install_as_default] = v
|
164
164
|
end
|
165
165
|
|
166
|
-
add_option(:"Install/Update",
|
167
|
-
|
168
|
-
|
166
|
+
add_option(:"Install/Update", "--explain",
|
167
|
+
"Rather than install the gems, indicate which would",
|
168
|
+
"be installed") do |v,o|
|
169
169
|
options[:explain] = v
|
170
170
|
end
|
171
171
|
|
172
|
-
add_option(:"Install/Update",
|
173
|
-
|
172
|
+
add_option(:"Install/Update", "--[no-]lock",
|
173
|
+
"Create a lock file (when used with -g/--file)") do |v,o|
|
174
174
|
options[:lock] = v
|
175
175
|
end
|
176
176
|
|
177
|
-
add_option(:"Install/Update",
|
178
|
-
|
177
|
+
add_option(:"Install/Update", "--[no-]suggestions",
|
178
|
+
"Suggest alternates when gems are not found") do |v,o|
|
179
179
|
options[:suggest_alternate] = v
|
180
180
|
end
|
181
181
|
end
|
@@ -193,7 +193,7 @@ module Gem::InstallUpdateOptions
|
|
193
193
|
# Default description for the gem install and update commands.
|
194
194
|
|
195
195
|
def install_update_defaults_str
|
196
|
-
|
196
|
+
"--document=ri"
|
197
197
|
end
|
198
198
|
|
199
199
|
end
|
data/lib/rubygems/installer.rb
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
require_relative
|
9
|
-
require_relative
|
10
|
-
require_relative
|
11
|
-
require_relative
|
12
|
-
require_relative
|
13
|
-
require_relative
|
8
|
+
require_relative "installer_uninstaller_utils"
|
9
|
+
require_relative "exceptions"
|
10
|
+
require_relative "deprecate"
|
11
|
+
require_relative "package"
|
12
|
+
require_relative "ext"
|
13
|
+
require_relative "user_interaction"
|
14
14
|
|
15
15
|
##
|
16
16
|
# The installer installs the files contained in the .gem into the Gem.home.
|
@@ -125,14 +125,14 @@ class Gem::Installer
|
|
125
125
|
@spec = spec
|
126
126
|
end
|
127
127
|
|
128
|
-
def extract_files(destination_dir, pattern =
|
128
|
+
def extract_files(destination_dir, pattern = "*")
|
129
129
|
FileUtils.mkdir_p destination_dir
|
130
130
|
|
131
131
|
spec.files.each do |file|
|
132
132
|
file = File.join destination_dir, file
|
133
133
|
next if File.exist? file
|
134
134
|
FileUtils.mkdir_p File.dirname(file)
|
135
|
-
File.open file,
|
135
|
+
File.open file, "w" do |fp|
|
136
136
|
fp.puts "# #{file}"
|
137
137
|
end
|
138
138
|
end
|
@@ -177,7 +177,7 @@ class Gem::Installer
|
|
177
177
|
# :post_install_message:: Print gem post install message if true
|
178
178
|
|
179
179
|
def initialize(package, options={})
|
180
|
-
require
|
180
|
+
require "fileutils"
|
181
181
|
|
182
182
|
@options = options
|
183
183
|
@package = package
|
@@ -219,7 +219,7 @@ class Gem::Installer
|
|
219
219
|
ruby_executable = false
|
220
220
|
existing = nil
|
221
221
|
|
222
|
-
File.open generated_bin,
|
222
|
+
File.open generated_bin, "rb" do |io|
|
223
223
|
line = io.gets
|
224
224
|
shebang = /^#!.*ruby/
|
225
225
|
|
@@ -251,12 +251,12 @@ class Gem::Installer
|
|
251
251
|
return if spec.name == existing
|
252
252
|
|
253
253
|
# somebody has written to RubyGems' directory, overwrite, too bad
|
254
|
-
return if Gem.default_bindir != @bin_dir
|
254
|
+
return if Gem.default_bindir != @bin_dir && !ruby_executable
|
255
255
|
|
256
256
|
question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup
|
257
257
|
|
258
258
|
if ruby_executable
|
259
|
-
question << (existing ||
|
259
|
+
question << (existing || "an unknown executable")
|
260
260
|
|
261
261
|
return if ask_yes_no "#{question}\nOverwrite the executable?", false
|
262
262
|
|
@@ -418,10 +418,10 @@ class Gem::Installer
|
|
418
418
|
# True if the gems in the system satisfy +dependency+.
|
419
419
|
|
420
420
|
def installation_satisfies_dependency?(dependency)
|
421
|
-
return true if @options[:development]
|
421
|
+
return true if @options[:development] && dependency.type == :development
|
422
422
|
return true if installed_specs.detect {|s| dependency.matches_spec? s }
|
423
423
|
return false if @only_install_dir
|
424
|
-
|
424
|
+
!dependency.matching_specs.empty?
|
425
425
|
end
|
426
426
|
|
427
427
|
##
|
@@ -474,7 +474,7 @@ class Gem::Installer
|
|
474
474
|
if Gem.win_platform?
|
475
475
|
script_name = formatted_program_filename(filename) + ".bat"
|
476
476
|
script_path = File.join bindir, File.basename(script_name)
|
477
|
-
File.open script_path,
|
477
|
+
File.open script_path, "w" do |file|
|
478
478
|
file.puts windows_stub_script(bindir, filename)
|
479
479
|
end
|
480
480
|
|
@@ -483,28 +483,20 @@ class Gem::Installer
|
|
483
483
|
end
|
484
484
|
|
485
485
|
def generate_bin # :nodoc:
|
486
|
-
return if spec.executables.nil?
|
486
|
+
return if spec.executables.nil? || spec.executables.empty?
|
487
487
|
|
488
488
|
ensure_writable_dir @bin_dir
|
489
489
|
|
490
490
|
spec.executables.each do |filename|
|
491
491
|
filename.tap(&Gem::UNTAINT)
|
492
492
|
bin_path = File.join gem_dir, spec.bindir, filename
|
493
|
-
|
494
|
-
unless File.exist? bin_path
|
495
|
-
if File.symlink? bin_path
|
496
|
-
alert_warning "`#{bin_path}` is dangling symlink pointing to `#{File.readlink bin_path}`"
|
497
|
-
else
|
498
|
-
alert_warning "`#{bin_path}` does not exist, maybe `gem pristine #{spec.name}` will fix it?"
|
499
|
-
end
|
500
|
-
next
|
501
|
-
end
|
493
|
+
next unless File.exist? bin_path
|
502
494
|
|
503
495
|
mode = File.stat(bin_path).mode
|
504
496
|
dir_mode = options[:prog_mode] || (mode | 0111)
|
505
497
|
|
506
498
|
unless dir_mode == mode
|
507
|
-
require
|
499
|
+
require "fileutils"
|
508
500
|
FileUtils.chmod dir_mode, bin_path
|
509
501
|
end
|
510
502
|
|
@@ -541,10 +533,10 @@ class Gem::Installer
|
|
541
533
|
def generate_bin_script(filename, bindir)
|
542
534
|
bin_script_path = File.join bindir, formatted_program_filename(filename)
|
543
535
|
|
544
|
-
require
|
536
|
+
require "fileutils"
|
545
537
|
FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
|
546
538
|
|
547
|
-
File.open bin_script_path,
|
539
|
+
File.open bin_script_path, "wb", 0755 do |file|
|
548
540
|
file.print app_script_text(filename)
|
549
541
|
file.chmod(options[:prog_mode] || 0755)
|
550
542
|
end
|
@@ -565,7 +557,7 @@ class Gem::Installer
|
|
565
557
|
if File.exist? dst
|
566
558
|
if File.symlink? dst
|
567
559
|
link = File.readlink(dst).split File::SEPARATOR
|
568
|
-
cur_version = Gem::Version.create(link[-3].sub(/^.*-/,
|
560
|
+
cur_version = Gem::Version.create(link[-3].sub(/^.*-/, ""))
|
569
561
|
return if spec.version < cur_version
|
570
562
|
end
|
571
563
|
File.unlink dst
|
@@ -684,9 +676,9 @@ class Gem::Installer
|
|
684
676
|
@build_args = options[:build_args]
|
685
677
|
|
686
678
|
unless @build_root.nil?
|
687
|
-
@bin_dir = File.join(@build_root, @bin_dir.gsub(/^[a-zA-Z]:/,
|
688
|
-
@gem_home = File.join(@build_root, @gem_home.gsub(/^[a-zA-Z]:/,
|
689
|
-
@plugins_dir = File.join(@build_root, @plugins_dir.gsub(/^[a-zA-Z]:/,
|
679
|
+
@bin_dir = File.join(@build_root, @bin_dir.gsub(/^[a-zA-Z]:/, ""))
|
680
|
+
@gem_home = File.join(@build_root, @gem_home.gsub(/^[a-zA-Z]:/, ""))
|
681
|
+
@plugins_dir = File.join(@build_root, @plugins_dir.gsub(/^[a-zA-Z]:/, ""))
|
690
682
|
alert_warning "You build with buildroot.\n Build root: #{@build_root}\n Bin dir: #{@bin_dir}\n Gem home: #{@gem_home}\n Plugins dir: #{@plugins_dir}"
|
691
683
|
end
|
692
684
|
end
|
@@ -697,7 +689,7 @@ class Gem::Installer
|
|
697
689
|
user_bin_dir = @bin_dir || Gem.bindir(gem_home)
|
698
690
|
user_bin_dir = user_bin_dir.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
699
691
|
|
700
|
-
path = ENV[
|
692
|
+
path = ENV["PATH"]
|
701
693
|
path = path.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
702
694
|
|
703
695
|
if Gem.win_platform?
|
@@ -708,7 +700,7 @@ class Gem::Installer
|
|
708
700
|
path = path.split(File::PATH_SEPARATOR)
|
709
701
|
|
710
702
|
unless path.include? user_bin_dir
|
711
|
-
unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV[
|
703
|
+
unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV["HOME"], "~"))
|
712
704
|
alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run."
|
713
705
|
self.class.path_warning = true
|
714
706
|
end
|
@@ -788,7 +780,7 @@ TEXT
|
|
788
780
|
end
|
789
781
|
|
790
782
|
def gemdeps_load(name)
|
791
|
-
return
|
783
|
+
return "" if name == "bundler"
|
792
784
|
|
793
785
|
<<-TEXT
|
794
786
|
|
@@ -824,7 +816,7 @@ TEXT
|
|
824
816
|
TEXT
|
825
817
|
elsif bindir.downcase.start_with? rb_topdir.downcase
|
826
818
|
# stub within ruby folder, but not standard bin. Portable
|
827
|
-
require
|
819
|
+
require "pathname"
|
828
820
|
from = Pathname.new bindir
|
829
821
|
to = Pathname.new "#{rb_topdir}/bin"
|
830
822
|
rel = to.relative_path_from from
|
@@ -935,14 +927,14 @@ TEXT
|
|
935
927
|
def write_build_info_file
|
936
928
|
return if build_args.empty?
|
937
929
|
|
938
|
-
build_info_dir = File.join gem_home,
|
930
|
+
build_info_dir = File.join gem_home, "build_info"
|
939
931
|
|
940
932
|
dir_mode = options[:dir_mode]
|
941
933
|
FileUtils.mkdir_p build_info_dir, :mode => dir_mode && 0755
|
942
934
|
|
943
935
|
build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
|
944
936
|
|
945
|
-
File.open build_info_file,
|
937
|
+
File.open build_info_file, "w" do |io|
|
946
938
|
build_args.each do |arg|
|
947
939
|
io.puts arg
|
948
940
|
end
|
@@ -955,7 +947,7 @@ TEXT
|
|
955
947
|
# Writes the .gem file to the cache directory
|
956
948
|
|
957
949
|
def write_cache_file
|
958
|
-
cache_file = File.join gem_home,
|
950
|
+
cache_file = File.join gem_home, "cache", spec.file_name
|
959
951
|
@package.copy_to cache_file
|
960
952
|
end
|
961
953
|
|
@@ -987,7 +979,7 @@ TEXT
|
|
987
979
|
end
|
988
980
|
|
989
981
|
def load_relative_enabled?
|
990
|
-
rb_config["LIBRUBY_RELATIVE"] ==
|
982
|
+
rb_config["LIBRUBY_RELATIVE"] == "yes"
|
991
983
|
end
|
992
984
|
|
993
985
|
def bash_prolog_script
|
@@ -9,12 +9,12 @@ module Gem::InstallerUninstallerUtils
|
|
9
9
|
plugins = spec.plugins
|
10
10
|
return if plugins.empty?
|
11
11
|
|
12
|
-
require
|
12
|
+
require "pathname"
|
13
13
|
|
14
14
|
spec.plugins.each do |plugin|
|
15
15
|
plugin_script_path = File.join plugins_dir, "#{spec.name}_plugin#{File.extname(plugin)}"
|
16
16
|
|
17
|
-
File.open plugin_script_path,
|
17
|
+
File.open plugin_script_path, "wb" do |file|
|
18
18
|
file.puts "require_relative '#{Pathname.new(plugin).relative_path_from(Pathname.new(plugins_dir))}'"
|
19
19
|
end
|
20
20
|
|
@@ -5,8 +5,8 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
require
|
9
|
-
require_relative
|
8
|
+
require "uri"
|
9
|
+
require_relative "../rubygems"
|
10
10
|
|
11
11
|
##
|
12
12
|
# Mixin methods for local and remote Gem::Command options.
|
@@ -38,18 +38,18 @@ module Gem::LocalRemoteOptions
|
|
38
38
|
# Add local/remote options to the command line parser.
|
39
39
|
|
40
40
|
def add_local_remote_options
|
41
|
-
add_option(:"Local/Remote",
|
42
|
-
|
41
|
+
add_option(:"Local/Remote", "-l", "--local",
|
42
|
+
"Restrict operations to the LOCAL domain") do |value, options|
|
43
43
|
options[:domain] = :local
|
44
44
|
end
|
45
45
|
|
46
|
-
add_option(:"Local/Remote",
|
47
|
-
|
46
|
+
add_option(:"Local/Remote", "-r", "--remote",
|
47
|
+
"Restrict operations to the REMOTE domain") do |value, options|
|
48
48
|
options[:domain] = :remote
|
49
49
|
end
|
50
50
|
|
51
|
-
add_option(:"Local/Remote",
|
52
|
-
|
51
|
+
add_option(:"Local/Remote", "-b", "--both",
|
52
|
+
"Allow LOCAL and REMOTE operations") do |value, options|
|
53
53
|
options[:domain] = :both
|
54
54
|
end
|
55
55
|
|
@@ -64,7 +64,7 @@ module Gem::LocalRemoteOptions
|
|
64
64
|
# Add the --bulk-threshold option
|
65
65
|
|
66
66
|
def add_bulk_threshold_option
|
67
|
-
add_option(:"Local/Remote",
|
67
|
+
add_option(:"Local/Remote", "-B", "--bulk-threshold COUNT",
|
68
68
|
"Threshold for switching to bulk",
|
69
69
|
"synchronization (default #{Gem.configuration.bulk_threshold})") do
|
70
70
|
|value, options|
|
@@ -76,9 +76,8 @@ module Gem::LocalRemoteOptions
|
|
76
76
|
# Add the --clear-sources option
|
77
77
|
|
78
78
|
def add_clear_sources_option
|
79
|
-
add_option(:"Local/Remote",
|
80
|
-
|
81
|
-
|
79
|
+
add_option(:"Local/Remote", "--clear-sources",
|
80
|
+
"Clear the gem sources") do |value, options|
|
82
81
|
Gem.sources = nil
|
83
82
|
options[:sources_cleared] = true
|
84
83
|
end
|
@@ -90,8 +89,8 @@ module Gem::LocalRemoteOptions
|
|
90
89
|
def add_proxy_option
|
91
90
|
accept_uri_http
|
92
91
|
|
93
|
-
add_option(:"Local/Remote",
|
94
|
-
|
92
|
+
add_option(:"Local/Remote", "-p", "--[no-]http-proxy [URL]", URI::HTTP,
|
93
|
+
"Use HTTP proxy for remote operations") do |value, options|
|
95
94
|
options[:http_proxy] = (value == false) ? :no_proxy : value
|
96
95
|
Gem.configuration[:http_proxy] = options[:http_proxy]
|
97
96
|
end
|
@@ -103,10 +102,9 @@ module Gem::LocalRemoteOptions
|
|
103
102
|
def add_source_option
|
104
103
|
accept_uri_http
|
105
104
|
|
106
|
-
add_option(:"Local/Remote",
|
107
|
-
|
108
|
-
|
109
|
-
source << '/' if source !~ /\/\z/
|
105
|
+
add_option(:"Local/Remote", "-s", "--source URL", URI::HTTP,
|
106
|
+
"Append URL to list of remote gem sources") do |source, options|
|
107
|
+
source << "/" if source !~ /\/\z/
|
110
108
|
|
111
109
|
if options.delete :sources_cleared
|
112
110
|
Gem.sources = [source]
|
@@ -120,8 +118,8 @@ module Gem::LocalRemoteOptions
|
|
120
118
|
# Add the --update-sources option
|
121
119
|
|
122
120
|
def add_update_sources_option
|
123
|
-
add_option(:Deprecated,
|
124
|
-
|
121
|
+
add_option(:Deprecated, "-u", "--[no-]update-sources",
|
122
|
+
"Update local source cache") do |value, options|
|
125
123
|
Gem.configuration.update_sources = value
|
126
124
|
end
|
127
125
|
end
|
data/lib/rubygems/mock_gem_ui.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_relative
|
2
|
+
require_relative "user_interaction"
|
3
3
|
|
4
4
|
##
|
5
5
|
# This Gem::StreamUI subclass records input and output to StringIO for
|
@@ -40,7 +40,7 @@ class Gem::MockGemUi < Gem::StreamUI
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def initialize(input = "")
|
43
|
-
require
|
43
|
+
require "stringio"
|
44
44
|
ins = StringIO.new input
|
45
45
|
outs = StringIO.new
|
46
46
|
errs = StringIO.new
|
data/lib/rubygems/name_tuple.rb
CHANGED
@@ -10,7 +10,7 @@ class Gem::NameTuple
|
|
10
10
|
@version = version
|
11
11
|
|
12
12
|
unless platform.kind_of? Gem::Platform
|
13
|
-
platform = "ruby" if !platform
|
13
|
+
platform = "ruby" if !platform || platform.empty?
|
14
14
|
end
|
15
15
|
|
16
16
|
@platform = platform
|
@@ -48,7 +48,7 @@ class Gem::NameTuple
|
|
48
48
|
|
49
49
|
def full_name
|
50
50
|
case @platform
|
51
|
-
when nil,
|
51
|
+
when nil, "ruby", ""
|
52
52
|
"#{@name}-#{@version}"
|
53
53
|
else
|
54
54
|
"#{@name}-#{@version}-#{@platform}"
|
@@ -102,8 +102,8 @@ class Gem::NameTuple
|
|
102
102
|
def ==(other)
|
103
103
|
case other
|
104
104
|
when self.class
|
105
|
-
@name == other.name
|
106
|
-
@version == other.version
|
105
|
+
@name == other.name &&
|
106
|
+
@version == other.version &&
|
107
107
|
@platform == other.platform
|
108
108
|
when Array
|
109
109
|
to_a == other
|
data/lib/rubygems/optparse.rb
CHANGED
@@ -22,10 +22,10 @@ class Gem::Package::FileSource < Gem::Package::Source # :nodoc: all
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def with_write_io(&block)
|
25
|
-
File.open path,
|
25
|
+
File.open path, "wb", &block
|
26
26
|
end
|
27
27
|
|
28
28
|
def with_read_io(&block)
|
29
|
-
File.open path,
|
29
|
+
File.open path, "rb", &block
|
30
30
|
end
|
31
31
|
end
|
data/lib/rubygems/package/old.rb
CHANGED
@@ -19,8 +19,8 @@ class Gem::Package::Old < Gem::Package
|
|
19
19
|
# cannot be written.
|
20
20
|
|
21
21
|
def initialize(gem, security_policy)
|
22
|
-
require
|
23
|
-
require
|
22
|
+
require "fileutils"
|
23
|
+
require "zlib"
|
24
24
|
Gem.load_yaml
|
25
25
|
|
26
26
|
@contents = nil
|
@@ -41,7 +41,7 @@ class Gem::Package::Old < Gem::Package
|
|
41
41
|
read_until_dashes io # spec
|
42
42
|
header = file_list io
|
43
43
|
|
44
|
-
@contents = header.map {|file| file[
|
44
|
+
@contents = header.map {|file| file["path"] }
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -59,7 +59,7 @@ class Gem::Package::Old < Gem::Package
|
|
59
59
|
raise Gem::Exception, errstr unless header
|
60
60
|
|
61
61
|
header.each do |entry|
|
62
|
-
full_name = entry[
|
62
|
+
full_name = entry["path"]
|
63
63
|
|
64
64
|
destination = install_location full_name, destination_dir
|
65
65
|
|
@@ -73,13 +73,13 @@ class Gem::Package::Old < Gem::Package
|
|
73
73
|
file_data = Zlib::Inflate.inflate file_data
|
74
74
|
|
75
75
|
raise Gem::Package::FormatError, "#{full_name} in #{@gem} is corrupt" if
|
76
|
-
file_data.length != entry[
|
76
|
+
file_data.length != entry["size"].to_i
|
77
77
|
|
78
78
|
FileUtils.rm_rf destination
|
79
79
|
|
80
80
|
FileUtils.mkdir_p File.dirname(destination), :mode => dir_mode && 0755
|
81
81
|
|
82
|
-
File.open destination,
|
82
|
+
File.open destination, "wb", file_mode(entry["mode"]) do |out|
|
83
83
|
out.write file_data
|
84
84
|
end
|
85
85
|
|
@@ -119,7 +119,7 @@ class Gem::Package::Old < Gem::Package
|
|
119
119
|
loop do
|
120
120
|
line = io.gets
|
121
121
|
|
122
|
-
return if line.chomp ==
|
122
|
+
return if line.chomp == "__END__"
|
123
123
|
break unless line
|
124
124
|
end
|
125
125
|
|
@@ -160,7 +160,7 @@ class Gem::Package::Old < Gem::Package
|
|
160
160
|
return true unless @security_policy
|
161
161
|
|
162
162
|
raise Gem::Security::Exception,
|
163
|
-
|
163
|
+
"old format gems do not contain signatures and cannot be verified" if
|
164
164
|
@security_policy.verify_data
|
165
165
|
|
166
166
|
true
|