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
data/lib/rubygems/platform.rb
CHANGED
@@ -12,7 +12,7 @@ class Gem::Platform
|
|
12
12
|
attr_accessor :cpu, :os, :version
|
13
13
|
|
14
14
|
def self.local
|
15
|
-
arch = RbConfig::CONFIG[
|
15
|
+
arch = RbConfig::CONFIG["arch"]
|
16
16
|
arch = "#{arch}_60" if arch =~ /mswin(?:32|64)$/
|
17
17
|
@local ||= new(arch)
|
18
18
|
end
|
@@ -23,9 +23,9 @@ class Gem::Platform
|
|
23
23
|
|
24
24
|
def self.match_platforms?(platform, platforms)
|
25
25
|
platforms.any? do |local_platform|
|
26
|
-
platform.nil?
|
27
|
-
local_platform == platform
|
28
|
-
(local_platform != Gem::Platform::RUBY
|
26
|
+
platform.nil? ||
|
27
|
+
local_platform == platform ||
|
28
|
+
(local_platform != Gem::Platform::RUBY && platform =~ local_platform)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
private_class_method :match_platforms?
|
@@ -56,7 +56,7 @@ class Gem::Platform
|
|
56
56
|
case arch
|
57
57
|
when Gem::Platform::CURRENT then
|
58
58
|
Gem::Platform.local
|
59
|
-
when Gem::Platform::RUBY, nil,
|
59
|
+
when Gem::Platform::RUBY, nil, "" then
|
60
60
|
Gem::Platform::RUBY
|
61
61
|
else
|
62
62
|
super
|
@@ -68,9 +68,9 @@ class Gem::Platform
|
|
68
68
|
when Array then
|
69
69
|
@cpu, @os, @version = arch
|
70
70
|
when String then
|
71
|
-
arch = arch.split
|
71
|
+
arch = arch.split "-"
|
72
72
|
|
73
|
-
if arch.length > 2
|
73
|
+
if arch.length > 2 && arch.last !~ /\d+(\.\d+)?$/ # reassemble x86-linux-{libc}
|
74
74
|
extra = arch.pop
|
75
75
|
arch.last << "-#{extra}"
|
76
76
|
end
|
@@ -78,11 +78,11 @@ class Gem::Platform
|
|
78
78
|
cpu = arch.shift
|
79
79
|
|
80
80
|
@cpu = case cpu
|
81
|
-
when /i\d86/ then
|
81
|
+
when /i\d86/ then "x86"
|
82
82
|
else cpu
|
83
83
|
end
|
84
84
|
|
85
|
-
if arch.length == 2
|
85
|
+
if arch.length == 2 && arch.last =~ /^\d+(\.\d+)?$/ # for command-line
|
86
86
|
@os, @version = arch
|
87
87
|
return
|
88
88
|
end
|
@@ -91,31 +91,31 @@ class Gem::Platform
|
|
91
91
|
@cpu, os = nil, cpu if os.nil? # legacy jruby
|
92
92
|
|
93
93
|
@os, @version = case os
|
94
|
-
when /aix(\d+)?/ then [
|
95
|
-
when /cygwin/ then [
|
96
|
-
when /darwin(\d+)?/ then [
|
97
|
-
when /^macruby$/ then [
|
98
|
-
when /freebsd(\d+)?/ then [
|
99
|
-
when /hpux(\d+)?/ then [
|
100
|
-
when /^java$/, /^jruby$/ then [
|
101
|
-
when /^java([\d.]*)/ then [
|
102
|
-
when /^dalvik(\d+)?$/ then [
|
103
|
-
when /^dotnet$/ then [
|
104
|
-
when /^dotnet([\d.]*)/ then [
|
105
|
-
when /linux-?(
|
106
|
-
when /mingw32/ then [
|
107
|
-
when /mingw-?(\w+)?/ then [
|
94
|
+
when /aix(\d+)?/ then [ "aix", $1 ]
|
95
|
+
when /cygwin/ then [ "cygwin", nil ]
|
96
|
+
when /darwin(\d+)?/ then [ "darwin", $1 ]
|
97
|
+
when /^macruby$/ then [ "macruby", nil ]
|
98
|
+
when /freebsd(\d+)?/ then [ "freebsd", $1 ]
|
99
|
+
when /hpux(\d+)?/ then [ "hpux", $1 ]
|
100
|
+
when /^java$/, /^jruby$/ then [ "java", nil ]
|
101
|
+
when /^java([\d.]*)/ then [ "java", $1 ]
|
102
|
+
when /^dalvik(\d+)?$/ then [ "dalvik", $1 ]
|
103
|
+
when /^dotnet$/ then [ "dotnet", nil ]
|
104
|
+
when /^dotnet([\d.]*)/ then [ "dotnet", $1 ]
|
105
|
+
when /linux-?(\w+)?/ then [ "linux", $1 ]
|
106
|
+
when /mingw32/ then [ "mingw32", nil ]
|
107
|
+
when /mingw-?(\w+)?/ then [ "mingw", $1 ]
|
108
108
|
when /(mswin\d+)(\_(\d+))?/ then
|
109
109
|
os, version = $1, $3
|
110
|
-
@cpu =
|
110
|
+
@cpu = "x86" if @cpu.nil? && os =~ /32$/
|
111
111
|
[os, version]
|
112
|
-
when /netbsdelf/ then [
|
113
|
-
when /openbsd(\d+\.\d+)?/ then [
|
114
|
-
when /bitrig(\d+\.\d+)?/ then [
|
115
|
-
when /solaris(\d+\.\d+)?/ then [
|
112
|
+
when /netbsdelf/ then [ "netbsdelf", nil ]
|
113
|
+
when /openbsd(\d+\.\d+)?/ then [ "openbsd", $1 ]
|
114
|
+
when /bitrig(\d+\.\d+)?/ then [ "bitrig", $1 ]
|
115
|
+
when /solaris(\d+\.\d+)?/ then [ "solaris", $1 ]
|
116
116
|
# test
|
117
117
|
when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
|
118
|
-
else [
|
118
|
+
else [ "unknown", nil ]
|
119
119
|
end
|
120
120
|
when Gem::Platform then
|
121
121
|
@cpu = arch.cpu
|
@@ -131,7 +131,7 @@ class Gem::Platform
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def to_s
|
134
|
-
to_a.compact.join
|
134
|
+
to_a.compact.join "-"
|
135
135
|
end
|
136
136
|
|
137
137
|
##
|
@@ -139,7 +139,7 @@ class Gem::Platform
|
|
139
139
|
# the same CPU, OS and version.
|
140
140
|
|
141
141
|
def ==(other)
|
142
|
-
self.class === other
|
142
|
+
self.class === other && to_a == other.to_a
|
143
143
|
end
|
144
144
|
|
145
145
|
alias :eql? :==
|
@@ -151,27 +151,38 @@ class Gem::Platform
|
|
151
151
|
##
|
152
152
|
# Does +other+ match this platform? Two platforms match if they have the
|
153
153
|
# same CPU, or either has a CPU of 'universal', they have the same OS, and
|
154
|
-
# they have the same version, or either has no version
|
154
|
+
# they have the same version, or either one has no version
|
155
155
|
#
|
156
156
|
# Additionally, the platform will match if the local CPU is 'arm' and the
|
157
157
|
# other CPU starts with "arm" (for generic ARM family support).
|
158
|
+
#
|
159
|
+
# Of note, this method is not commutative. Indeed the OS 'linux' has a
|
160
|
+
# special case: the version is the libc name, yet while "no version" stands
|
161
|
+
# as a wildcard for a binary gem platform (as for other OSes), for the
|
162
|
+
# runtime platform "no version" stands for 'gnu'. To be able to disinguish
|
163
|
+
# these, the method receiver is the gem platform, while the argument is
|
164
|
+
# the runtime platform.
|
158
165
|
|
159
166
|
def ===(other)
|
160
167
|
return nil unless Gem::Platform === other
|
161
168
|
|
162
169
|
# universal-mingw32 matches x64-mingw-ucrt
|
163
|
-
return true if (@cpu ==
|
164
|
-
@os.start_with?(
|
170
|
+
return true if (@cpu == "universal" || other.cpu == "universal") &&
|
171
|
+
@os.start_with?("mingw") && other.os.start_with?("mingw")
|
165
172
|
|
166
173
|
# cpu
|
167
|
-
([nil,
|
168
|
-
(@cpu ==
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
174
|
+
([nil,"universal"].include?(@cpu) || [nil, "universal"].include?(other.cpu) || @cpu == other.cpu ||
|
175
|
+
(@cpu == "arm" && other.cpu.start_with?("arm"))) &&
|
176
|
+
|
177
|
+
# os
|
178
|
+
@os == other.os &&
|
179
|
+
|
180
|
+
# version
|
181
|
+
(
|
182
|
+
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
|
183
|
+
(@os == "linux" && (other.version == "gnu#{@version}" || other.version == "musl#{@version}" || @version == "gnu#{other.version}")) ||
|
184
|
+
@version == other.version
|
185
|
+
)
|
175
186
|
end
|
176
187
|
|
177
188
|
##
|
@@ -184,17 +195,17 @@ class Gem::Platform
|
|
184
195
|
when String then
|
185
196
|
# This data is from http://gems.rubyforge.org/gems/yaml on 19 Aug 2007
|
186
197
|
other = case other
|
187
|
-
when /^i686-darwin(\d)/ then [
|
188
|
-
when /^i\d86-linux/ then [
|
189
|
-
when
|
190
|
-
when /^dalvik(\d+)?$/ then [nil,
|
191
|
-
when /dotnet(\-(\d+\.\d+))?/ then [
|
192
|
-
when /mswin32(\_(\d+))?/ then [
|
193
|
-
when /mswin64(\_(\d+))?/ then [
|
194
|
-
when
|
195
|
-
when /powerpc-darwin(\d)/ then [
|
196
|
-
when /sparc-solaris2.8/ then [
|
197
|
-
when /universal-darwin(\d)/ then [
|
198
|
+
when /^i686-darwin(\d)/ then ["x86", "darwin", $1 ]
|
199
|
+
when /^i\d86-linux/ then ["x86", "linux", nil ]
|
200
|
+
when "java", "jruby" then [nil, "java", nil ]
|
201
|
+
when /^dalvik(\d+)?$/ then [nil, "dalvik", $1 ]
|
202
|
+
when /dotnet(\-(\d+\.\d+))?/ then ["universal","dotnet", $2 ]
|
203
|
+
when /mswin32(\_(\d+))?/ then ["x86", "mswin32", $2 ]
|
204
|
+
when /mswin64(\_(\d+))?/ then ["x64", "mswin64", $2 ]
|
205
|
+
when "powerpc-darwin" then ["powerpc", "darwin", nil ]
|
206
|
+
when /powerpc-darwin(\d)/ then ["powerpc", "darwin", $1 ]
|
207
|
+
when /sparc-solaris2.8/ then ["sparc", "solaris", "2.8" ]
|
208
|
+
when /universal-darwin(\d)/ then ["universal", "darwin", $1 ]
|
198
209
|
else other
|
199
210
|
end
|
200
211
|
|
@@ -210,11 +221,11 @@ class Gem::Platform
|
|
210
221
|
# A pure-Ruby gem that may use Gem::Specification#extensions to build
|
211
222
|
# binary files.
|
212
223
|
|
213
|
-
RUBY =
|
224
|
+
RUBY = "ruby".freeze
|
214
225
|
|
215
226
|
##
|
216
227
|
# A platform-specific gem that is built for the packaging Ruby's platform.
|
217
228
|
# This will be replaced with Gem::Platform::local.
|
218
229
|
|
219
|
-
CURRENT =
|
230
|
+
CURRENT = "current".freeze
|
220
231
|
end
|
data/lib/rubygems/psych_tree.rb
CHANGED
@@ -7,7 +7,7 @@ module Gem
|
|
7
7
|
end unless respond_to? :create
|
8
8
|
|
9
9
|
def visit_String(str)
|
10
|
-
return super unless str ==
|
10
|
+
return super unless str == "=" # or whatever you want
|
11
11
|
|
12
12
|
quote = Psych::Nodes::Scalar::SINGLE_QUOTED
|
13
13
|
@emitter.scalar str, nil, nil, false, true, quote
|
data/lib/rubygems/query_utils.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require_relative "local_remote_options"
|
4
|
+
require_relative "spec_fetcher"
|
5
|
+
require_relative "version_option"
|
6
|
+
require_relative "text"
|
7
7
|
|
8
8
|
module Gem::QueryUtils
|
9
9
|
|
@@ -12,41 +12,41 @@ module Gem::QueryUtils
|
|
12
12
|
include Gem::VersionOption
|
13
13
|
|
14
14
|
def add_query_options
|
15
|
-
add_option(
|
16
|
-
|
15
|
+
add_option("-i", "--[no-]installed",
|
16
|
+
"Check for installed gem") do |value, options|
|
17
17
|
options[:installed] = value
|
18
18
|
end
|
19
19
|
|
20
|
-
add_option(
|
20
|
+
add_option("-I", "Equivalent to --no-installed") do |value, options|
|
21
21
|
options[:installed] = false
|
22
22
|
end
|
23
23
|
|
24
24
|
add_version_option command, "for use with --installed"
|
25
25
|
|
26
|
-
add_option(
|
27
|
-
|
26
|
+
add_option("-d", "--[no-]details",
|
27
|
+
"Display detailed information of gem(s)") do |value, options|
|
28
28
|
options[:details] = value
|
29
29
|
end
|
30
30
|
|
31
|
-
add_option(
|
32
|
-
|
31
|
+
add_option("--[no-]versions",
|
32
|
+
"Display only gem names") do |value, options|
|
33
33
|
options[:versions] = value
|
34
34
|
options[:details] = false unless value
|
35
35
|
end
|
36
36
|
|
37
|
-
add_option(
|
38
|
-
|
37
|
+
add_option("-a", "--all",
|
38
|
+
"Display all gem versions") do |value, options|
|
39
39
|
options[:all] = value
|
40
40
|
end
|
41
41
|
|
42
|
-
add_option(
|
43
|
-
|
44
|
-
|
42
|
+
add_option("-e", "--exact",
|
43
|
+
"Name of gem(s) to query on matches the",
|
44
|
+
"provided STRING") do |value, options|
|
45
45
|
options[:exact] = value
|
46
46
|
end
|
47
47
|
|
48
|
-
add_option(
|
49
|
-
|
48
|
+
add_option("--[no-]prerelease",
|
49
|
+
"Display prerelease versions") do |value, options|
|
50
50
|
options[:prerelease] = value
|
51
51
|
end
|
52
52
|
|
@@ -112,7 +112,7 @@ module Gem::QueryUtils
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def display_header(type)
|
115
|
-
if (ui.outs.tty?
|
115
|
+
if (ui.outs.tty? && Gem.configuration.verbose) || both?
|
116
116
|
say
|
117
117
|
say "*** #{type} GEMS ***"
|
118
118
|
say
|
@@ -132,7 +132,7 @@ module Gem::QueryUtils
|
|
132
132
|
name_matches = name ? s.name =~ name : true
|
133
133
|
version_matches = show_prereleases? || !s.version.prerelease?
|
134
134
|
|
135
|
-
name_matches
|
135
|
+
name_matches && version_matches
|
136
136
|
end
|
137
137
|
|
138
138
|
spec_tuples = specs.map do |spec|
|
@@ -151,7 +151,7 @@ module Gem::QueryUtils
|
|
151
151
|
fetcher.detect(specs_type) { true }
|
152
152
|
else
|
153
153
|
fetcher.detect(specs_type) do |name_tuple|
|
154
|
-
name === name_tuple.name
|
154
|
+
name === name_tuple.name && options[:version].satisfied_by?(name_tuple.version)
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
@@ -159,7 +159,7 @@ module Gem::QueryUtils
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def specs_type
|
162
|
-
if options[:all]
|
162
|
+
if options[:all] || options[:version].specific?
|
163
163
|
if options[:prerelease]
|
164
164
|
:complete
|
165
165
|
else
|
@@ -176,7 +176,7 @@ module Gem::QueryUtils
|
|
176
176
|
# Check if gem +name+ version +version+ is installed.
|
177
177
|
|
178
178
|
def installed?(name, req = Gem::Requirement.default)
|
179
|
-
Gem::Specification.any? {|s| s.name =~ name
|
179
|
+
Gem::Specification.any? {|s| s.name =~ name && req =~ s.version }
|
180
180
|
end
|
181
181
|
|
182
182
|
def output_query_results(spec_tuples)
|
@@ -242,7 +242,7 @@ module Gem::QueryUtils
|
|
242
242
|
return unless options[:versions]
|
243
243
|
|
244
244
|
list =
|
245
|
-
if platforms.empty?
|
245
|
+
if platforms.empty? || options[:details]
|
246
246
|
name_tuples.map {|n| n.version }.uniq
|
247
247
|
else
|
248
248
|
platforms.sort.reverse.map do |version, pls|
|
@@ -257,7 +257,7 @@ module Gem::QueryUtils
|
|
257
257
|
|
258
258
|
if pls != [Gem::Platform::RUBY]
|
259
259
|
platform_list = [pls.delete(Gem::Platform::RUBY), *pls.sort].compact
|
260
|
-
out = platform_list.unshift(out).join(
|
260
|
+
out = platform_list.unshift(out).join(" ")
|
261
261
|
end
|
262
262
|
|
263
263
|
out
|
@@ -284,21 +284,21 @@ module Gem::QueryUtils
|
|
284
284
|
|
285
285
|
def spec_authors(entry, spec)
|
286
286
|
authors = "Author#{spec.authors.length > 1 ? 's' : ''}: ".dup
|
287
|
-
authors << spec.authors.join(
|
287
|
+
authors << spec.authors.join(", ")
|
288
288
|
entry << format_text(authors, 68, 4)
|
289
289
|
end
|
290
290
|
|
291
291
|
def spec_homepage(entry, spec)
|
292
|
-
return if spec.homepage.nil?
|
292
|
+
return if spec.homepage.nil? || spec.homepage.empty?
|
293
293
|
|
294
294
|
entry << "\n" << format_text("Homepage: #{spec.homepage}", 68, 4)
|
295
295
|
end
|
296
296
|
|
297
297
|
def spec_license(entry, spec)
|
298
|
-
return if spec.license.nil?
|
298
|
+
return if spec.license.nil? || spec.license.empty?
|
299
299
|
|
300
300
|
licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: ".dup
|
301
|
-
licenses << spec.licenses.join(
|
301
|
+
licenses << spec.licenses.join(", ")
|
302
302
|
entry << "\n" << format_text(licenses, 68, 4)
|
303
303
|
end
|
304
304
|
|
@@ -306,15 +306,15 @@ module Gem::QueryUtils
|
|
306
306
|
return unless spec.loaded_from
|
307
307
|
|
308
308
|
if specs.length == 1
|
309
|
-
default = spec.default_gem? ?
|
309
|
+
default = spec.default_gem? ? " (default)" : nil
|
310
310
|
entry << "\n" << " Installed at#{default}: #{spec.base_dir}"
|
311
311
|
else
|
312
|
-
label =
|
312
|
+
label = "Installed at"
|
313
313
|
specs.each do |s|
|
314
314
|
version = s.version.to_s
|
315
|
-
version <<
|
315
|
+
version << ", default" if s.default_gem?
|
316
316
|
entry << "\n" << " #{label} (#{version}): #{s.base_dir}"
|
317
|
-
label =
|
317
|
+
label = " " * label.length
|
318
318
|
end
|
319
319
|
end
|
320
320
|
end
|
@@ -327,7 +327,7 @@ module Gem::QueryUtils
|
|
327
327
|
return unless non_ruby
|
328
328
|
|
329
329
|
if platforms.length == 1
|
330
|
-
title = platforms.values.length == 1 ?
|
330
|
+
title = platforms.values.length == 1 ? "Platform" : "Platforms"
|
331
331
|
entry << " #{title}: #{platforms.values.sort.join(', ')}\n"
|
332
332
|
else
|
333
333
|
entry << " Platforms:\n"
|
@@ -336,7 +336,7 @@ module Gem::QueryUtils
|
|
336
336
|
|
337
337
|
sorted_platforms.each do |version, pls|
|
338
338
|
label = " #{version}: "
|
339
|
-
data = format_text pls.sort.join(
|
339
|
+
data = format_text pls.sort.join(", "), 68, label.length
|
340
340
|
data[0, label.length] = label
|
341
341
|
entry << data << "\n"
|
342
342
|
end
|
data/lib/rubygems/rdoc.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_relative
|
3
|
-
require_relative
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
2
|
+
require_relative "../rubygems"
|
3
|
+
require_relative "request"
|
4
|
+
require_relative "request/connection_pools"
|
5
|
+
require_relative "s3_uri_signer"
|
6
|
+
require_relative "uri_formatter"
|
7
|
+
require_relative "uri"
|
8
|
+
require_relative "user_interaction"
|
9
9
|
|
10
10
|
##
|
11
11
|
# RemoteFetcher handles the details of fetching gems and gem information from
|
@@ -72,10 +72,10 @@ class Gem::RemoteFetcher
|
|
72
72
|
# fetching the gem.
|
73
73
|
|
74
74
|
def initialize(proxy=nil, dns=nil, headers={})
|
75
|
-
require_relative
|
76
|
-
require
|
77
|
-
require
|
78
|
-
require
|
75
|
+
require_relative "core_ext/tcpsocket_init" if Gem.configuration.ipv4_fallback_enabled
|
76
|
+
require "net/http"
|
77
|
+
require "stringio"
|
78
|
+
require "uri"
|
79
79
|
|
80
80
|
Socket.do_not_reverse_lookup = true
|
81
81
|
|
@@ -114,7 +114,7 @@ class Gem::RemoteFetcher
|
|
114
114
|
cache_dir =
|
115
115
|
if Dir.pwd == install_dir # see fetch_command
|
116
116
|
install_dir
|
117
|
-
elsif File.writable?(install_cache_dir) || (File.writable?(install_dir) && (
|
117
|
+
elsif File.writable?(install_cache_dir) || (File.writable?(install_dir) && (!File.exist?(install_cache_dir)))
|
118
118
|
install_cache_dir
|
119
119
|
else
|
120
120
|
File.join Gem.user_dir, "cache"
|
@@ -136,7 +136,7 @@ class Gem::RemoteFetcher
|
|
136
136
|
# REFACTOR: split this up and dispatch on scheme (eg download_http)
|
137
137
|
# REFACTOR: be sure to clean up fake fetcher when you do this... cleaner
|
138
138
|
case scheme
|
139
|
-
when
|
139
|
+
when "http", "https", "s3" then
|
140
140
|
unless File.exist? local_gem_path
|
141
141
|
begin
|
142
142
|
verbose "Downloading gem #{gem_file_name}"
|
@@ -156,12 +156,12 @@ class Gem::RemoteFetcher
|
|
156
156
|
self.cache_update_path remote_gem_path, local_gem_path
|
157
157
|
end
|
158
158
|
end
|
159
|
-
when
|
159
|
+
when "file" then
|
160
160
|
begin
|
161
161
|
path = source_uri.path
|
162
|
-
path = File.dirname(path) if File.extname(path) ==
|
162
|
+
path = File.dirname(path) if File.extname(path) == ".gem"
|
163
163
|
|
164
|
-
remote_gem_path = Gem::Util.correct_for_windows_path(File.join(path,
|
164
|
+
remote_gem_path = Gem::Util.correct_for_windows_path(File.join(path, "gems", gem_file_name))
|
165
165
|
|
166
166
|
FileUtils.cp(remote_gem_path, local_gem_path)
|
167
167
|
rescue Errno::EACCES
|
@@ -171,7 +171,7 @@ class Gem::RemoteFetcher
|
|
171
171
|
verbose "Using local gem #{local_gem_path}"
|
172
172
|
when nil then # TODO test for local overriding cache
|
173
173
|
source_path = if Gem.win_platform? && source_uri.scheme &&
|
174
|
-
!source_uri.path.include?(
|
174
|
+
!source_uri.path.include?(":")
|
175
175
|
"#{source_uri.scheme}:#{source_uri.path}"
|
176
176
|
else
|
177
177
|
source_uri.path
|
@@ -216,9 +216,9 @@ class Gem::RemoteFetcher
|
|
216
216
|
head ? response : response.body
|
217
217
|
when Net::HTTPMovedPermanently, Net::HTTPFound, Net::HTTPSeeOther,
|
218
218
|
Net::HTTPTemporaryRedirect then
|
219
|
-
raise FetchError.new(
|
219
|
+
raise FetchError.new("too many redirects", uri) if depth > 10
|
220
220
|
|
221
|
-
unless location = response[
|
221
|
+
unless location = response["Location"]
|
222
222
|
raise FetchError.new("redirecting but no redirect location was given", uri)
|
223
223
|
end
|
224
224
|
location = Gem::Uri.new location
|
@@ -247,7 +247,7 @@ class Gem::RemoteFetcher
|
|
247
247
|
|
248
248
|
data = send "fetch_#{uri.scheme}", uri, mtime, head
|
249
249
|
|
250
|
-
if data
|
250
|
+
if data && !head && uri.to_s.end_with?(".gz")
|
251
251
|
begin
|
252
252
|
data = Gem::Util.gunzip data
|
253
253
|
rescue Zlib::GzipFile::Error
|
@@ -288,7 +288,7 @@ class Gem::RemoteFetcher
|
|
288
288
|
return Gem.read_binary(path)
|
289
289
|
end
|
290
290
|
|
291
|
-
if update
|
291
|
+
if update && path
|
292
292
|
Gem.write_binary(path, data)
|
293
293
|
end
|
294
294
|
|
@@ -312,7 +312,7 @@ class Gem::RemoteFetcher
|
|
312
312
|
end
|
313
313
|
|
314
314
|
def https?(uri)
|
315
|
-
uri.scheme.downcase ==
|
315
|
+
uri.scheme.downcase == "https"
|
316
316
|
end
|
317
317
|
|
318
318
|
def close_all
|
@@ -37,15 +37,15 @@ class Gem::Request::ConnectionPools # :nodoc:
|
|
37
37
|
# Returns list of no_proxy entries (if any) from the environment
|
38
38
|
|
39
39
|
def get_no_proxy_from_env
|
40
|
-
env_no_proxy = ENV[
|
40
|
+
env_no_proxy = ENV["no_proxy"] || ENV["NO_PROXY"]
|
41
41
|
|
42
|
-
return [] if env_no_proxy.nil?
|
42
|
+
return [] if env_no_proxy.nil? || env_no_proxy.empty?
|
43
43
|
|
44
44
|
env_no_proxy.split(/\s*,\s*/)
|
45
45
|
end
|
46
46
|
|
47
47
|
def https?(uri)
|
48
|
-
uri.scheme.downcase ==
|
48
|
+
uri.scheme.downcase == "https"
|
49
49
|
end
|
50
50
|
|
51
51
|
def no_proxy?(host, env_no_proxy)
|
@@ -78,7 +78,7 @@ class Gem::Request::ConnectionPools # :nodoc:
|
|
78
78
|
|
79
79
|
no_proxy = get_no_proxy_from_env
|
80
80
|
|
81
|
-
if proxy_uri
|
81
|
+
if proxy_uri && !no_proxy?(hostname, no_proxy)
|
82
82
|
proxy_hostname = proxy_uri.respond_to?(:hostname) ? proxy_uri.hostname : proxy_uri.host
|
83
83
|
net_http_args + [
|
84
84
|
proxy_hostname,
|