rubygems-update 3.4.21 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +132 -2
- data/Manifest.txt +39 -221
- data/README.md +1 -3
- data/bundler/CHANGELOG.md +74 -0
- data/bundler/README.md +1 -2
- data/bundler/bundler.gemspec +4 -2
- data/bundler/exe/bundle +1 -10
- data/bundler/lib/bundler/build_metadata.rb +3 -3
- data/bundler/lib/bundler/capistrano.rb +1 -1
- data/bundler/lib/bundler/checksum.rb +245 -0
- data/bundler/lib/bundler/ci_detector.rb +75 -0
- data/bundler/lib/bundler/cli/add.rb +3 -3
- data/bundler/lib/bundler/cli/binstubs.rb +4 -4
- data/bundler/lib/bundler/cli/cache.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/common.rb +9 -1
- data/bundler/lib/bundler/cli/config.rb +8 -7
- data/bundler/lib/bundler/cli/console.rb +3 -2
- data/bundler/lib/bundler/cli/doctor.rb +2 -2
- data/bundler/lib/bundler/cli/exec.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +31 -23
- data/bundler/lib/bundler/cli/info.rb +2 -13
- data/bundler/lib/bundler/cli/install.rb +5 -4
- data/bundler/lib/bundler/cli/issue.rb +1 -1
- data/bundler/lib/bundler/cli/lock.rb +4 -4
- data/bundler/lib/bundler/cli/open.rb +1 -1
- data/bundler/lib/bundler/cli/outdated.rb +6 -6
- data/bundler/lib/bundler/cli/plugin.rb +7 -14
- data/bundler/lib/bundler/cli/pristine.rb +38 -30
- data/bundler/lib/bundler/cli/show.rb +2 -2
- data/bundler/lib/bundler/cli/update.rb +5 -5
- data/bundler/lib/bundler/cli.rb +215 -263
- data/bundler/lib/bundler/compact_index_client/cache.rb +29 -9
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/bundler/lib/bundler/compact_index_client/updater.rb +79 -81
- data/bundler/lib/bundler/compact_index_client.rb +14 -7
- data/bundler/lib/bundler/constants.rb +1 -1
- data/bundler/lib/bundler/current_ruby.rb +5 -21
- data/bundler/lib/bundler/definition.rb +43 -16
- data/bundler/lib/bundler/dependency.rb +16 -12
- data/bundler/lib/bundler/digest.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +43 -25
- data/bundler/lib/bundler/endpoint_specification.rb +6 -2
- data/bundler/lib/bundler/env.rb +1 -3
- data/bundler/lib/bundler/errors.rb +58 -0
- data/bundler/lib/bundler/fetcher/base.rb +3 -1
- data/bundler/lib/bundler/fetcher/compact_index.rb +4 -4
- data/bundler/lib/bundler/fetcher/downloader.rb +13 -11
- data/bundler/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/bundler/lib/bundler/fetcher/index.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +28 -25
- data/bundler/lib/bundler/friendly_errors.rb +5 -5
- data/bundler/lib/bundler/gem_helper.rb +1 -1
- data/bundler/lib/bundler/gem_helpers.rb +12 -2
- data/bundler/lib/bundler/graph.rb +9 -9
- data/bundler/lib/bundler/index.rb +1 -2
- data/bundler/lib/bundler/injector.rb +1 -1
- data/bundler/lib/bundler/inline.rb +3 -3
- data/bundler/lib/bundler/installer/gem_installer.rb +10 -10
- data/bundler/lib/bundler/installer/parallel_installer.rb +16 -8
- data/bundler/lib/bundler/installer/standalone.rb +2 -3
- data/bundler/lib/bundler/installer.rb +9 -9
- data/bundler/lib/bundler/lazy_specification.rb +28 -17
- data/bundler/lib/bundler/lockfile_generator.rb +9 -0
- data/bundler/lib/bundler/lockfile_parser.rb +81 -10
- data/bundler/lib/bundler/man/bundle-add.1 +3 -26
- data/bundler/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/bundler/lib/bundler/man/bundle-cache.1 +3 -24
- data/bundler/lib/bundler/man/bundle-check.1 +3 -12
- data/bundler/lib/bundler/man/bundle-clean.1 +3 -10
- data/bundler/lib/bundler/man/bundle-config.1 +20 -211
- data/bundler/lib/bundler/man/bundle-config.1.ronn +6 -0
- data/bundler/lib/bundler/man/bundle-console.1 +4 -22
- data/bundler/lib/bundler/man/bundle-doctor.1 +4 -18
- data/bundler/lib/bundler/man/bundle-exec.1 +12 -73
- data/bundler/lib/bundler/man/bundle-gem.1 +13 -49
- data/bundler/lib/bundler/man/bundle-help.1 +3 -7
- data/bundler/lib/bundler/man/bundle-info.1 +3 -9
- data/bundler/lib/bundler/man/bundle-init.1 +3 -12
- data/bundler/lib/bundler/man/bundle-inject.1 +6 -19
- data/bundler/lib/bundler/man/bundle-install.1 +27 -125
- data/bundler/lib/bundler/man/bundle-install.1.ronn +1 -0
- data/bundler/lib/bundler/man/bundle-list.1 +4 -19
- data/bundler/lib/bundler/man/bundle-lock.1 +5 -29
- data/bundler/lib/bundler/man/bundle-open.1 +7 -27
- data/bundler/lib/bundler/man/bundle-outdated.1 +3 -55
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +1 -0
- data/bundler/lib/bundler/man/bundle-platform.1 +5 -27
- data/bundler/lib/bundler/man/bundle-plugin.1 +3 -29
- data/bundler/lib/bundler/man/bundle-pristine.1 +5 -16
- data/bundler/lib/bundler/man/bundle-remove.1 +4 -14
- data/bundler/lib/bundler/man/bundle-show.1 +3 -10
- data/bundler/lib/bundler/man/bundle-update.1 +18 -137
- data/bundler/lib/bundler/man/bundle-version.1 +3 -16
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -16
- data/bundler/lib/bundler/man/bundle.1 +5 -44
- data/bundler/lib/bundler/man/gemfile.5 +24 -301
- data/bundler/lib/bundler/man/gemfile.5.ronn +4 -0
- data/bundler/lib/bundler/match_metadata.rb +4 -0
- data/bundler/lib/bundler/match_platform.rb +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +3 -2
- data/bundler/lib/bundler/plugin/index.rb +8 -0
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/plugin.rb +12 -5
- data/bundler/lib/bundler/resolver/base.rb +1 -1
- data/bundler/lib/bundler/resolver/incompatibility.rb +1 -1
- data/bundler/lib/bundler/resolver/spec_group.rb +1 -4
- data/bundler/lib/bundler/resolver.rb +16 -16
- data/bundler/lib/bundler/ruby_dsl.rb +20 -12
- data/bundler/lib/bundler/ruby_version.rb +1 -1
- data/bundler/lib/bundler/rubygems_ext.rb +27 -54
- data/bundler/lib/bundler/rubygems_gem_installer.rb +23 -58
- data/bundler/lib/bundler/rubygems_integration.rb +25 -94
- data/bundler/lib/bundler/runtime.rb +2 -2
- data/bundler/lib/bundler/self_manager.rb +23 -7
- data/bundler/lib/bundler/settings.rb +27 -7
- data/bundler/lib/bundler/setup.rb +4 -1
- data/bundler/lib/bundler/shared_helpers.rb +35 -13
- data/bundler/lib/bundler/source/git/git_proxy.rb +22 -14
- data/bundler/lib/bundler/source/git.rb +4 -3
- data/bundler/lib/bundler/source/metadata.rb +16 -16
- data/bundler/lib/bundler/source/path.rb +7 -6
- data/bundler/lib/bundler/source/rubygems.rb +21 -14
- data/bundler/lib/bundler/source.rb +2 -0
- data/bundler/lib/bundler/spec_set.rb +43 -12
- data/bundler/lib/bundler/stub_specification.rb +1 -0
- data/bundler/lib/bundler/templates/Executable.bundler +1 -1
- data/bundler/lib/bundler/templates/newgem/README.md.tt +3 -3
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -6
- data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/standard.yml.tt +1 -1
- data/bundler/lib/bundler/ui/shell.rb +2 -2
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +53 -6
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +8 -20
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +4 -3
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +36 -36
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +8 -10
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +15 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +15 -15
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +16 -25
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +44 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +26 -150
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +4 -46
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -45
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +155 -8
- data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +3 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +256 -132
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +95 -31
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendored_net_http.rb +8 -0
- data/bundler/lib/bundler/vendored_persistent.rb +0 -4
- data/bundler/lib/bundler/vendored_timeout.rb +8 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/vlad.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +9 -4
- data/bundler/lib/bundler.rb +38 -35
- data/lib/rubygems/available_set.rb +4 -4
- data/lib/rubygems/basic_specification.rb +35 -37
- data/lib/rubygems/bundler_version_finder.rb +4 -4
- data/lib/rubygems/ci_detector.rb +75 -0
- data/lib/rubygems/command.rb +15 -17
- data/lib/rubygems/command_manager.rb +5 -4
- data/lib/rubygems/commands/build_command.rb +2 -2
- data/lib/rubygems/commands/cert_command.rb +2 -3
- data/lib/rubygems/commands/check_command.rb +4 -4
- data/lib/rubygems/commands/cleanup_command.rb +12 -14
- data/lib/rubygems/commands/contents_command.rb +5 -5
- data/lib/rubygems/commands/dependency_command.rb +4 -5
- data/lib/rubygems/commands/environment_command.rb +3 -5
- data/lib/rubygems/commands/exec_command.rb +1 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -2
- data/lib/rubygems/commands/generate_index_command.rb +39 -74
- data/lib/rubygems/commands/help_command.rb +4 -4
- data/lib/rubygems/commands/info_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +8 -16
- data/lib/rubygems/commands/list_command.rb +2 -2
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +1 -1
- data/lib/rubygems/commands/pristine_command.rb +13 -15
- data/lib/rubygems/commands/push_command.rb +2 -2
- data/lib/rubygems/commands/query_command.rb +4 -5
- data/lib/rubygems/commands/rdoc_command.rb +2 -2
- data/lib/rubygems/commands/search_command.rb +2 -2
- data/lib/rubygems/commands/setup_command.rb +33 -36
- data/lib/rubygems/commands/sources_command.rb +12 -12
- data/lib/rubygems/commands/specification_command.rb +10 -10
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +13 -14
- data/lib/rubygems/commands/unpack_command.rb +7 -7
- data/lib/rubygems/commands/update_command.rb +11 -13
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +1 -1
- data/lib/rubygems/compatibility.rb +5 -6
- data/lib/rubygems/config_file.rb +7 -7
- data/lib/rubygems/core_ext/kernel_gem.rb +0 -2
- data/lib/rubygems/core_ext/kernel_require.rb +20 -49
- 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 +15 -3
- data/lib/rubygems/dependency.rb +12 -14
- data/lib/rubygems/dependency_installer.rb +30 -31
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/deprecate.rb +16 -15
- data/lib/rubygems/doctor.rb +6 -6
- data/lib/rubygems/errors.rb +2 -6
- data/lib/rubygems/exceptions.rb +2 -1
- data/lib/rubygems/ext/builder.rb +15 -10
- data/lib/rubygems/ext/cargo_builder.rb +5 -5
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -4
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/gem_runner.rb +4 -4
- data/lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb +3 -3
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -3
- data/lib/rubygems/gemcutter_utilities.rb +18 -19
- data/lib/rubygems/install_update_options.rb +18 -19
- data/lib/rubygems/installer.rb +66 -45
- data/lib/rubygems/installer_uninstaller_utils.rb +0 -2
- data/lib/rubygems/local_remote_options.rb +8 -11
- data/lib/rubygems/name_tuple.rb +7 -9
- data/lib/rubygems/net/http.rb +3 -0
- data/lib/rubygems/net-http/LICENSE.txt +22 -0
- data/lib/rubygems/net-http/lib/net/http/backward.rb +40 -0
- data/lib/rubygems/net-http/lib/net/http/exceptions.rb +34 -0
- data/lib/rubygems/net-http/lib/net/http/generic_request.rb +414 -0
- data/lib/rubygems/net-http/lib/net/http/header.rb +981 -0
- data/lib/rubygems/net-http/lib/net/http/proxy_delta.rb +17 -0
- data/lib/rubygems/net-http/lib/net/http/request.rb +88 -0
- data/lib/rubygems/net-http/lib/net/http/requests.rb +425 -0
- data/lib/rubygems/net-http/lib/net/http/response.rb +738 -0
- data/lib/rubygems/net-http/lib/net/http/responses.rb +1174 -0
- data/lib/rubygems/net-http/lib/net/http/status.rb +84 -0
- data/lib/rubygems/net-http/lib/net/http.rb +2496 -0
- data/lib/rubygems/net-http/lib/net/https.rb +23 -0
- data/lib/rubygems/net-protocol/LICENSE.txt +22 -0
- data/lib/rubygems/net-protocol/lib/net/protocol.rb +544 -0
- data/lib/rubygems/optparse/lib/optparse.rb +39 -17
- data/lib/rubygems/package/digest_io.rb +1 -1
- data/lib/rubygems/package/old.rb +2 -2
- data/lib/rubygems/package/tar_header.rb +45 -39
- data/lib/rubygems/package/tar_reader/entry.rb +5 -4
- data/lib/rubygems/package/tar_reader.rb +14 -5
- data/lib/rubygems/package/tar_writer.rb +20 -18
- data/lib/rubygems/package.rb +28 -27
- data/lib/rubygems/package_task.rb +2 -2
- data/lib/rubygems/path_support.rb +10 -11
- data/lib/rubygems/platform.rb +65 -48
- data/lib/rubygems/query_utils.rb +7 -9
- data/lib/rubygems/remote_fetcher.rb +17 -17
- data/lib/rubygems/request/connection_pools.rb +3 -3
- data/lib/rubygems/request.rb +20 -17
- data/lib/rubygems/request_set/gem_dependency_api.rb +120 -123
- data/lib/rubygems/request_set/lockfile/parser.rb +9 -9
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +20 -12
- data/lib/rubygems/request_set/lockfile.rb +6 -11
- data/lib/rubygems/request_set.rb +5 -5
- data/lib/rubygems/requirement.rb +7 -7
- data/lib/rubygems/resolv/LICENSE.txt +22 -0
- data/lib/rubygems/resolv/lib/resolv.rb +3387 -0
- data/lib/rubygems/resolver/activation_request.rb +1 -3
- data/lib/rubygems/resolver/api_set/gem_parser.rb +7 -3
- data/lib/rubygems/resolver/best_set.rb +1 -1
- data/lib/rubygems/resolver/composed_set.rb +1 -1
- data/lib/rubygems/resolver/conflict.rb +4 -12
- data/lib/rubygems/resolver/index_set.rb +4 -4
- data/lib/rubygems/resolver/index_specification.rb +2 -2
- data/lib/rubygems/resolver/installer_set.rb +5 -6
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver.rb +6 -13
- data/lib/rubygems/s3_uri_signer.rb +6 -6
- data/lib/rubygems/safe_marshal/elements.rb +138 -0
- data/lib/rubygems/safe_marshal/reader.rb +306 -0
- data/lib/rubygems/safe_marshal/visitors/stream_printer.rb +31 -0
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +385 -0
- data/lib/rubygems/safe_marshal/visitors/visitor.rb +74 -0
- data/lib/rubygems/safe_marshal.rb +74 -0
- data/lib/rubygems/safe_yaml.rb +5 -28
- data/lib/rubygems/security/policies.rb +36 -38
- data/lib/rubygems/security/policy.rb +7 -11
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/security/trust_dir.rb +4 -4
- data/lib/rubygems/security.rb +8 -22
- data/lib/rubygems/source/git.rb +1 -3
- data/lib/rubygems/source/installed.rb +0 -2
- data/lib/rubygems/source/local.rb +7 -9
- data/lib/rubygems/source/lock.rb +1 -3
- data/lib/rubygems/source/specific_file.rb +0 -1
- data/lib/rubygems/source/vendor.rb +0 -2
- data/lib/rubygems/source.rb +12 -12
- data/lib/rubygems/source_list.rb +5 -5
- data/lib/rubygems/spec_fetcher.rb +31 -31
- data/lib/rubygems/specification.rb +145 -150
- data/lib/rubygems/specification_policy.rb +61 -31
- data/lib/rubygems/stub_specification.rb +4 -5
- data/lib/rubygems/text.rb +1 -2
- data/lib/rubygems/timeout/LICENSE.txt +22 -0
- data/lib/rubygems/timeout/lib/timeout.rb +199 -0
- data/lib/rubygems/timeout.rb +3 -0
- data/lib/rubygems/tsort/lib/tsort.rb +3 -0
- data/lib/rubygems/uninstaller.rb +9 -11
- data/lib/rubygems/update_suggestion.rb +5 -18
- data/lib/rubygems/uri_formatter.rb +1 -1
- data/lib/rubygems/user_interaction.rb +17 -23
- data/lib/rubygems/util/licenses.rb +113 -35
- data/lib/rubygems/util/list.rb +3 -1
- data/lib/rubygems/util.rb +2 -4
- data/lib/rubygems/validator.rb +6 -4
- data/lib/rubygems/version.rb +35 -29
- data/lib/rubygems/version_option.rb +2 -5
- data/lib/rubygems/yaml_serializer.rb +9 -4
- data/lib/rubygems.rb +42 -42
- data/rubygems-update.gemspec +4 -4
- data/setup.rb +2 -2
- metadata +43 -225
- data/lib/rubygems/indexer.rb +0 -428
- data/lib/rubygems/mock_gem_ui.rb +0 -86
- data/test/rubygems/alternate_cert.pem +0 -19
- data/test/rubygems/alternate_cert_32.pem +0 -19
- data/test/rubygems/alternate_key.pem +0 -27
- data/test/rubygems/bad_rake.rb +0 -3
- data/test/rubygems/bundler_test_gem.rb +0 -424
- data/test/rubygems/ca_cert.pem +0 -77
- data/test/rubygems/child_cert.pem +0 -19
- data/test/rubygems/child_cert_32.pem +0 -19
- data/test/rubygems/child_key.pem +0 -27
- data/test/rubygems/client.pem +0 -107
- data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
- data/test/rubygems/data/gem-private_key.pem +0 -27
- data/test/rubygems/data/gem-public_cert.pem +0 -20
- data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
- data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
- data/test/rubygems/data/pry-0.4.7.gemspec.rz +0 -0
- data/test/rubygems/encrypted_private_key.pem +0 -30
- data/test/rubygems/expired_cert.pem +0 -19
- data/test/rubygems/fake_certlib/openssl.rb +0 -9
- data/test/rubygems/foo/discover.rb +0 -1
- data/test/rubygems/future_cert.pem +0 -19
- data/test/rubygems/future_cert_32.pem +0 -19
- data/test/rubygems/good_rake.rb +0 -3
- data/test/rubygems/grandchild_cert.pem +0 -19
- data/test/rubygems/grandchild_cert_32.pem +0 -19
- data/test/rubygems/grandchild_key.pem +0 -27
- data/test/rubygems/helper.rb +0 -1649
- data/test/rubygems/installer_test_case.rb +0 -248
- data/test/rubygems/invalid_client.pem +0 -49
- data/test/rubygems/invalid_issuer_cert.pem +0 -20
- data/test/rubygems/invalid_issuer_cert_32.pem +0 -20
- data/test/rubygems/invalid_key.pem +0 -27
- data/test/rubygems/invalid_signer_cert.pem +0 -19
- data/test/rubygems/invalid_signer_cert_32.pem +0 -19
- data/test/rubygems/invalidchild_cert.pem +0 -19
- data/test/rubygems/invalidchild_cert_32.pem +0 -19
- data/test/rubygems/invalidchild_key.pem +0 -27
- data/test/rubygems/multifactor_auth_utilities.rb +0 -111
- data/test/rubygems/package/tar_test_case.rb +0 -175
- data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
- data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +0 -4
- data/test/rubygems/plugin/load/rubygems_plugin.rb +0 -5
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +0 -4
- data/test/rubygems/private3072_key.pem +0 -40
- data/test/rubygems/private_ec_key.pem +0 -9
- data/test/rubygems/private_key.pem +0 -27
- data/test/rubygems/public3072_cert.pem +0 -25
- data/test/rubygems/public_cert.pem +0 -20
- data/test/rubygems/public_cert_32.pem +0 -19
- data/test/rubygems/public_key.pem +0 -9
- data/test/rubygems/rubygems/commands/crash_command.rb +0 -5
- data/test/rubygems/rubygems_plugin.rb +0 -24
- data/test/rubygems/sff/discover.rb +0 -1
- data/test/rubygems/simple_gem.rb +0 -68
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -9
- data/test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec +0 -0
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +0 -14
- data/test/rubygems/ssl_cert.pem +0 -80
- data/test/rubygems/ssl_key.pem +0 -27
- data/test/rubygems/test_bundled_ca.rb +0 -61
- data/test/rubygems/test_config.rb +0 -28
- data/test/rubygems/test_deprecate.rb +0 -158
- data/test/rubygems/test_exit.rb +0 -17
- data/test/rubygems/test_gem.rb +0 -1799
- data/test/rubygems/test_gem_available_set.rb +0 -130
- data/test/rubygems/test_gem_bundler_version_finder.rb +0 -127
- data/test/rubygems/test_gem_command.rb +0 -403
- data/test/rubygems/test_gem_command_manager.rb +0 -400
- data/test/rubygems/test_gem_commands_build_command.rb +0 -739
- data/test/rubygems/test_gem_commands_cert_command.rb +0 -866
- data/test/rubygems/test_gem_commands_check_command.rb +0 -68
- data/test/rubygems/test_gem_commands_cleanup_command.rb +0 -292
- data/test/rubygems/test_gem_commands_contents_command.rb +0 -271
- data/test/rubygems/test_gem_commands_dependency_command.rb +0 -228
- data/test/rubygems/test_gem_commands_environment_command.rb +0 -169
- data/test/rubygems/test_gem_commands_exec_command.rb +0 -857
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -258
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -81
- data/test/rubygems/test_gem_commands_help_command.rb +0 -94
- data/test/rubygems/test_gem_commands_info_command.rb +0 -70
- data/test/rubygems/test_gem_commands_install_command.rb +0 -1573
- data/test/rubygems/test_gem_commands_list_command.rb +0 -33
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -67
- data/test/rubygems/test_gem_commands_mirror.rb +0 -20
- data/test/rubygems/test_gem_commands_open_command.rb +0 -101
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -50
- data/test/rubygems/test_gem_commands_owner_command.rb +0 -503
- data/test/rubygems/test_gem_commands_pristine_command.rb +0 -708
- data/test/rubygems/test_gem_commands_push_command.rb +0 -603
- data/test/rubygems/test_gem_commands_query_command.rb +0 -858
- data/test/rubygems/test_gem_commands_search_command.rb +0 -16
- data/test/rubygems/test_gem_commands_server_command.rb +0 -20
- data/test/rubygems/test_gem_commands_setup_command.rb +0 -474
- data/test/rubygems/test_gem_commands_signin_command.rb +0 -259
- data/test/rubygems/test_gem_commands_signout_command.rb +0 -30
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -534
- data/test/rubygems/test_gem_commands_specification_command.rb +0 -277
- data/test/rubygems/test_gem_commands_stale_command.rb +0 -43
- data/test/rubygems/test_gem_commands_uninstall_command.rb +0 -522
- data/test/rubygems/test_gem_commands_unpack_command.rb +0 -224
- data/test/rubygems/test_gem_commands_update_command.rb +0 -836
- data/test/rubygems/test_gem_commands_which_command.rb +0 -85
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -299
- data/test/rubygems/test_gem_config_file.rb +0 -551
- data/test/rubygems/test_gem_dependency.rb +0 -398
- data/test/rubygems/test_gem_dependency_installer.rb +0 -1190
- data/test/rubygems/test_gem_dependency_list.rb +0 -265
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -27
- data/test/rubygems/test_gem_doctor.rb +0 -195
- data/test/rubygems/test_gem_ext_builder.rb +0 -337
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/.gitignore +0 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +0 -249
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/src/lib.rs +0 -27
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/lib/custom_name.rb +0 -3
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/.gitignore +0 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +0 -249
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +0 -51
- data/test/rubygems/test_gem_ext_cargo_builder.rb +0 -167
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +0 -34
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -60
- data/test/rubygems/test_gem_ext_cmake_builder.rb +0 -84
- data/test/rubygems/test_gem_ext_configure_builder.rb +0 -80
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -229
- data/test/rubygems/test_gem_ext_rake_builder.rb +0 -113
- data/test/rubygems/test_gem_gem_runner.rb +0 -119
- data/test/rubygems/test_gem_gemcutter_utilities.rb +0 -361
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -60
- data/test/rubygems/test_gem_indexer.rb +0 -381
- data/test/rubygems/test_gem_install_update_options.rb +0 -208
- data/test/rubygems/test_gem_installer.rb +0 -2512
- data/test/rubygems/test_gem_local_remote_options.rb +0 -133
- data/test/rubygems/test_gem_name_tuple.rb +0 -43
- data/test/rubygems/test_gem_package.rb +0 -1306
- data/test/rubygems/test_gem_package_old.rb +0 -91
- data/test/rubygems/test_gem_package_tar_header.rb +0 -226
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -135
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +0 -350
- data/test/rubygems/test_gem_package_tar_writer.rb +0 -331
- data/test/rubygems/test_gem_package_task.rb +0 -118
- data/test/rubygems/test_gem_path_support.rb +0 -139
- data/test/rubygems/test_gem_platform.rb +0 -497
- data/test/rubygems/test_gem_rdoc.rb +0 -137
- data/test/rubygems/test_gem_remote_fetcher.rb +0 -1227
- data/test/rubygems/test_gem_request.rb +0 -547
- data/test/rubygems/test_gem_request_connection_pools.rb +0 -152
- data/test/rubygems/test_gem_request_set.rb +0 -672
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +0 -853
- data/test/rubygems/test_gem_request_set_lockfile.rb +0 -469
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +0 -544
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +0 -307
- data/test/rubygems/test_gem_requirement.rb +0 -505
- data/test/rubygems/test_gem_resolver.rb +0 -859
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -43
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -210
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -167
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -159
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -44
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -82
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -83
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -188
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -114
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -88
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -93
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -47
- data/test/rubygems/test_gem_resolver_installer_set.rb +0 -320
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -44
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -62
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -98
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -19
- data/test/rubygems/test_gem_resolver_specification.rb +0 -63
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -82
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -82
- data/test/rubygems/test_gem_security.rb +0 -341
- data/test/rubygems/test_gem_security_policy.rb +0 -535
- data/test/rubygems/test_gem_security_signer.rb +0 -218
- data/test/rubygems/test_gem_security_trust_dir.rb +0 -99
- data/test/rubygems/test_gem_silent_ui.rb +0 -123
- data/test/rubygems/test_gem_source.rb +0 -254
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -37
- data/test/rubygems/test_gem_source_git.rb +0 -310
- data/test/rubygems/test_gem_source_installed.rb +0 -35
- data/test/rubygems/test_gem_source_list.rb +0 -119
- data/test/rubygems/test_gem_source_local.rb +0 -107
- data/test/rubygems/test_gem_source_lock.rb +0 -113
- data/test/rubygems/test_gem_source_specific_file.rb +0 -76
- data/test/rubygems/test_gem_source_subpath_problem.rb +0 -50
- data/test/rubygems/test_gem_source_vendor.rb +0 -30
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -338
- data/test/rubygems/test_gem_specification.rb +0 -3856
- data/test/rubygems/test_gem_stream_ui.rb +0 -255
- data/test/rubygems/test_gem_stub_specification.rb +0 -278
- data/test/rubygems/test_gem_text.rb +0 -103
- data/test/rubygems/test_gem_uninstaller.rb +0 -675
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -31
- data/test/rubygems/test_gem_update_suggestion.rb +0 -209
- data/test/rubygems/test_gem_uri.rb +0 -41
- data/test/rubygems/test_gem_uri_formatter.rb +0 -27
- data/test/rubygems/test_gem_util.rb +0 -91
- data/test/rubygems/test_gem_validator.rb +0 -42
- data/test/rubygems/test_gem_version.rb +0 -305
- data/test/rubygems/test_gem_version_option.rb +0 -165
- data/test/rubygems/test_kernel.rb +0 -124
- data/test/rubygems/test_project_sanity.rb +0 -49
- data/test/rubygems/test_remote_fetch_error.rb +0 -20
- data/test/rubygems/test_require.rb +0 -732
- data/test/rubygems/test_rubygems.rb +0 -76
- data/test/rubygems/test_webauthn_listener.rb +0 -143
- data/test/rubygems/test_webauthn_listener_response.rb +0 -93
- data/test/rubygems/test_webauthn_poller.rb +0 -124
- data/test/rubygems/utilities.rb +0 -436
- data/test/rubygems/wrong_key_cert.pem +0 -19
- data/test/rubygems/wrong_key_cert_32.pem +0 -19
- data/test/test_changelog_generator.rb +0 -17
data/lib/rubygems/installer.rb
CHANGED
@@ -189,10 +189,12 @@ class Gem::Installer
|
|
189
189
|
@package.prog_mode = options[:prog_mode]
|
190
190
|
@package.data_mode = options[:data_mode]
|
191
191
|
|
192
|
-
if
|
193
|
-
|
194
|
-
|
195
|
-
|
192
|
+
if @gem_home == Gem.user_dir
|
193
|
+
# If we get here, then one of the following likely happened:
|
194
|
+
# - `--user-install` was specified
|
195
|
+
# - `Gem::PathSupport#home` fell back to `Gem.user_dir`
|
196
|
+
# - GEM_HOME was manually set to `Gem.user_dir`
|
197
|
+
|
196
198
|
check_that_user_bin_dir_is_in_path
|
197
199
|
end
|
198
200
|
end
|
@@ -222,31 +224,32 @@ class Gem::Installer
|
|
222
224
|
|
223
225
|
File.open generated_bin, "rb" do |io|
|
224
226
|
line = io.gets
|
225
|
-
shebang = /^#!.*ruby/
|
227
|
+
shebang = /^#!.*ruby/o
|
226
228
|
|
227
|
-
|
228
|
-
|
229
|
+
# TruffleRuby uses a bash prelude in default launchers
|
230
|
+
if load_relative_enabled? || RUBY_ENGINE == "truffleruby"
|
231
|
+
until line.nil? || shebang.match?(line) do
|
229
232
|
line = io.gets
|
230
233
|
end
|
231
234
|
end
|
232
235
|
|
233
|
-
next unless line
|
236
|
+
next unless line&.match?(shebang)
|
234
237
|
|
235
238
|
io.gets # blankline
|
236
239
|
|
237
|
-
# TODO detect a specially formatted comment instead of trying
|
240
|
+
# TODO: detect a specially formatted comment instead of trying
|
238
241
|
# to find a string inside Ruby code.
|
239
|
-
next unless io.gets
|
242
|
+
next unless io.gets&.include?("This file was generated by RubyGems")
|
240
243
|
|
241
244
|
ruby_executable = true
|
242
|
-
existing = io.read.slice(
|
245
|
+
existing = io.read.slice(/
|
243
246
|
^\s*(
|
244
247
|
gem \s |
|
245
248
|
load \s Gem\.bin_path\( |
|
246
249
|
load \s Gem\.activate_bin_path\(
|
247
250
|
)
|
248
251
|
(['"])(.*?)(\2),
|
249
|
-
|
252
|
+
/x, 3)
|
250
253
|
end
|
251
254
|
|
252
255
|
return if spec.name == existing
|
@@ -316,7 +319,7 @@ class Gem::Installer
|
|
316
319
|
FileUtils.rm_rf spec.extension_dir
|
317
320
|
|
318
321
|
dir_mode = options[:dir_mode]
|
319
|
-
FileUtils.mkdir_p gem_dir, :
|
322
|
+
FileUtils.mkdir_p gem_dir, mode: dir_mode && 0o755
|
320
323
|
|
321
324
|
if @options[:install_as_default]
|
322
325
|
extract_bin
|
@@ -348,11 +351,9 @@ class Gem::Installer
|
|
348
351
|
run_post_install_hooks
|
349
352
|
|
350
353
|
spec
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
rescue Zlib::GzipFile::Error
|
355
|
-
raise Gem::InstallError, "gzip error installing #{gem}"
|
354
|
+
rescue Errno::EACCES => e
|
355
|
+
# Permission denied - /path/to/foo
|
356
|
+
raise Gem::FilePermissionError, e.message.split(" - ").last
|
356
357
|
end
|
357
358
|
|
358
359
|
def run_pre_install_hooks # :nodoc:
|
@@ -393,7 +394,7 @@ class Gem::Installer
|
|
393
394
|
specs = []
|
394
395
|
|
395
396
|
Gem::Util.glob_files_in_dir("*.gemspec", File.join(gem_home, "specifications")).each do |path|
|
396
|
-
spec = Gem::Specification.load path
|
397
|
+
spec = Gem::Specification.load path
|
397
398
|
specs << spec if spec
|
398
399
|
end
|
399
400
|
|
@@ -463,6 +464,9 @@ class Gem::Installer
|
|
463
464
|
##
|
464
465
|
# Writes the full .gemspec specification (in Ruby) to the gem home's
|
465
466
|
# specifications/default directory.
|
467
|
+
#
|
468
|
+
# In contrast to #write_spec, this keeps file lists, so the `gem contents`
|
469
|
+
# command works.
|
466
470
|
|
467
471
|
def write_default_spec
|
468
472
|
Gem.write_binary(default_spec_file, spec.to_ruby)
|
@@ -489,7 +493,6 @@ class Gem::Installer
|
|
489
493
|
ensure_writable_dir @bin_dir
|
490
494
|
|
491
495
|
spec.executables.each do |filename|
|
492
|
-
filename.tap(&Gem::UNTAINT)
|
493
496
|
bin_path = File.join gem_dir, spec.bindir, filename
|
494
497
|
next unless File.exist? bin_path
|
495
498
|
|
@@ -522,6 +525,8 @@ class Gem::Installer
|
|
522
525
|
else
|
523
526
|
regenerate_plugins_for(spec, @plugins_dir)
|
524
527
|
end
|
528
|
+
rescue ArgumentError => e
|
529
|
+
raise e, "#{latest.name} #{latest.version} #{spec.name} #{spec.version}: #{e.message}"
|
525
530
|
end
|
526
531
|
|
527
532
|
##
|
@@ -529,7 +534,7 @@ class Gem::Installer
|
|
529
534
|
#--
|
530
535
|
# The Windows script is generated in addition to the regular one due to a
|
531
536
|
# bug or misfeature in the Windows shell's pipe. See
|
532
|
-
#
|
537
|
+
# https://blade.ruby-lang.org/ruby-talk/193379
|
533
538
|
|
534
539
|
def generate_bin_script(filename, bindir)
|
535
540
|
bin_script_path = File.join bindir, formatted_program_filename(filename)
|
@@ -564,7 +569,7 @@ class Gem::Installer
|
|
564
569
|
File.unlink dst
|
565
570
|
end
|
566
571
|
|
567
|
-
FileUtils.symlink src, dst, :
|
572
|
+
FileUtils.symlink src, dst, verbose: Gem.configuration.really_verbose
|
568
573
|
rescue NotImplementedError, SystemCallError
|
569
574
|
alert_warning "Unable to use symlinks, installing wrapper"
|
570
575
|
generate_bin_script filename, bindir
|
@@ -587,7 +592,7 @@ class Gem::Installer
|
|
587
592
|
|
588
593
|
def shebang(bin_file_name)
|
589
594
|
path = File.join gem_dir, spec.bindir, bin_file_name
|
590
|
-
first_line = File.open(path, "rb"
|
595
|
+
first_line = File.open(path, "rb", &:gets) || ""
|
591
596
|
|
592
597
|
if first_line.start_with?("#!")
|
593
598
|
# Preserve extra words on shebang line, like "-w". Thanks RPA.
|
@@ -629,7 +634,6 @@ class Gem::Installer
|
|
629
634
|
|
630
635
|
def ensure_loadable_spec
|
631
636
|
ruby = spec.to_ruby_for_cache
|
632
|
-
ruby.tap(&Gem::UNTAINT)
|
633
637
|
|
634
638
|
begin
|
635
639
|
eval ruby
|
@@ -650,32 +654,37 @@ class Gem::Installer
|
|
650
654
|
|
651
655
|
def process_options # :nodoc:
|
652
656
|
@options = {
|
653
|
-
:
|
654
|
-
:
|
655
|
-
:
|
656
|
-
:
|
657
|
-
:
|
657
|
+
bin_dir: nil,
|
658
|
+
env_shebang: false,
|
659
|
+
force: false,
|
660
|
+
only_install_dir: false,
|
661
|
+
post_install_message: true,
|
658
662
|
}.merge options
|
659
663
|
|
660
664
|
@env_shebang = options[:env_shebang]
|
661
665
|
@force = options[:force]
|
662
666
|
@install_dir = options[:install_dir]
|
663
|
-
@
|
664
|
-
@plugins_dir = Gem.plugindir(@gem_home)
|
667
|
+
@user_install = options[:user_install]
|
665
668
|
@ignore_dependencies = options[:ignore_dependencies]
|
666
669
|
@format_executable = options[:format_executable]
|
667
670
|
@wrappers = options[:wrappers]
|
668
671
|
@only_install_dir = options[:only_install_dir]
|
669
672
|
|
670
|
-
|
671
|
-
# the system gem directory, then use the system bin directory, else create
|
672
|
-
# (or use) a new bin dir under the gem_home.
|
673
|
-
@bin_dir = options[:bin_dir] || Gem.bindir(gem_home)
|
673
|
+
@bin_dir = options[:bin_dir]
|
674
674
|
@development = options[:development]
|
675
675
|
@build_root = options[:build_root]
|
676
676
|
|
677
677
|
@build_args = options[:build_args]
|
678
678
|
|
679
|
+
@gem_home = @install_dir || user_install_dir || Gem.dir
|
680
|
+
|
681
|
+
# If the user has asked for the gem to be installed in a directory that is
|
682
|
+
# the system gem directory, then use the system bin directory, else create
|
683
|
+
# (or use) a new bin dir under the gem_home.
|
684
|
+
@bin_dir ||= Gem.bindir(@gem_home)
|
685
|
+
|
686
|
+
@plugins_dir = Gem.plugindir(@gem_home)
|
687
|
+
|
679
688
|
unless @build_root.nil?
|
680
689
|
@bin_dir = File.join(@build_root, @bin_dir.gsub(/^[a-zA-Z]:/, ""))
|
681
690
|
@gem_home = File.join(@build_root, @gem_home.gsub(/^[a-zA-Z]:/, ""))
|
@@ -709,12 +718,11 @@ class Gem::Installer
|
|
709
718
|
end
|
710
719
|
|
711
720
|
def verify_gem_home # :nodoc:
|
712
|
-
FileUtils.mkdir_p gem_home, :
|
713
|
-
raise Gem::FilePermissionError, gem_home unless File.writable?(gem_home)
|
721
|
+
FileUtils.mkdir_p gem_home, mode: options[:dir_mode] && 0o755
|
714
722
|
end
|
715
723
|
|
716
724
|
def verify_spec
|
717
|
-
unless
|
725
|
+
unless Gem::Specification::VALID_NAME_PATTERN.match?(spec.name)
|
718
726
|
raise Gem::InstallError, "#{spec} has an invalid name"
|
719
727
|
end
|
720
728
|
|
@@ -726,11 +734,11 @@ class Gem::Installer
|
|
726
734
|
raise Gem::InstallError, "#{spec} has an invalid extensions"
|
727
735
|
end
|
728
736
|
|
729
|
-
if spec.platform.to_s
|
737
|
+
if /\R/.match?(spec.platform.to_s)
|
730
738
|
raise Gem::InstallError, "#{spec.platform} is an invalid platform"
|
731
739
|
end
|
732
740
|
|
733
|
-
unless
|
741
|
+
unless /\A\d+\z/.match?(spec.specification_version.to_s)
|
734
742
|
raise Gem::InstallError, "#{spec} has an invalid specification_version"
|
735
743
|
end
|
736
744
|
|
@@ -747,9 +755,9 @@ class Gem::Installer
|
|
747
755
|
# Return the text for an application file.
|
748
756
|
|
749
757
|
def app_script_text(bin_file_name)
|
750
|
-
#
|
758
|
+
# NOTE: that the `load` lines cannot be indented, as old RG versions match
|
751
759
|
# against the beginning of the line
|
752
|
-
|
760
|
+
<<-TEXT
|
753
761
|
#{shebang bin_file_name}
|
754
762
|
#
|
755
763
|
# This file was generated by RubyGems.
|
@@ -809,7 +817,7 @@ TEXT
|
|
809
817
|
ruby_exe = "#{rb_config["RUBY_INSTALL_NAME"]}#{rb_config["EXEEXT"]}"
|
810
818
|
ruby_exe = "ruby.exe" if ruby_exe.empty?
|
811
819
|
|
812
|
-
if File.exist?(File.join
|
820
|
+
if File.exist?(File.join(bindir, ruby_exe))
|
813
821
|
# stub & ruby.exe within same folder. Portable
|
814
822
|
<<-TEXT
|
815
823
|
@ECHO OFF
|
@@ -931,7 +939,7 @@ TEXT
|
|
931
939
|
build_info_dir = File.join gem_home, "build_info"
|
932
940
|
|
933
941
|
dir_mode = options[:dir_mode]
|
934
|
-
FileUtils.mkdir_p build_info_dir, :
|
942
|
+
FileUtils.mkdir_p build_info_dir, mode: dir_mode && 0o755
|
935
943
|
|
936
944
|
build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
|
937
945
|
|
@@ -964,6 +972,19 @@ TEXT
|
|
964
972
|
|
965
973
|
private
|
966
974
|
|
975
|
+
def user_install_dir
|
976
|
+
# never install to user home in --build-root mode
|
977
|
+
return unless @build_root.nil?
|
978
|
+
|
979
|
+
# Please note that @user_install might have three states:
|
980
|
+
# * `true`: `--user-install`
|
981
|
+
# * `false`: `--no-user-install` and
|
982
|
+
# * `nil`: option was not specified
|
983
|
+
if @user_install || (@user_install.nil? && Gem.default_user_install)
|
984
|
+
Gem.user_dir
|
985
|
+
end
|
986
|
+
end
|
987
|
+
|
967
988
|
def build_args
|
968
989
|
@build_args ||= begin
|
969
990
|
require_relative "command"
|
@@ -989,7 +1010,7 @@ TEXT
|
|
989
1010
|
bindir="${0%/*}"
|
990
1011
|
EOS
|
991
1012
|
|
992
|
-
script << %
|
1013
|
+
script << %(exec "$bindir/#{ruby_install_name}" "-x" "$0" "$@"\n)
|
993
1014
|
|
994
1015
|
<<~EOS
|
995
1016
|
#!/bin/sh
|
@@ -4,7 +4,6 @@
|
|
4
4
|
# Helper methods for both Gem::Installer and Gem::Uninstaller
|
5
5
|
|
6
6
|
module Gem::InstallerUninstallerUtils
|
7
|
-
|
8
7
|
def regenerate_plugins_for(spec, plugins_dir)
|
9
8
|
plugins = spec.plugins
|
10
9
|
return if plugins.empty?
|
@@ -25,5 +24,4 @@ module Gem::InstallerUninstallerUtils
|
|
25
24
|
def remove_plugins_for(spec, plugins_dir)
|
26
25
|
FileUtils.rm_f Gem::Util.glob_files_in_dir("#{spec.name}#{Gem.plugin_suffix_pattern}", plugins_dir)
|
27
26
|
end
|
28
|
-
|
29
27
|
end
|
@@ -13,7 +13,6 @@ require_relative "../rubygems"
|
|
13
13
|
# Mixin methods for local and remote Gem::Command options.
|
14
14
|
|
15
15
|
module Gem::LocalRemoteOptions
|
16
|
-
|
17
16
|
##
|
18
17
|
# Allows Gem::OptionParser to handle HTTP URIs.
|
19
18
|
|
@@ -40,17 +39,17 @@ module Gem::LocalRemoteOptions
|
|
40
39
|
|
41
40
|
def add_local_remote_options
|
42
41
|
add_option(:"Local/Remote", "-l", "--local",
|
43
|
-
"Restrict operations to the LOCAL domain") do |
|
42
|
+
"Restrict operations to the LOCAL domain") do |_value, options|
|
44
43
|
options[:domain] = :local
|
45
44
|
end
|
46
45
|
|
47
46
|
add_option(:"Local/Remote", "-r", "--remote",
|
48
|
-
"Restrict operations to the REMOTE domain") do |
|
47
|
+
"Restrict operations to the REMOTE domain") do |_value, options|
|
49
48
|
options[:domain] = :remote
|
50
49
|
end
|
51
50
|
|
52
51
|
add_option(:"Local/Remote", "-b", "--both",
|
53
|
-
"Allow LOCAL and REMOTE operations") do |
|
52
|
+
"Allow LOCAL and REMOTE operations") do |_value, options|
|
54
53
|
options[:domain] = :both
|
55
54
|
end
|
56
55
|
|
@@ -67,8 +66,7 @@ module Gem::LocalRemoteOptions
|
|
67
66
|
def add_bulk_threshold_option
|
68
67
|
add_option(:"Local/Remote", "-B", "--bulk-threshold COUNT",
|
69
68
|
"Threshold for switching to bulk",
|
70
|
-
"synchronization (default #{Gem.configuration.bulk_threshold})") do
|
71
|
-
|value, options|
|
69
|
+
"synchronization (default #{Gem.configuration.bulk_threshold})") do |value, _options|
|
72
70
|
Gem.configuration.bulk_threshold = value.to_i
|
73
71
|
end
|
74
72
|
end
|
@@ -78,7 +76,7 @@ module Gem::LocalRemoteOptions
|
|
78
76
|
|
79
77
|
def add_clear_sources_option
|
80
78
|
add_option(:"Local/Remote", "--clear-sources",
|
81
|
-
"Clear the gem sources") do |
|
79
|
+
"Clear the gem sources") do |_value, options|
|
82
80
|
Gem.sources = nil
|
83
81
|
options[:sources_cleared] = true
|
84
82
|
end
|
@@ -92,7 +90,7 @@ module Gem::LocalRemoteOptions
|
|
92
90
|
|
93
91
|
add_option(:"Local/Remote", "-p", "--[no-]http-proxy [URL]", URI::HTTP,
|
94
92
|
"Use HTTP proxy for remote operations") do |value, options|
|
95
|
-
options[:http_proxy] =
|
93
|
+
options[:http_proxy] = value == false ? :no_proxy : value
|
96
94
|
Gem.configuration[:http_proxy] = options[:http_proxy]
|
97
95
|
end
|
98
96
|
end
|
@@ -105,7 +103,7 @@ module Gem::LocalRemoteOptions
|
|
105
103
|
|
106
104
|
add_option(:"Local/Remote", "-s", "--source URL", URI::HTTP,
|
107
105
|
"Append URL to list of remote gem sources") do |source, options|
|
108
|
-
source << "/"
|
106
|
+
source << "/" unless source.end_with?("/")
|
109
107
|
|
110
108
|
if options.delete :sources_cleared
|
111
109
|
Gem.sources = [source]
|
@@ -120,7 +118,7 @@ module Gem::LocalRemoteOptions
|
|
120
118
|
|
121
119
|
def add_update_sources_option
|
122
120
|
add_option(:Deprecated, "-u", "--[no-]update-sources",
|
123
|
-
"Update local source cache") do |value,
|
121
|
+
"Update local source cache") do |value, _options|
|
124
122
|
Gem.configuration.update_sources = value
|
125
123
|
end
|
126
124
|
end
|
@@ -145,5 +143,4 @@ module Gem::LocalRemoteOptions
|
|
145
143
|
def remote?
|
146
144
|
options[:domain] == :remote || options[:domain] == :both
|
147
145
|
end
|
148
|
-
|
149
146
|
end
|
data/lib/rubygems/name_tuple.rb
CHANGED
@@ -6,14 +6,12 @@
|
|
6
6
|
# wrap the data returned from the indexes.
|
7
7
|
|
8
8
|
class Gem::NameTuple
|
9
|
-
def initialize(name, version, platform=
|
9
|
+
def initialize(name, version, platform=Gem::Platform::RUBY)
|
10
10
|
@name = name
|
11
11
|
@version = version
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
|
13
|
+
platform &&= platform.to_s
|
14
|
+
platform = Gem::Platform::RUBY if !platform || platform.empty?
|
17
15
|
@platform = platform
|
18
16
|
end
|
19
17
|
|
@@ -32,7 +30,7 @@ class Gem::NameTuple
|
|
32
30
|
# [name, version, platform] tuples.
|
33
31
|
|
34
32
|
def self.to_basic(list)
|
35
|
-
list.map
|
33
|
+
list.map(&:to_a)
|
36
34
|
end
|
37
35
|
|
38
36
|
##
|
@@ -49,11 +47,11 @@ class Gem::NameTuple
|
|
49
47
|
|
50
48
|
def full_name
|
51
49
|
case @platform
|
52
|
-
when nil, "
|
50
|
+
when nil, "", Gem::Platform::RUBY
|
53
51
|
"#{@name}-#{@version}"
|
54
52
|
else
|
55
53
|
"#{@name}-#{@version}-#{@platform}"
|
56
|
-
end
|
54
|
+
end
|
57
55
|
end
|
58
56
|
|
59
57
|
##
|
@@ -87,7 +85,7 @@ class Gem::NameTuple
|
|
87
85
|
"#<Gem::NameTuple #{@name}, #{@version}, #{@platform}>"
|
88
86
|
end
|
89
87
|
|
90
|
-
|
88
|
+
alias_method :to_s, :inspect # :nodoc:
|
91
89
|
|
92
90
|
def <=>(other)
|
93
91
|
[@name, @version, Gem::Platform.sort_priority(@platform)] <=>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions
|
5
|
+
are met:
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
22
|
+
SUCH DAMAGE.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# for backward compatibility
|
3
|
+
|
4
|
+
# :enddoc:
|
5
|
+
|
6
|
+
class Gem::Net::HTTP
|
7
|
+
ProxyMod = ProxyDelta
|
8
|
+
deprecate_constant :ProxyMod
|
9
|
+
end
|
10
|
+
|
11
|
+
module Gem::Net::NetPrivate
|
12
|
+
HTTPRequest = ::Gem::Net::HTTPRequest
|
13
|
+
deprecate_constant :HTTPRequest
|
14
|
+
end
|
15
|
+
|
16
|
+
module Gem::Net
|
17
|
+
HTTPSession = HTTP
|
18
|
+
|
19
|
+
HTTPInformationCode = HTTPInformation
|
20
|
+
HTTPSuccessCode = HTTPSuccess
|
21
|
+
HTTPRedirectionCode = HTTPRedirection
|
22
|
+
HTTPRetriableCode = HTTPRedirection
|
23
|
+
HTTPClientErrorCode = HTTPClientError
|
24
|
+
HTTPFatalErrorCode = HTTPClientError
|
25
|
+
HTTPServerErrorCode = HTTPServerError
|
26
|
+
HTTPResponseReceiver = HTTPResponse
|
27
|
+
|
28
|
+
HTTPResponceReceiver = HTTPResponse # Typo since 2001
|
29
|
+
|
30
|
+
deprecate_constant :HTTPSession,
|
31
|
+
:HTTPInformationCode,
|
32
|
+
:HTTPSuccessCode,
|
33
|
+
:HTTPRedirectionCode,
|
34
|
+
:HTTPRetriableCode,
|
35
|
+
:HTTPClientErrorCode,
|
36
|
+
:HTTPFatalErrorCode,
|
37
|
+
:HTTPServerErrorCode,
|
38
|
+
:HTTPResponseReceiver,
|
39
|
+
:HTTPResponceReceiver
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Gem::Net
|
3
|
+
# Gem::Net::HTTP exception class.
|
4
|
+
# You cannot use Gem::Net::HTTPExceptions directly; instead, you must use
|
5
|
+
# its subclasses.
|
6
|
+
module HTTPExceptions
|
7
|
+
def initialize(msg, res) #:nodoc:
|
8
|
+
super msg
|
9
|
+
@response = res
|
10
|
+
end
|
11
|
+
attr_reader :response
|
12
|
+
alias data response #:nodoc: obsolete
|
13
|
+
end
|
14
|
+
|
15
|
+
class HTTPError < ProtocolError
|
16
|
+
include HTTPExceptions
|
17
|
+
end
|
18
|
+
|
19
|
+
class HTTPRetriableError < ProtoRetriableError
|
20
|
+
include HTTPExceptions
|
21
|
+
end
|
22
|
+
|
23
|
+
class HTTPClientException < ProtoServerError
|
24
|
+
include HTTPExceptions
|
25
|
+
end
|
26
|
+
|
27
|
+
class HTTPFatalError < ProtoFatalError
|
28
|
+
include HTTPExceptions
|
29
|
+
end
|
30
|
+
|
31
|
+
# We cannot use the name "HTTPServerError", it is the name of the response.
|
32
|
+
HTTPServerException = HTTPClientException # :nodoc:
|
33
|
+
deprecate_constant(:HTTPServerException)
|
34
|
+
end
|