rubygems-update 4.0.21 → 4.1.0.beta1
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 +590 -53
- data/CONTRIBUTING.md +66 -5
- data/MIT.txt +4 -3
- data/Manifest.txt +332 -375
- data/README.md +26 -6
- data/bundler.gemspec +63 -0
- data/doc/POLICIES.md +147 -0
- data/doc/UPGRADING.md +4 -4
- data/{bundler/lib → lib}/bundler/build_metadata.rb +2 -2
- data/{bundler/lib → lib}/bundler/checksum.rb +40 -25
- data/{bundler/lib → lib}/bundler/ci_detector.rb +1 -1
- data/{bundler/lib → lib}/bundler/cli/add.rb +3 -4
- data/{bundler/lib → lib}/bundler/cli/cache.rb +4 -0
- data/{bundler/lib → lib}/bundler/cli/clean.rb +5 -0
- data/{bundler/lib → lib}/bundler/cli/common.rb +37 -1
- data/{bundler/lib → lib}/bundler/cli/config.rb +4 -2
- data/{bundler/lib → lib}/bundler/cli/gem.rb +0 -17
- data/{bundler/lib → lib}/bundler/cli/install.rb +4 -5
- data/{bundler/lib → lib}/bundler/cli/lock.rb +1 -2
- data/{bundler/lib → lib}/bundler/cli/outdated.rb +8 -3
- data/{bundler/lib → lib}/bundler/cli/pristine.rb +2 -1
- data/{bundler/lib → lib}/bundler/cli/update.rb +21 -12
- data/{bundler/lib → lib}/bundler/cli.rb +14 -11
- data/{bundler/lib → lib}/bundler/definition.rb +61 -24
- data/{bundler/lib → lib}/bundler/dependency.rb +4 -0
- data/{bundler/lib → lib}/bundler/dsl.rb +77 -11
- data/{bundler/lib → lib}/bundler/endpoint_specification.rb +51 -14
- data/{bundler/lib → lib}/bundler/env.rb +7 -24
- data/{bundler/lib → lib}/bundler/errors.rb +34 -5
- data/{bundler/lib → lib}/bundler/fetcher/compact_index.rb +14 -5
- data/lib/bundler/fetcher/connection_pools.rb +150 -0
- data/{bundler/lib → lib}/bundler/fetcher/downloader.rb +31 -16
- data/{bundler/lib → lib}/bundler/fetcher.rb +8 -47
- data/{bundler/lib → lib}/bundler/injector.rb +3 -3
- data/{bundler/lib → lib}/bundler/inline.rb +44 -4
- data/{bundler/lib → lib}/bundler/installer/parallel_installer.rb +25 -30
- data/{bundler/lib → lib}/bundler/installer.rb +20 -6
- data/{bundler/lib → lib}/bundler/lazy_specification.rb +44 -17
- data/{bundler/lib → lib}/bundler/lockfile_generator.rb +24 -2
- data/{bundler/lib → lib}/bundler/lockfile_parser.rb +43 -5
- data/{bundler/lib → lib}/bundler/man/bundle-add.1 +7 -4
- data/{bundler/lib → lib}/bundler/man/bundle-add.1.ronn +8 -4
- data/{bundler/lib → lib}/bundler/man/bundle-binstubs.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-cache.1 +2 -2
- data/{bundler/lib → lib}/bundler/man/bundle-cache.1.ronn +2 -2
- data/{bundler/lib → lib}/bundler/man/bundle-check.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-clean.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-config.1 +38 -6
- data/{bundler/lib → lib}/bundler/man/bundle-config.1.ronn +143 -10
- data/{bundler/lib → lib}/bundler/man/bundle-console.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-doctor.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-env.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-exec.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-fund.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-gem.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-help.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-info.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-init.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-install.1 +2 -2
- data/{bundler/lib → lib}/bundler/man/bundle-install.1.ronn +4 -4
- data/{bundler/lib → lib}/bundler/man/bundle-issue.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-licenses.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-list.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-lock.1 +3 -3
- data/{bundler/lib → lib}/bundler/man/bundle-lock.1.ronn +5 -5
- data/{bundler/lib → lib}/bundler/man/bundle-open.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-outdated.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-platform.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-plugin.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-pristine.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-remove.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-show.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle-update.1 +3 -3
- data/{bundler/lib → lib}/bundler/man/bundle-update.1.ronn +3 -5
- data/{bundler/lib → lib}/bundler/man/bundle-version.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/bundle.1 +1 -1
- data/{bundler/lib → lib}/bundler/man/gemfile.5 +45 -1
- data/{bundler/lib → lib}/bundler/man/gemfile.5.ronn +53 -0
- data/lib/bundler/match_metadata.rb +50 -0
- data/{bundler/lib → lib}/bundler/match_platform.rb +25 -2
- data/lib/bundler/match_remote_metadata.rb +44 -0
- data/{bundler/lib → lib}/bundler/materialization.rb +2 -1
- data/lib/bundler/override.rb +69 -0
- data/{bundler/lib → lib}/bundler/plugin/dsl.rb +3 -5
- data/{bundler/lib → lib}/bundler/plugin/events.rb +55 -13
- data/{bundler/lib → lib}/bundler/plugin/index.rb +87 -11
- data/{bundler/lib → lib}/bundler/plugin/installer/path.rb +1 -1
- data/{bundler/lib → lib}/bundler/plugin/installer.rb +13 -5
- data/{bundler/lib → lib}/bundler/plugin.rb +58 -30
- data/{bundler/lib → lib}/bundler/remote_specification.rb +6 -3
- data/{bundler/lib → lib}/bundler/resolver/base.rb +2 -1
- data/{bundler/lib → lib}/bundler/resolver/incompatibility.rb +1 -1
- data/{bundler/lib → lib}/bundler/resolver.rb +73 -23
- data/{bundler/lib → lib}/bundler/ruby_version.rb +0 -2
- data/{bundler/lib → lib}/bundler/rubygems_ext.rb +71 -1
- data/{bundler/lib → lib}/bundler/rubygems_gem_installer.rb +41 -2
- data/{bundler/lib → lib}/bundler/rubygems_integration.rb +7 -2
- data/{bundler/lib → lib}/bundler/runtime.rb +69 -2
- data/{bundler/lib → lib}/bundler/self_manager.rb +9 -15
- data/{bundler/lib → lib}/bundler/settings.rb +373 -30
- data/{bundler/lib → lib}/bundler/shared_helpers.rb +2 -1
- data/{bundler/lib → lib}/bundler/source/git/git_proxy.rb +2 -10
- data/{bundler/lib → lib}/bundler/source/git.rb +15 -6
- data/{bundler/lib → lib}/bundler/source/path/installer.rb +1 -1
- data/{bundler/lib → lib}/bundler/source/rubygems/remote.rb +10 -5
- data/{bundler/lib → lib}/bundler/source/rubygems.rb +48 -12
- data/{bundler/lib → lib}/bundler/spec_set.rb +16 -4
- data/{bundler/lib → lib}/bundler/stub_specification.rb +2 -1
- data/{bundler/lib → lib}/bundler/templates/newgem/Gemfile.tt +4 -4
- data/{bundler/lib → lib}/bundler/templates/newgem/newgem.gemspec.tt +3 -3
- data/{bundler/lib → lib}/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
- data/{bundler/lib → lib}/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +1 -1
- data/{bundler/lib → lib}/bundler/ui/shell.rb +0 -4
- data/{bundler/lib → lib}/bundler/ui/silent.rb +0 -4
- data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +35 -2
- data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/base.rb +2 -1
- data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/basic.rb +14 -6
- data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/color.rb +2 -0
- data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor.rb +34 -1
- data/lib/bundler/vendored_pub_grub.rb +7 -0
- data/lib/bundler/vendored_securerandom.rb +15 -0
- data/lib/bundler/vendored_uri.rb +21 -0
- data/{bundler/lib → lib}/bundler/version.rb +1 -1
- data/{bundler/lib → lib}/bundler/worker.rb +3 -2
- data/{bundler/lib → lib}/bundler.rb +1 -1
- data/lib/rubygems/basic_specification.rb +15 -14
- data/lib/rubygems/bundler_settings.rb +137 -0
- data/lib/rubygems/bundler_version_finder.rb +13 -55
- data/lib/rubygems/ci_detector.rb +1 -1
- data/lib/rubygems/commands/build_command.rb +8 -1
- data/lib/rubygems/commands/cert_command.rb +9 -7
- data/lib/rubygems/commands/contents_command.rb +1 -1
- data/lib/rubygems/commands/dependency_command.rb +15 -3
- data/lib/rubygems/commands/environment_command.rb +1 -0
- data/lib/rubygems/commands/exec_command.rb +3 -0
- data/lib/rubygems/commands/fetch_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +3 -1
- data/lib/rubygems/commands/install_command.rb +13 -3
- data/lib/rubygems/commands/lock_command.rb +2 -2
- data/lib/rubygems/commands/outdated_command.rb +77 -2
- data/lib/rubygems/commands/owner_command.rb +1 -1
- data/lib/rubygems/commands/push_command.rb +159 -21
- data/lib/rubygems/commands/setup_command.rb +20 -23
- data/lib/rubygems/commands/signin_command.rb +3 -1
- data/lib/rubygems/commands/signout_command.rb +26 -6
- data/lib/rubygems/commands/specification_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +84 -2
- data/lib/rubygems/commands/yank_command.rb +10 -7
- data/lib/rubygems/compact_index_client/cache.rb +122 -0
- data/lib/rubygems/compact_index_client/cache_file.rb +147 -0
- data/lib/rubygems/compact_index_client/http_fetcher.rb +88 -0
- data/lib/rubygems/compact_index_client/parser.rb +90 -0
- data/lib/rubygems/compact_index_client/updater.rb +113 -0
- data/lib/rubygems/compact_index_client.rb +111 -0
- data/lib/rubygems/config_file.rb +304 -22
- data/lib/rubygems/content_address.rb +194 -0
- data/lib/rubygems/cooldown.rb +173 -0
- data/lib/rubygems/cooldown_option.rb +27 -0
- data/lib/rubygems/cooldown_settings.rb +57 -0
- data/lib/rubygems/credential_store/native/linux.rb +97 -0
- data/lib/rubygems/credential_store/native/macos.rb +88 -0
- data/lib/rubygems/credential_store/native/windows.rb +130 -0
- data/lib/rubygems/credential_store.rb +332 -0
- data/lib/rubygems/defaults.rb +9 -0
- data/lib/rubygems/dependency_installer.rb +15 -0
- data/lib/rubygems/doctor.rb +23 -6
- data/lib/rubygems/exceptions.rb +11 -43
- data/lib/rubygems/ext/builder.rb +70 -5
- data/lib/rubygems/ext/cargo_builder.rb +0 -9
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -15
- data/lib/rubygems/gemcutter_utilities.rb +44 -2
- data/lib/rubygems/install_update_options.rb +16 -0
- data/lib/rubygems/installer.rb +90 -11
- data/lib/rubygems/installer_uninstaller_utils.rb +24 -3
- data/lib/rubygems/name_tuple.rb +55 -18
- data/lib/rubygems/package/old.rb +1 -1
- data/lib/rubygems/package.rb +200 -47
- data/lib/rubygems/package_task.rb +2 -2
- data/lib/rubygems/platform.rb +2 -2
- data/lib/rubygems/query_utils.rb +84 -24
- data/lib/rubygems/remote_fetcher.rb +65 -17
- data/lib/rubygems/request/connection_pools.rb +3 -0
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +0 -2
- data/lib/rubygems/request_set.rb +105 -17
- data/lib/rubygems/resolver/api_set.rb +14 -26
- data/lib/rubygems/resolver/api_specification.rb +56 -15
- data/lib/rubygems/resolver/incompatibility.rb +10 -0
- data/lib/rubygems/resolver/index_specification.rb +6 -4
- data/lib/rubygems/resolver/installer_set.rb +2 -2
- data/lib/rubygems/resolver/lock_specification.rb +5 -1
- data/lib/rubygems/resolver/spec_specification.rb +4 -0
- data/lib/rubygems/resolver/specification.rb +16 -1
- data/lib/rubygems/resolver/strategy.rb +44 -0
- data/lib/rubygems/resolver.rb +471 -145
- data/lib/rubygems/safe_marshal.rb +2 -1
- data/lib/rubygems/safe_yaml.rb +20 -3
- data/lib/rubygems/security/policy.rb +11 -3
- data/lib/rubygems/security/signer.rb +15 -7
- data/lib/rubygems/security.rb +111 -17
- data/lib/rubygems/source/local.rb +7 -2
- data/lib/rubygems/source.rb +270 -23
- data/lib/rubygems/spec_fetcher.rb +47 -12
- data/lib/rubygems/specification.rb +76 -32
- data/lib/rubygems/specification_policy.rb +33 -6
- data/lib/rubygems/specification_record.rb +41 -2
- data/lib/rubygems/stub_specification.rb +39 -16
- data/lib/rubygems/uninstaller.rb +2 -0
- data/lib/rubygems/util/atomic_file_writer.rb +109 -0
- data/lib/rubygems/vendor/net-http/lib/net/http/exceptions.rb +2 -1
- data/lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb +5 -6
- data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +8 -4
- data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +15 -1
- data/lib/rubygems/vendor/net-http/lib/net/http/response.rb +2 -1
- data/lib/rubygems/vendor/net-http/lib/net/http/responses.rb +68 -0
- data/lib/rubygems/vendor/net-http/lib/net/http.rb +60 -49
- data/lib/rubygems/vendor/optparse/lib/optparse.rb +23 -30
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/assignment.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +7 -7
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/failure_writer.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/incompatibility.rb +4 -4
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/package.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/partial_solution.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/rubygems.rb +3 -3
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/solve_failure.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/static_package_source.rb +3 -3
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/strategy.rb +2 -2
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/term.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_constraint.rb +3 -3
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_range.rb +1 -1
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_solver.rb +2 -2
- data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_union.rb +1 -1
- data/lib/rubygems/vendor/pub_grub/lib/pub_grub.rb +57 -0
- data/lib/rubygems/vendor/resolv/lib/resolv.rb +3508 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +4 -0
- data/lib/rubygems/vendor/timeout/lib/timeout.rb +190 -77
- data/lib/rubygems/vendor/uri/lib/uri.rb +4 -0
- data/{bundler/lib/bundler → lib/rubygems}/vendored_pub_grub.rb +0 -1
- data/lib/rubygems/version.rb +129 -111
- data/lib/rubygems/version_option.rb +14 -0
- data/lib/rubygems/yaml_serializer.rb +853 -71
- data/lib/rubygems.rb +45 -11
- data/rubygems-update.gemspec +3 -4
- data/setup.rb +1 -0
- metadata +365 -410
- data/bundler/CHANGELOG.md +0 -5784
- data/bundler/LICENSE.md +0 -22
- data/bundler/README.md +0 -58
- data/bundler/bundler.gemspec +0 -46
- data/bundler/lib/bundler/compact_index_client/cache.rb +0 -107
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -148
- data/bundler/lib/bundler/compact_index_client/parser.rb +0 -87
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -105
- data/bundler/lib/bundler/compact_index_client.rb +0 -92
- data/bundler/lib/bundler/match_metadata.rb +0 -30
- data/bundler/lib/bundler/match_remote_metadata.rb +0 -29
- data/bundler/lib/bundler/vendor/connection_pool/LICENSE +0 -20
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +0 -227
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +0 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -56
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +0 -230
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +0 -82
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +0 -41
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +0 -65
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +0 -80
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +0 -1153
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +0 -31
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +0 -102
- data/bundler/lib/bundler/vendor/uri/COPYING +0 -56
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +0 -922
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +0 -100
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -267
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +0 -1592
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +0 -137
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +0 -23
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +0 -261
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +0 -22
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -293
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +0 -547
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +0 -206
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +0 -6
- data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +0 -83
- data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +0 -23
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +0 -104
- data/bundler/lib/bundler/vendored_persistent.rb +0 -11
- data/bundler/lib/bundler/vendored_securerandom.rb +0 -12
- data/bundler/lib/bundler/vendored_uri.rb +0 -21
- data/bundler/lib/bundler/yaml_serializer.rb +0 -98
- data/doc/rubygems/CONTRIBUTING.md +0 -231
- data/doc/rubygems/POLICIES.md +0 -60
- data/lib/rubygems/request_set/lockfile/parser.rb +0 -344
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +0 -122
- data/lib/rubygems/resolver/conflict.rb +0 -146
- data/lib/rubygems/resolver/stats.rb +0 -46
- data/lib/rubygems/util/list.rb +0 -40
- data/lib/rubygems/vendor/molinillo/LICENSE +0 -9
- data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
- data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
- data/lib/rubygems/vendor/molinillo/lib/molinillo/errors.rb +0 -149
- data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/rubygems/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
- data/lib/rubygems/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
- data/lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/rubygems/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/rubygems/vendor/molinillo/lib/molinillo.rb +0 -11
- data/lib/rubygems/vendored_molinillo.rb +0 -3
- /data/{bundler/exe → exe}/bundle +0 -0
- /data/{bundler/exe → exe}/bundler +0 -0
- /data/{bundler/lib → lib}/bundler/.document +0 -0
- /data/{bundler/lib → lib}/bundler/capistrano.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/binstubs.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/check.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/console.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/doctor/diagnose.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/doctor/ssl.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/doctor.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/exec.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/fund.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/info.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/init.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/issue.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/list.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/open.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/platform.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/plugin.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/remove.rb +0 -0
- /data/{bundler/lib → lib}/bundler/cli/show.rb +0 -0
- /data/{bundler/lib → lib}/bundler/constants.rb +0 -0
- /data/{bundler/lib → lib}/bundler/current_ruby.rb +0 -0
- /data/{bundler/lib → lib}/bundler/deployment.rb +0 -0
- /data/{bundler/lib → lib}/bundler/deprecate.rb +0 -0
- /data/{bundler/lib → lib}/bundler/digest.rb +0 -0
- /data/{bundler/lib → lib}/bundler/environment_preserver.rb +0 -0
- /data/{bundler/lib → lib}/bundler/feature_flag.rb +0 -0
- /data/{bundler/lib → lib}/bundler/fetcher/base.rb +0 -0
- /data/{bundler/lib → lib}/bundler/fetcher/dependency.rb +0 -0
- /data/{bundler/lib → lib}/bundler/fetcher/gem_remote_fetcher.rb +0 -0
- /data/{bundler/lib → lib}/bundler/fetcher/index.rb +0 -0
- /data/{bundler/lib → lib}/bundler/force_platform.rb +0 -0
- /data/{bundler/lib → lib}/bundler/friendly_errors.rb +0 -0
- /data/{bundler/lib → lib}/bundler/gem_helper.rb +0 -0
- /data/{bundler/lib → lib}/bundler/gem_tasks.rb +0 -0
- /data/{bundler/lib → lib}/bundler/gem_version_promoter.rb +0 -0
- /data/{bundler/lib → lib}/bundler/index.rb +0 -0
- /data/{bundler/lib → lib}/bundler/installer/gem_installer.rb +0 -0
- /data/{bundler/lib → lib}/bundler/installer/standalone.rb +0 -0
- /data/{bundler/lib → lib}/bundler/man/.document +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-binstubs.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-check.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-clean.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-console.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-doctor.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-env.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-exec.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-fund.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-gem.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-help.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-info.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-init.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-issue.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-licenses.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-list.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-open.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-outdated.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-platform.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-plugin.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-pristine.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-remove.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-show.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle-version.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/bundle.1.ronn +0 -0
- /data/{bundler/lib → lib}/bundler/man/index.txt +0 -0
- /data/{bundler/lib → lib}/bundler/mirror.rb +0 -0
- /data/{bundler/lib → lib}/bundler/plugin/api/source.rb +0 -0
- /data/{bundler/lib → lib}/bundler/plugin/api.rb +0 -0
- /data/{bundler/lib → lib}/bundler/plugin/installer/git.rb +0 -0
- /data/{bundler/lib → lib}/bundler/plugin/installer/rubygems.rb +0 -0
- /data/{bundler/lib → lib}/bundler/plugin/source_list.rb +0 -0
- /data/{bundler/lib → lib}/bundler/plugin/unloaded_source.rb +0 -0
- /data/{bundler/lib → lib}/bundler/process_lock.rb +0 -0
- /data/{bundler/lib → lib}/bundler/resolver/candidate.rb +0 -0
- /data/{bundler/lib → lib}/bundler/resolver/package.rb +0 -0
- /data/{bundler/lib → lib}/bundler/resolver/root.rb +0 -0
- /data/{bundler/lib → lib}/bundler/resolver/spec_group.rb +0 -0
- /data/{bundler/lib → lib}/bundler/resolver/strategy.rb +0 -0
- /data/{bundler/lib → lib}/bundler/retry.rb +0 -0
- /data/{bundler/lib → lib}/bundler/ruby_dsl.rb +0 -0
- /data/{bundler/lib → lib}/bundler/safe_marshal.rb +0 -0
- /data/{bundler/lib → lib}/bundler/settings/validator.rb +0 -0
- /data/{bundler/lib → lib}/bundler/setup.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source/gemspec.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source/metadata.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source/path.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source/rubygems_aggregate.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source_list.rb +0 -0
- /data/{bundler/lib → lib}/bundler/source_map.rb +0 -0
- /data/{bundler/lib → lib}/bundler/templates/.document +0 -0
- /data/{bundler/lib → lib}/bundler/templates/Executable +0 -0
- /data/{bundler/lib → lib}/bundler/templates/Executable.standalone +0 -0
- /data/{bundler/lib → lib}/bundler/templates/Gemfile +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/CHANGELOG.md.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/Cargo.toml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/LICENSE.txt.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/README.md.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/Rakefile.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/bin/console.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/bin/setup.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/circleci/config.yml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/exe/newgem.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/build.rs.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/go.mod.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem.c.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem.go.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem.h.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/github/workflows/build-gems.yml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/github/workflows/main.yml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/gitignore.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/gitlab-ci.yml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/lib/newgem/version.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/lib/newgem.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/rspec.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/rubocop.yml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/sig/newgem.rbs.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/standard.yml.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/test/minitest/test_helper.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +0 -0
- /data/{bundler/lib → lib}/bundler/ui/rg_proxy.rb +0 -0
- /data/{bundler/lib → lib}/bundler/ui.rb +0 -0
- /data/{bundler/lib → lib}/bundler/uri_credentials_filter.rb +0 -0
- /data/{bundler/lib → lib}/bundler/uri_normalizer.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/.document +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/fileutils/COPYING +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/fileutils/lib/fileutils.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/LICENSE.md +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/create_file.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/create_link.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/directory.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/command.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/error.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/group.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/invocation.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/line_editor/basic.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/line_editor/readline.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/line_editor.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/nested_context.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/argument.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/arguments.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/option.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/options.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/rake_compat.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/runner.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/column_printer.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/html.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/table_printer.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/terminal.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/util.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendored_fileutils.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendored_net_http.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendored_thor.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendored_timeout.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vendored_tsort.rb +0 -0
- /data/{bundler/lib → lib}/bundler/vlad.rb +0 -0
- /data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/LICENSE.txt +0 -0
- /data/{bundler/lib/bundler/vendor/securerandom → lib/rubygems/vendor/resolv}/COPYING +0 -0
|
@@ -47,6 +47,10 @@ class Gem::RemoteFetcher
|
|
|
47
47
|
end
|
|
48
48
|
deprecate_constant(:UnknownHostError)
|
|
49
49
|
|
|
50
|
+
# Schemes fetched over the network, as opposed to copied from a local path.
|
|
51
|
+
REMOTE_SCHEMES = %w[http https s3].freeze
|
|
52
|
+
private_constant :REMOTE_SCHEMES
|
|
53
|
+
|
|
50
54
|
@fetcher = nil
|
|
51
55
|
|
|
52
56
|
##
|
|
@@ -111,17 +115,29 @@ class Gem::RemoteFetcher
|
|
|
111
115
|
# always replaced.
|
|
112
116
|
|
|
113
117
|
def download(spec, source_uri, install_dir = Gem.dir)
|
|
118
|
+
gem_file_name = File.basename spec.cache_file
|
|
119
|
+
|
|
120
|
+
source_uri = Gem::Uri.new(source_uri)
|
|
121
|
+
|
|
122
|
+
scheme = source_uri.scheme
|
|
123
|
+
|
|
124
|
+
# Gem::URI.parse gets confused by MS Windows paths with forward slashes.
|
|
125
|
+
scheme = nil if /^[a-z]$/i.match?(scheme)
|
|
126
|
+
|
|
127
|
+
remote_source = REMOTE_SCHEMES.include?(scheme)
|
|
128
|
+
|
|
114
129
|
install_cache_dir = File.join install_dir, "cache"
|
|
115
130
|
cache_dir =
|
|
116
|
-
if
|
|
131
|
+
if File.identical?(".", install_dir) # gem fetch asks for it this way
|
|
117
132
|
install_dir
|
|
133
|
+
elsif Gem.configuration.global_gem_cache && remote_source && ensure_writable_cache_dir(Gem.global_gem_cache_path)
|
|
134
|
+
Gem.global_gem_cache_path
|
|
118
135
|
elsif File.writable?(install_cache_dir) || (File.writable?(install_dir) && !File.exist?(install_cache_dir))
|
|
119
136
|
install_cache_dir
|
|
120
137
|
else
|
|
121
138
|
File.join Gem.user_dir, "cache"
|
|
122
139
|
end
|
|
123
140
|
|
|
124
|
-
gem_file_name = File.basename spec.cache_file
|
|
125
141
|
local_gem_path = File.join cache_dir, gem_file_name
|
|
126
142
|
|
|
127
143
|
require "fileutils"
|
|
@@ -131,30 +147,26 @@ class Gem::RemoteFetcher
|
|
|
131
147
|
nil
|
|
132
148
|
end unless File.exist? cache_dir
|
|
133
149
|
|
|
134
|
-
source_uri = Gem::Uri.new(source_uri)
|
|
135
|
-
|
|
136
|
-
scheme = source_uri.scheme
|
|
137
|
-
|
|
138
|
-
# Gem::URI.parse gets confused by MS Windows paths with forward slashes.
|
|
139
|
-
scheme = nil if /^[a-z]$/i.match?(scheme)
|
|
140
|
-
|
|
141
150
|
# REFACTOR: split this up and dispatch on scheme (eg download_http)
|
|
142
151
|
# REFACTOR: be sure to clean up fake fetcher when you do this... cleaner
|
|
143
152
|
case scheme
|
|
144
|
-
when
|
|
145
|
-
|
|
153
|
+
when *REMOTE_SCHEMES then
|
|
154
|
+
if File.exist? local_gem_path
|
|
155
|
+
verbose "Using local gem #{local_gem_path}"
|
|
156
|
+
else
|
|
146
157
|
begin
|
|
147
|
-
verbose "Downloading gem #{gem_file_name}"
|
|
158
|
+
verbose "Downloading gem #{gem_file_name} to #{cache_dir}"
|
|
148
159
|
|
|
149
160
|
remote_gem_path = source_uri + "gems/#{gem_file_name}"
|
|
150
161
|
|
|
151
162
|
cache_update_path remote_gem_path, local_gem_path
|
|
152
163
|
rescue FetchError
|
|
153
|
-
raise if spec
|
|
164
|
+
raise if Gem::ContentAddress.content_addressed?(spec, validate_ruby_abi: false)
|
|
165
|
+
raise if spec.original_platform.to_s == spec.platform.to_s
|
|
154
166
|
|
|
155
167
|
alternate_name = "#{spec.original_name}.gem"
|
|
156
168
|
|
|
157
|
-
verbose "Failed, downloading gem #{alternate_name}"
|
|
169
|
+
verbose "Failed, downloading gem #{alternate_name} to #{cache_dir}"
|
|
158
170
|
|
|
159
171
|
remote_gem_path = source_uri + "gems/#{alternate_name}"
|
|
160
172
|
|
|
@@ -168,7 +180,7 @@ class Gem::RemoteFetcher
|
|
|
168
180
|
|
|
169
181
|
remote_gem_path = Gem::Util.correct_for_windows_path(File.join(path, "gems", gem_file_name))
|
|
170
182
|
|
|
171
|
-
|
|
183
|
+
atomic_copy(remote_gem_path, local_gem_path)
|
|
172
184
|
rescue Errno::EACCES
|
|
173
185
|
local_gem_path = source_uri.to_s
|
|
174
186
|
end
|
|
@@ -185,7 +197,7 @@ class Gem::RemoteFetcher
|
|
|
185
197
|
source_path = Gem::UriFormatter.new(source_path).unescape
|
|
186
198
|
|
|
187
199
|
begin
|
|
188
|
-
|
|
200
|
+
atomic_copy(source_path, local_gem_path) unless
|
|
189
201
|
File.identical?(source_path, local_gem_path)
|
|
190
202
|
rescue Errno::EACCES
|
|
191
203
|
local_gem_path = source_uri.to_s
|
|
@@ -234,7 +246,9 @@ class Gem::RemoteFetcher
|
|
|
234
246
|
|
|
235
247
|
fetch_http(location, last_modified, head, depth + 1)
|
|
236
248
|
else
|
|
237
|
-
|
|
249
|
+
custom_error = response["X-Error-Message"]
|
|
250
|
+
error_detail = custom_error || response.message
|
|
251
|
+
raise FetchError.new("Bad response #{error_detail} #{response.code}", uri)
|
|
238
252
|
end
|
|
239
253
|
end
|
|
240
254
|
|
|
@@ -333,6 +347,40 @@ class Gem::RemoteFetcher
|
|
|
333
347
|
|
|
334
348
|
private
|
|
335
349
|
|
|
350
|
+
# Creates +cache_dir+ so its writability can be probed, since File.writable?
|
|
351
|
+
# is false for a path that does not exist yet.
|
|
352
|
+
|
|
353
|
+
def ensure_writable_cache_dir(cache_dir)
|
|
354
|
+
require "fileutils"
|
|
355
|
+
begin
|
|
356
|
+
FileUtils.mkdir_p cache_dir
|
|
357
|
+
rescue SystemCallError
|
|
358
|
+
return false
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
File.writable?(cache_dir)
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
def atomic_copy(source_path, destination_path)
|
|
365
|
+
File.open(source_path, "rb") do |source|
|
|
366
|
+
# FileUtils.cp passed the source mode to File.open, so it only reached a
|
|
367
|
+
# file being created and the umask still applied to it. The writer
|
|
368
|
+
# already carries over the mode of a file it replaces.
|
|
369
|
+
mode = source.stat.mode & 0o777 & ~File.umask
|
|
370
|
+
replacing = File.exist?(destination_path)
|
|
371
|
+
|
|
372
|
+
Gem::AtomicFileWriter.open(destination_path) do |io|
|
|
373
|
+
IO.copy_stream(source, io)
|
|
374
|
+
|
|
375
|
+
begin
|
|
376
|
+
io.chmod(mode) unless replacing
|
|
377
|
+
rescue Errno::EPERM, Errno::EACCES
|
|
378
|
+
# the filesystem does not carry permissions
|
|
379
|
+
end
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
end
|
|
383
|
+
|
|
336
384
|
def proxy_for(proxy, uri)
|
|
337
385
|
Gem::Request.proxy_uri(proxy || Gem::Request.get_proxy_from_env(uri.scheme))
|
|
338
386
|
end
|
data/lib/rubygems/request_set.rb
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "cooldown"
|
|
3
4
|
require_relative "vendored_tsort"
|
|
4
5
|
|
|
5
6
|
##
|
|
6
7
|
# A RequestSet groups a request to activate a set of dependencies.
|
|
7
8
|
#
|
|
8
|
-
# nokogiri = Gem::Dependency.new 'nokogiri', '
|
|
9
|
-
# pg = Gem::Dependency.new 'pg', '
|
|
9
|
+
# nokogiri = Gem::Dependency.new 'nokogiri', '>= 1.6'
|
|
10
|
+
# pg = Gem::Dependency.new 'pg', '>= 0.14'
|
|
10
11
|
#
|
|
11
12
|
# set = Gem::RequestSet.new nokogiri, pg
|
|
12
13
|
#
|
|
@@ -23,6 +24,11 @@ class Gem::RequestSet
|
|
|
23
24
|
|
|
24
25
|
attr_accessor :always_install
|
|
25
26
|
|
|
27
|
+
##
|
|
28
|
+
# The Gem::Cooldown applied to release candidates, if any.
|
|
29
|
+
|
|
30
|
+
attr_accessor :cooldown
|
|
31
|
+
|
|
26
32
|
attr_reader :dependencies
|
|
27
33
|
|
|
28
34
|
attr_accessor :development
|
|
@@ -86,8 +92,8 @@ class Gem::RequestSet
|
|
|
86
92
|
# Creates a RequestSet for a list of Gem::Dependency objects, +deps+. You
|
|
87
93
|
# can then #resolve and #install the resolved list of dependencies.
|
|
88
94
|
#
|
|
89
|
-
# nokogiri = Gem::Dependency.new 'nokogiri', '
|
|
90
|
-
# pg = Gem::Dependency.new 'pg', '
|
|
95
|
+
# nokogiri = Gem::Dependency.new 'nokogiri', '>= 1.6'
|
|
96
|
+
# pg = Gem::Dependency.new 'pg', '>= 0.14'
|
|
91
97
|
#
|
|
92
98
|
# set = Gem::RequestSet.new nokogiri, pg
|
|
93
99
|
|
|
@@ -96,6 +102,7 @@ class Gem::RequestSet
|
|
|
96
102
|
|
|
97
103
|
@always_install = []
|
|
98
104
|
@conservative = false
|
|
105
|
+
@cooldown = nil
|
|
99
106
|
@dependency_names = {}
|
|
100
107
|
@development = false
|
|
101
108
|
@development_shallow = false
|
|
@@ -182,7 +189,7 @@ class Gem::RequestSet
|
|
|
182
189
|
# Install requested gems after they have been downloaded
|
|
183
190
|
sorted_requests.each do |req|
|
|
184
191
|
if req.installed? && @always_install.none? {|spec| spec == req.spec.spec }
|
|
185
|
-
req.spec.spec.build_extensions
|
|
192
|
+
req.spec.spec.build_extensions unless options[:build_extension] == false
|
|
186
193
|
yield req, nil if block_given?
|
|
187
194
|
next
|
|
188
195
|
end
|
|
@@ -223,6 +230,7 @@ class Gem::RequestSet
|
|
|
223
230
|
@prerelease = options[:prerelease]
|
|
224
231
|
@remote = options[:domain] != :local
|
|
225
232
|
@conservative = true if options[:conservative]
|
|
233
|
+
@cooldown = Gem::Cooldown.from_options options
|
|
226
234
|
|
|
227
235
|
gem_deps_api = load_gemdeps gemdeps, options[:without_groups], true
|
|
228
236
|
|
|
@@ -234,10 +242,6 @@ class Gem::RequestSet
|
|
|
234
242
|
sorted_requests.each do |spec|
|
|
235
243
|
puts " #{spec.full_name}"
|
|
236
244
|
end
|
|
237
|
-
|
|
238
|
-
if Gem.configuration.really_verbose
|
|
239
|
-
@resolver.stats.display
|
|
240
|
-
end
|
|
241
245
|
else
|
|
242
246
|
installed = install options, &block
|
|
243
247
|
|
|
@@ -322,11 +326,8 @@ class Gem::RequestSet
|
|
|
322
326
|
@git_set.root_dir = @install_dir
|
|
323
327
|
|
|
324
328
|
lock_file = "#{File.expand_path(path)}.lock"
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
parser = tokenizer.make_parser self, []
|
|
328
|
-
parser.parse
|
|
329
|
-
rescue Errno::ENOENT
|
|
329
|
+
if File.exist?(lock_file)
|
|
330
|
+
load_lockfile lock_file
|
|
330
331
|
end
|
|
331
332
|
|
|
332
333
|
gf = Gem::RequestSet::GemDependencyAPI.new self, path
|
|
@@ -335,6 +336,91 @@ class Gem::RequestSet
|
|
|
335
336
|
gf.load
|
|
336
337
|
end
|
|
337
338
|
|
|
339
|
+
def load_lockfile(lock_file) # :nodoc:
|
|
340
|
+
require "bundler"
|
|
341
|
+
require "bundler/lockfile_parser"
|
|
342
|
+
|
|
343
|
+
# Bundler::Source::Path resolves relative `remote:` paths against
|
|
344
|
+
# Bundler.root, which raises when there is no Gemfile in the working
|
|
345
|
+
# directory. Anchor it to the lockfile's directory so PATH sections in a
|
|
346
|
+
# `gem install -g` lockfile can be parsed without a Bundler environment.
|
|
347
|
+
previous_root = Bundler.instance_variable_get(:@root)
|
|
348
|
+
Bundler.instance_variable_set(:@root, Pathname.new(File.expand_path(File.dirname(lock_file))))
|
|
349
|
+
root_swapped = true
|
|
350
|
+
|
|
351
|
+
# A PLUGIN SOURCE section otherwise sends Bundler::Plugin.from_lock looking
|
|
352
|
+
# for the plugin that handles it, which loads and runs that plugin's
|
|
353
|
+
# `plugins.rb`. Nothing here can use a plugin source anyway, so borrow the
|
|
354
|
+
# flag Bundler itself uses to keep lockfile parsing inert.
|
|
355
|
+
previous_gemfile_parse = Bundler::Plugin.instance_variable_get(:@gemfile_parse)
|
|
356
|
+
Bundler::Plugin.instance_variable_set(:@gemfile_parse, true)
|
|
357
|
+
gemfile_parse_swapped = true
|
|
358
|
+
|
|
359
|
+
parser = Bundler::LockfileParser.new(File.read(lock_file), lockfile_path: lock_file)
|
|
360
|
+
|
|
361
|
+
locked_versions = {}
|
|
362
|
+
|
|
363
|
+
parser.specs.group_by(&:source).each do |source, specs|
|
|
364
|
+
case source
|
|
365
|
+
when Bundler::Source::Rubygems
|
|
366
|
+
# Bundler::Source::Rubygems stores remotes in reverse of the lockfile
|
|
367
|
+
# order (Bundler::Source::Rubygems#to_lock reverses them back), so
|
|
368
|
+
# restore the lockfile order here.
|
|
369
|
+
remotes = source.remotes.reverse.map {|remote| Gem::Source.new(remote.to_s) }
|
|
370
|
+
remotes << Gem::Source.new(Gem::DEFAULT_HOST) if remotes.empty?
|
|
371
|
+
lock_set = Gem::Resolver::LockSet.new(remotes)
|
|
372
|
+
specs.each do |spec|
|
|
373
|
+
added = lock_set.add(spec.name, spec.version.to_s, spec.platform)
|
|
374
|
+
locked_versions[spec.name] ||= spec.version
|
|
375
|
+
spec.dependencies.each do |dep|
|
|
376
|
+
added.each {|s| s.add_dependency dep }
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
|
+
@sets << lock_set
|
|
380
|
+
when Bundler::Source::Git
|
|
381
|
+
git_set = Gem::Resolver::GitSet.new
|
|
382
|
+
git_set.root_dir = @install_dir
|
|
383
|
+
specs.each do |spec|
|
|
384
|
+
git_spec = git_set.add_git_spec(
|
|
385
|
+
spec.name,
|
|
386
|
+
spec.version.to_s,
|
|
387
|
+
source.uri.to_s,
|
|
388
|
+
source.revision,
|
|
389
|
+
source.submodules || false
|
|
390
|
+
)
|
|
391
|
+
locked_versions[spec.name] ||= spec.version
|
|
392
|
+
spec.dependencies.each {|dep| git_spec.add_dependency dep }
|
|
393
|
+
end
|
|
394
|
+
@sets << git_set
|
|
395
|
+
when Bundler::Source::Path
|
|
396
|
+
vendor_set = Gem::Resolver::VendorSet.new
|
|
397
|
+
specs.each do |spec|
|
|
398
|
+
loaded = vendor_set.add_vendor_gem(spec.name, source.path.to_s)
|
|
399
|
+
locked_versions[spec.name] ||= loaded.version
|
|
400
|
+
spec.dependencies.each {|dep| loaded.dependencies << dep }
|
|
401
|
+
end
|
|
402
|
+
@sets << vendor_set
|
|
403
|
+
end
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
parser.dependencies.each_value do |dep|
|
|
407
|
+
requirements = dep.requirement.as_list
|
|
408
|
+
|
|
409
|
+
# A dependency the lockfile ties to a source replaces whatever it asks
|
|
410
|
+
# for with the version that source resolved, the way the parser this
|
|
411
|
+
# replaced did. For a PATH section that is the version of the gemspec on
|
|
412
|
+
# disk, not the one the lockfile records.
|
|
413
|
+
if dep.source && (version = locked_versions[dep.name])
|
|
414
|
+
requirements = [version]
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
gem dep.name, *requirements
|
|
418
|
+
end
|
|
419
|
+
ensure
|
|
420
|
+
Bundler.instance_variable_set(:@root, previous_root) if root_swapped
|
|
421
|
+
Bundler::Plugin.instance_variable_set(:@gemfile_parse, previous_gemfile_parse) if gemfile_parse_swapped
|
|
422
|
+
end
|
|
423
|
+
|
|
338
424
|
def pretty_print(q) # :nodoc:
|
|
339
425
|
q.group 2, "[RequestSet:", "]" do
|
|
340
426
|
q.breakable
|
|
@@ -392,6 +478,7 @@ class Gem::RequestSet
|
|
|
392
478
|
set.prerelease = @prerelease
|
|
393
479
|
|
|
394
480
|
resolver = Gem::Resolver.new @dependencies, set
|
|
481
|
+
resolver.cooldown = @cooldown
|
|
395
482
|
resolver.development = @development
|
|
396
483
|
resolver.development_shallow = @development_shallow
|
|
397
484
|
resolver.ignore_dependencies = @ignore_dependencies
|
|
@@ -431,8 +518,10 @@ class Gem::RequestSet
|
|
|
431
518
|
end
|
|
432
519
|
|
|
433
520
|
def specs_in(dir)
|
|
434
|
-
Gem::
|
|
435
|
-
Gem::
|
|
521
|
+
Gem::SpecificationRecord.dirs_from([dir]).flat_map do |spec_dir|
|
|
522
|
+
Gem::Util.glob_files_in_dir("*.gemspec", spec_dir).map do |g|
|
|
523
|
+
Gem::Specification.load g
|
|
524
|
+
end
|
|
436
525
|
end
|
|
437
526
|
end
|
|
438
527
|
|
|
@@ -462,4 +551,3 @@ end
|
|
|
462
551
|
|
|
463
552
|
require_relative "request_set/gem_dependency_api"
|
|
464
553
|
require_relative "request_set/lockfile"
|
|
465
|
-
require_relative "request_set/lockfile/tokenizer"
|
|
@@ -35,6 +35,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
|
35
35
|
@dep_uri = dep_uri
|
|
36
36
|
@uri = dep_uri + ".."
|
|
37
37
|
|
|
38
|
+
@client = nil
|
|
38
39
|
@data = Hash.new {|h,k| h[k] = [] }
|
|
39
40
|
@source = Gem::Source.new @uri
|
|
40
41
|
|
|
@@ -99,26 +100,20 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
|
99
100
|
# Return data for all versions of the gem +name+.
|
|
100
101
|
|
|
101
102
|
def versions(name) # :nodoc:
|
|
102
|
-
if @data.key?(name)
|
|
103
|
-
return @data[name]
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
uri = @dep_uri + name
|
|
103
|
+
return @data[name] if @data.key?(name)
|
|
107
104
|
|
|
108
|
-
begin
|
|
109
|
-
|
|
110
|
-
rescue Gem::RemoteFetcher::FetchError
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
lines(str).each do |ver|
|
|
114
|
-
number, platform, dependencies, requirements = parse_gem(ver)
|
|
105
|
+
infos = begin
|
|
106
|
+
client.fetch_info(name)
|
|
107
|
+
rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
|
|
108
|
+
[]
|
|
109
|
+
end
|
|
115
110
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
infos.each do |_, number, suffix, dependencies, requirements|
|
|
112
|
+
suffix ||= "ruby"
|
|
113
|
+
dependencies = dependencies.map {|dep_name, reqs| [dep_name, reqs.join(", ")] }
|
|
114
|
+
requirements = requirements.map {|req_name, reqs| [req_name.to_sym, reqs] }.to_h
|
|
119
115
|
|
|
120
|
-
|
|
121
|
-
end
|
|
116
|
+
@data[name] << { name: name, number: number, suffix: suffix, dependencies: dependencies, requirements: requirements }
|
|
122
117
|
end
|
|
123
118
|
|
|
124
119
|
@data[name]
|
|
@@ -126,14 +121,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
|
126
121
|
|
|
127
122
|
private
|
|
128
123
|
|
|
129
|
-
def
|
|
130
|
-
|
|
131
|
-
header = lines.index("---")
|
|
132
|
-
header ? lines[header + 1..-1] : lines
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def parse_gem(string)
|
|
136
|
-
@gem_parser ||= GemParser.new
|
|
137
|
-
@gem_parser.parse(string)
|
|
124
|
+
def client # :nodoc:
|
|
125
|
+
@client ||= @source.compact_index_client
|
|
138
126
|
end
|
|
139
127
|
end
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "../cooldown"
|
|
4
|
+
|
|
3
5
|
##
|
|
4
6
|
# Represents a specification retrieved via the Compact Index API.
|
|
5
7
|
#
|
|
@@ -31,13 +33,13 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
|
|
|
31
33
|
@set = set
|
|
32
34
|
@name = api_data[:name]
|
|
33
35
|
@version = Gem::Version.new(api_data[:number]).freeze
|
|
34
|
-
@platform = Gem::Platform.new(api_data[:platform]).freeze
|
|
35
|
-
@original_platform = api_data[:platform].freeze
|
|
36
36
|
@dependencies = api_data[:dependencies].map do |name, ver|
|
|
37
37
|
Gem::Dependency.new(name, ver.split(/\s*,\s*/)).freeze
|
|
38
38
|
end.freeze
|
|
39
39
|
@required_ruby_version = Gem::Requirement.new(api_data.dig(:requirements, :ruby)).freeze
|
|
40
40
|
@required_rubygems_version = Gem::Requirement.new(api_data.dig(:requirements, :rubygems)).freeze
|
|
41
|
+
@created_at = parse_created_at(api_data.dig(:requirements, :created_at))&.freeze
|
|
42
|
+
assign_platform(api_data)
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
def ==(other) # :nodoc:
|
|
@@ -45,15 +47,17 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
|
|
|
45
47
|
@set == other.set &&
|
|
46
48
|
@name == other.name &&
|
|
47
49
|
@version == other.version &&
|
|
48
|
-
@platform == other.platform
|
|
50
|
+
@platform == other.platform &&
|
|
51
|
+
@content_address == other.content_address
|
|
49
52
|
end
|
|
50
53
|
|
|
51
54
|
def hash
|
|
52
|
-
@set.hash ^ @name.hash ^ @version.hash ^ @platform.hash
|
|
55
|
+
@set.hash ^ @name.hash ^ @version.hash ^ @platform.hash ^ @content_address.hash
|
|
53
56
|
end
|
|
54
57
|
|
|
55
58
|
def fetch_development_dependencies # :nodoc:
|
|
56
|
-
|
|
59
|
+
suffix = @content_address || @platform
|
|
60
|
+
spec = source.fetch_spec Gem::NameTuple.new @name, @version, suffix
|
|
57
61
|
|
|
58
62
|
@dependencies = spec.dependencies
|
|
59
63
|
end
|
|
@@ -84,22 +88,59 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
|
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
##
|
|
87
|
-
#
|
|
91
|
+
# A Gem::Specification stub built from the Compact Index data for this
|
|
92
|
+
# specification. The compact index carries everything needed to
|
|
93
|
+
# download and install the gem, so the Marshal gemspec is not fetched.
|
|
94
|
+
# Development dependencies are not included; see
|
|
95
|
+
# #fetch_development_dependencies.
|
|
88
96
|
|
|
89
97
|
def spec # :nodoc:
|
|
90
|
-
@spec ||=
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
@spec ||= Gem::Specification.new do |s|
|
|
99
|
+
s.name = @name
|
|
100
|
+
s.version = @version
|
|
101
|
+
s.platform = @platform
|
|
102
|
+
s.original_platform = @original_platform
|
|
103
|
+
s.required_ruby_version = @required_ruby_version
|
|
104
|
+
s.required_rubygems_version = @required_rubygems_version
|
|
105
|
+
s.content_address = @content_address
|
|
106
|
+
|
|
107
|
+
@dependencies.each do |dependency|
|
|
108
|
+
s.add_runtime_dependency dependency.name, *dependency.requirement.as_list
|
|
99
109
|
end
|
|
110
|
+
end
|
|
100
111
|
end
|
|
101
112
|
|
|
102
113
|
def source # :nodoc:
|
|
103
114
|
@set.source
|
|
104
115
|
end
|
|
116
|
+
|
|
117
|
+
private
|
|
118
|
+
|
|
119
|
+
def assign_platform(api_data)
|
|
120
|
+
suffix = api_data[:suffix]
|
|
121
|
+
required_platform = required_platform_from(api_data.dig(:requirements, :platform))
|
|
122
|
+
|
|
123
|
+
if Gem::ContentAddress.content_addressed_row?(suffix, required_platform, @required_ruby_version)
|
|
124
|
+
@content_address = suffix.freeze
|
|
125
|
+
@platform = required_platform.freeze
|
|
126
|
+
@original_platform = required_platform.to_s.freeze
|
|
127
|
+
else
|
|
128
|
+
@content_address = nil
|
|
129
|
+
@platform = Gem::Platform.new(suffix).freeze
|
|
130
|
+
@original_platform = suffix.freeze
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def required_platform_from(requirement)
|
|
135
|
+
platform = Array(requirement).last
|
|
136
|
+
return if platform.nil? || platform.empty?
|
|
137
|
+
|
|
138
|
+
Gem::Platform.new(platform)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def parse_created_at(value)
|
|
142
|
+
value = value.first if value.is_a?(Array)
|
|
143
|
+
|
|
144
|
+
Gem::Cooldown.parse_created_at(value)
|
|
145
|
+
end
|
|
105
146
|
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Gem::Resolver::Incompatibility < Gem::PubGrub::Incompatibility
|
|
4
|
+
attr_reader :extended_explanation
|
|
5
|
+
|
|
6
|
+
def initialize(terms, cause:, custom_explanation: nil, extended_explanation: nil)
|
|
7
|
+
@extended_explanation = extended_explanation
|
|
8
|
+
super(terms, cause: cause, custom_explanation: custom_explanation)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -15,7 +15,7 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
|
|
|
15
15
|
# The +name+, +version+ and +platform+ are the name, version and platform of
|
|
16
16
|
# the gem.
|
|
17
17
|
|
|
18
|
-
def initialize(set, name, version, source, platform)
|
|
18
|
+
def initialize(set, name, version, source, platform, content_address: nil)
|
|
19
19
|
super()
|
|
20
20
|
|
|
21
21
|
@set = set
|
|
@@ -24,6 +24,7 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
|
|
|
24
24
|
@source = source
|
|
25
25
|
@platform = Gem::Platform.new(platform.to_s)
|
|
26
26
|
@original_platform = platform.to_s
|
|
27
|
+
@content_address = content_address
|
|
27
28
|
|
|
28
29
|
@spec = nil
|
|
29
30
|
end
|
|
@@ -60,11 +61,12 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
|
|
|
60
61
|
self.class === other &&
|
|
61
62
|
@name == other.name &&
|
|
62
63
|
@version == other.version &&
|
|
63
|
-
@platform == other.platform
|
|
64
|
+
@platform == other.platform &&
|
|
65
|
+
@content_address == other.content_address
|
|
64
66
|
end
|
|
65
67
|
|
|
66
68
|
def hash
|
|
67
|
-
@name
|
|
69
|
+
[@name, @version, @platform, @content_address].hash
|
|
68
70
|
end
|
|
69
71
|
|
|
70
72
|
def inspect # :nodoc:
|
|
@@ -93,7 +95,7 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
|
|
|
93
95
|
def spec # :nodoc:
|
|
94
96
|
@spec ||=
|
|
95
97
|
begin
|
|
96
|
-
tuple = Gem::NameTuple.new @name, @version, @original_platform
|
|
98
|
+
tuple = Gem::NameTuple.new @name, @version, @original_platform, content_address: @content_address
|
|
97
99
|
|
|
98
100
|
@source.fetch_spec tuple
|
|
99
101
|
end
|
|
@@ -160,10 +160,10 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
|
|
|
160
160
|
res.concat matching_local
|
|
161
161
|
|
|
162
162
|
begin
|
|
163
|
-
|
|
163
|
+
@local_source.find_all_gems(name, dep.requirement).each do |local_spec|
|
|
164
164
|
res << Gem::Resolver::IndexSpecification.new(
|
|
165
165
|
self, local_spec.name, local_spec.version,
|
|
166
|
-
@local_source, local_spec.platform
|
|
166
|
+
@local_source, local_spec.platform, content_address: local_spec.content_address
|
|
167
167
|
)
|
|
168
168
|
end
|
|
169
169
|
rescue Gem::Package::FormatError
|
|
@@ -30,7 +30,11 @@ class Gem::Resolver::LockSpecification < Gem::Resolver::Specification
|
|
|
30
30
|
def install(options = {})
|
|
31
31
|
destination = options[:install_dir] || Gem.dir
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
installed = Gem::SpecificationRecord.dirs_from([destination]).any? do |spec_dir|
|
|
34
|
+
File.exist? File.join(spec_dir, spec.spec_name)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
if installed
|
|
34
38
|
yield nil
|
|
35
39
|
return
|
|
36
40
|
end
|