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
data/lib/rubygems/source.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "text"
|
|
4
|
+
require_relative "cooldown"
|
|
4
5
|
##
|
|
5
6
|
# A Source knows how to list and fetch gems from a RubyGems marshal index.
|
|
6
7
|
#
|
|
@@ -17,6 +18,24 @@ class Gem::Source
|
|
|
17
18
|
prerelease: "prerelease_specs",
|
|
18
19
|
}.freeze
|
|
19
20
|
|
|
21
|
+
##
|
|
22
|
+
# Decoded compact index metadata for one content-addressable gem build:
|
|
23
|
+
# its +version+, content-address +suffix+, +ruby_abi+, and +platform+.
|
|
24
|
+
# Two infos are equal when their version and suffix match.
|
|
25
|
+
|
|
26
|
+
ContentAddressableInfo = Struct.new(:version, :suffix, :ruby_abi, :platform) do
|
|
27
|
+
def hash
|
|
28
|
+
[version, suffix].hash
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def eql?(other)
|
|
32
|
+
other.is_a?(self.class) &&
|
|
33
|
+
version == other.version &&
|
|
34
|
+
suffix == other.suffix
|
|
35
|
+
end
|
|
36
|
+
alias_method :==, :eql?
|
|
37
|
+
end
|
|
38
|
+
|
|
20
39
|
##
|
|
21
40
|
# The URI this source will fetch gems from.
|
|
22
41
|
|
|
@@ -162,8 +181,134 @@ class Gem::Source
|
|
|
162
181
|
# :latest => Return the list of only the highest version of each gem
|
|
163
182
|
# :prerelease => Return the list of all prerelease only specs
|
|
164
183
|
#
|
|
184
|
+
# The compact index is used when the source provides it, falling back
|
|
185
|
+
# to the Marshal spec indexes.
|
|
165
186
|
|
|
166
187
|
def load_specs(type)
|
|
188
|
+
load_compact_index_specs(type) || load_marshal_specs(type)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
##
|
|
192
|
+
# The compact index client for this source, caching under
|
|
193
|
+
# Gem.spec_cache_dir. Also used by Gem::Resolver::APISet.
|
|
194
|
+
|
|
195
|
+
def compact_index_client # :nodoc:
|
|
196
|
+
@compact_index_client ||= begin
|
|
197
|
+
require_relative "compact_index_client"
|
|
198
|
+
|
|
199
|
+
index_uri = compact_index_uri
|
|
200
|
+
|
|
201
|
+
Gem::CompactIndexClient.new(compact_index_cache_dir(index_uri),
|
|
202
|
+
Gem::CompactIndexClient::HTTPFetcher.new(index_uri))
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
##
|
|
207
|
+
# Decodes content-addressable +tuples+ (whose platform field holds the
|
|
208
|
+
# content address) into tuples carrying their real platform and Ruby ABI
|
|
209
|
+
# from the compact index /info metadata.
|
|
210
|
+
|
|
211
|
+
def decode_content_addressable_tuples(tuples, latest: false)
|
|
212
|
+
ca_tuples = tuples.select(&:content_address)
|
|
213
|
+
return tuples if ca_tuples.empty?
|
|
214
|
+
|
|
215
|
+
decoded_tuples = ca_tuples.group_by(&:name).flat_map do |name, name_tuples|
|
|
216
|
+
rows = name_tuples.map do |tuple|
|
|
217
|
+
[tuple.name, tuple.version, tuple.version.to_s, tuple.content_address]
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
content_addressable_tuples(name, rows)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
decoded_by_key = decoded_tuples.to_h do |tuple|
|
|
224
|
+
[[tuple.name, tuple.version, tuple.content_address], tuple]
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
decoded = tuples.filter_map do |tuple|
|
|
228
|
+
if tuple.content_address
|
|
229
|
+
decoded_by_key[[tuple.name, tuple.version, tuple.content_address]]
|
|
230
|
+
else
|
|
231
|
+
tuple
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
return decoded unless latest
|
|
236
|
+
|
|
237
|
+
decoded.group_by(&:name).flat_map do |_, name_tuples|
|
|
238
|
+
max_versions_by_platform(name_tuples)
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
##
|
|
243
|
+
# The publish time of gem +name+ at +version+ for +suffix+, when this
|
|
244
|
+
# source provides it through the compact index created_at metadata.
|
|
245
|
+
# Returns nil when the source, the gem or the version has no known
|
|
246
|
+
# publish time.
|
|
247
|
+
|
|
248
|
+
def created_at(name, version, suffix = Gem::Platform::RUBY)
|
|
249
|
+
return unless %w[http https].include?(uri.scheme)
|
|
250
|
+
|
|
251
|
+
@created_at_info ||= {}
|
|
252
|
+
info = @created_at_info[name] ||= begin
|
|
253
|
+
compact_index_client.fetch_info(name)
|
|
254
|
+
rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
|
|
255
|
+
[]
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
suffix = (suffix || Gem::Platform::RUBY).to_s
|
|
259
|
+
version = version.to_s
|
|
260
|
+
|
|
261
|
+
row = info.find do |row_info|
|
|
262
|
+
row_info[Gem::CompactIndexClient::INFO_VERSION] == version &&
|
|
263
|
+
(row_info[Gem::CompactIndexClient::INFO_SUFFIX] || Gem::Platform::RUBY) == suffix
|
|
264
|
+
end
|
|
265
|
+
return unless row
|
|
266
|
+
|
|
267
|
+
value = row[Gem::CompactIndexClient::INFO_REQS].assoc("created_at")&.last&.first
|
|
268
|
+
|
|
269
|
+
Gem::Cooldown.parse_created_at(value)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
##
|
|
273
|
+
# The publish time for +tuple+. Content-addressable tuples are looked up by
|
|
274
|
+
# content address; all other tuples are looked up by platform.
|
|
275
|
+
|
|
276
|
+
def created_at_for_tuple(tuple)
|
|
277
|
+
created_at(tuple.name, tuple.version, tuple.content_address || tuple.platform)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
##
|
|
281
|
+
# Downloads +spec+ and writes it to +dir+. See also
|
|
282
|
+
# Gem::RemoteFetcher#download.
|
|
283
|
+
|
|
284
|
+
def download(spec, dir = Dir.pwd)
|
|
285
|
+
fetcher = Gem::RemoteFetcher.fetcher
|
|
286
|
+
fetcher.download spec, uri.to_s, dir
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def pretty_print(q) # :nodoc:
|
|
290
|
+
q.object_group(self) do
|
|
291
|
+
q.group 2, "[Remote:", "]" do
|
|
292
|
+
q.breakable
|
|
293
|
+
q.text @uri.to_s
|
|
294
|
+
|
|
295
|
+
if api = uri
|
|
296
|
+
q.breakable
|
|
297
|
+
q.text "API URI: "
|
|
298
|
+
q.text api.to_s
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
def typo_squatting?(host, distance_threshold = 4)
|
|
305
|
+
return if @uri.host.nil?
|
|
306
|
+
levenshtein_distance(@uri.host, host).between? 1, distance_threshold
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
private
|
|
310
|
+
|
|
311
|
+
def load_marshal_specs(type)
|
|
167
312
|
file = FILES[type]
|
|
168
313
|
fetcher = Gem::RemoteFetcher.fetcher
|
|
169
314
|
file_name = "#{file}.#{Gem.marshal_version}"
|
|
@@ -194,48 +339,150 @@ class Gem::Source
|
|
|
194
339
|
end
|
|
195
340
|
|
|
196
341
|
##
|
|
197
|
-
#
|
|
198
|
-
#
|
|
342
|
+
# Builds the name tuple list for +type+ from the compact index versions
|
|
343
|
+
# file. Returns nil when the source does not provide a usable compact
|
|
344
|
+
# index, so the caller can fall back to the Marshal spec indexes.
|
|
199
345
|
|
|
200
|
-
def
|
|
201
|
-
|
|
202
|
-
|
|
346
|
+
def load_compact_index_specs(type)
|
|
347
|
+
return unless %w[http https].include?(uri.scheme)
|
|
348
|
+
|
|
349
|
+
versions = compact_index_versions
|
|
350
|
+
return if versions.nil? || versions.empty?
|
|
351
|
+
|
|
352
|
+
tuples = []
|
|
353
|
+
|
|
354
|
+
versions.each_value do |rows|
|
|
355
|
+
gem_tuples = rows.filter_map do |row_name, version_string, suffix|
|
|
356
|
+
next unless Gem::Version.correct?(version_string)
|
|
357
|
+
|
|
358
|
+
version = Gem::Version.new(version_string)
|
|
359
|
+
next if version.prerelease? != (type == :prerelease)
|
|
360
|
+
|
|
361
|
+
suffix ||= "ruby"
|
|
362
|
+
content_address = suffix if Gem::ContentAddress.match?(suffix)
|
|
363
|
+
|
|
364
|
+
Gem::NameTuple.new(row_name, version, suffix, content_address: content_address)
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
gem_tuples = max_versions_by_platform(gem_tuples) if type == :latest
|
|
368
|
+
|
|
369
|
+
tuples.concat(gem_tuples)
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
tuples
|
|
203
373
|
end
|
|
204
374
|
|
|
205
|
-
def
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
375
|
+
def compact_index_versions
|
|
376
|
+
@compact_index_versions ||= compact_index_client.versions
|
|
377
|
+
rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
|
|
378
|
+
@compact_index_versions = {}
|
|
379
|
+
nil
|
|
380
|
+
end
|
|
210
381
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
382
|
+
def compact_index_info_rows(name)
|
|
383
|
+
compact_index_client.info(name)
|
|
384
|
+
rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
|
|
385
|
+
[]
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
def content_addressable_tuples(name, rows)
|
|
389
|
+
metadata = content_addressable_metadata(name, rows)
|
|
390
|
+
|
|
391
|
+
rows.filter_map do |row_name, version, version_string, suffix|
|
|
392
|
+
row_metadata = metadata.find do |entry|
|
|
393
|
+
entry.version == version_string && entry.suffix == suffix
|
|
216
394
|
end
|
|
395
|
+
next unless row_metadata
|
|
396
|
+
|
|
397
|
+
Gem::NameTuple.new(
|
|
398
|
+
row_name,
|
|
399
|
+
version,
|
|
400
|
+
row_metadata.platform,
|
|
401
|
+
content_address: suffix,
|
|
402
|
+
ruby_abi: row_metadata.ruby_abi
|
|
403
|
+
)
|
|
217
404
|
end
|
|
218
405
|
end
|
|
219
406
|
|
|
220
|
-
def
|
|
221
|
-
|
|
222
|
-
|
|
407
|
+
def content_addressable_metadata(name, rows)
|
|
408
|
+
wanted_rows = rows.map do |row|
|
|
409
|
+
ContentAddressableInfo.new(row[2], row[3], nil, nil)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
available_rows = compact_index_info_rows(name).filter_map do |info_row|
|
|
413
|
+
version = info_row[Gem::CompactIndexClient::INFO_VERSION]
|
|
414
|
+
suffix = info_row[Gem::CompactIndexClient::INFO_SUFFIX]
|
|
415
|
+
|
|
416
|
+
requirements = compact_index_requirements(info_row)
|
|
417
|
+
platform = required_platform_from(requirements[:platform])
|
|
418
|
+
next unless platform
|
|
419
|
+
next unless requirements[:ruby]
|
|
420
|
+
|
|
421
|
+
ruby_abi = Gem::ContentAddress.ruby_abi_for(Gem::Requirement.new(requirements[:ruby]))
|
|
422
|
+
ContentAddressableInfo.new(version, suffix, ruby_abi, platform)
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
available_rows & wanted_rows
|
|
223
426
|
end
|
|
224
427
|
|
|
225
|
-
|
|
428
|
+
def compact_index_requirements(info_row)
|
|
429
|
+
info_row[Gem::CompactIndexClient::INFO_REQS].to_h do |key, requirements|
|
|
430
|
+
[key.to_sym, requirements]
|
|
431
|
+
end
|
|
432
|
+
end
|
|
226
433
|
|
|
227
|
-
def
|
|
228
|
-
|
|
434
|
+
def required_platform_from(requirement)
|
|
435
|
+
platform = Array(requirement).last.to_s
|
|
436
|
+
return if platform.empty?
|
|
437
|
+
|
|
438
|
+
platform
|
|
439
|
+
end
|
|
229
440
|
|
|
230
|
-
|
|
441
|
+
def max_versions_by_platform(tuples)
|
|
442
|
+
grouped_tuples = tuples.group_by {|tuple| latest_platform_key(tuple) }
|
|
443
|
+
grouped_tuples.map do |_, platform_tuples|
|
|
444
|
+
platform_tuples.max_by(&:version)
|
|
445
|
+
end
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
def latest_platform_key(tuple)
|
|
449
|
+
if tuple.content_address
|
|
450
|
+
[tuple.platform, tuple.ruby_abi || tuple.content_address]
|
|
451
|
+
else
|
|
452
|
+
tuple.platform
|
|
453
|
+
end
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
def compact_index_uri
|
|
457
|
+
if uri.host == "rubygems.org"
|
|
231
458
|
index_uri = uri.dup
|
|
232
459
|
index_uri.host = "index.rubygems.org"
|
|
233
460
|
index_uri
|
|
234
461
|
else
|
|
235
462
|
uri
|
|
236
463
|
end
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
def compact_index_cache_dir(index_uri)
|
|
467
|
+
if update_cache?
|
|
468
|
+
# Correct for windows paths
|
|
469
|
+
escaped_path = index_uri.path.sub(%r{^/([a-z]):/}i, '/\\1-/')
|
|
470
|
+
|
|
471
|
+
File.join Gem.spec_cache_dir, "compact_index",
|
|
472
|
+
"#{index_uri.host}%#{index_uri.port}", *escaped_path.split("/").reject(&:empty?)
|
|
473
|
+
else
|
|
474
|
+
require "tmpdir"
|
|
475
|
+
require "fileutils"
|
|
476
|
+
dir = Dir.mktmpdir "gem_compact_index"
|
|
477
|
+
at_exit { FileUtils.rm_rf dir }
|
|
478
|
+
dir
|
|
479
|
+
end
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
def new_dependency_resolver_set
|
|
483
|
+
return Gem::Resolver::IndexSet.new self if uri.scheme == "file"
|
|
237
484
|
|
|
238
|
-
bundler_api_uri = enforce_trailing_slash(
|
|
485
|
+
bundler_api_uri = enforce_trailing_slash(compact_index_uri) + "versions"
|
|
239
486
|
|
|
240
487
|
begin
|
|
241
488
|
fetcher = Gem::RemoteFetcher.fetcher
|
|
@@ -82,13 +82,17 @@ class Gem::SpecFetcher
|
|
|
82
82
|
# Find and fetch gem name tuples that match +dependency+.
|
|
83
83
|
#
|
|
84
84
|
# If +matching_platform+ is false, gems for all platforms are returned.
|
|
85
|
+
#
|
|
86
|
+
# +type+ overrides the index type derived from +dependency+. See
|
|
87
|
+
# #available_specs for the list of types.
|
|
85
88
|
|
|
86
|
-
def search_for_dependency(dependency, matching_platform = true)
|
|
89
|
+
def search_for_dependency(dependency, matching_platform = true, type: nil)
|
|
87
90
|
found = {}
|
|
88
91
|
|
|
89
92
|
rejected_specs = {}
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
specs_type = type || dependency.identity
|
|
95
|
+
list, errors = available_specs(specs_type)
|
|
92
96
|
|
|
93
97
|
list.each do |source, specs|
|
|
94
98
|
if dependency.name.is_a?(String) && specs.respond_to?(:bsearch)
|
|
@@ -97,17 +101,20 @@ class Gem::SpecFetcher
|
|
|
97
101
|
specs = specs[start_index...end_index] if start_index && end_index
|
|
98
102
|
end
|
|
99
103
|
|
|
104
|
+
specs = specs.select {|tup| dependency.match?(tup) }
|
|
105
|
+
specs = decode_source_content_addressable_tuples(source, specs, latest: specs_type == :latest)
|
|
106
|
+
|
|
100
107
|
found[source] = specs.select do |tup|
|
|
101
|
-
if
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
if matching_platform && !Gem::Platform.match_gem?(tup.platform, tup.name)
|
|
109
|
+
pm = (
|
|
110
|
+
rejected_specs[dependency] ||= \
|
|
111
|
+
Gem::PlatformMismatch.new(tup.name, tup.version))
|
|
112
|
+
pm.add_platform tup.platform
|
|
113
|
+
false
|
|
114
|
+
elsif matching_platform && !ruby_abi_match?(tup)
|
|
115
|
+
false
|
|
116
|
+
else
|
|
117
|
+
true
|
|
111
118
|
end
|
|
112
119
|
end
|
|
113
120
|
end
|
|
@@ -156,6 +163,7 @@ class Gem::SpecFetcher
|
|
|
156
163
|
specs = []
|
|
157
164
|
tuples.each do |tup, source|
|
|
158
165
|
spec = source.fetch_spec(tup)
|
|
166
|
+
spec.content_address = tup.content_address if tup.content_address
|
|
159
167
|
rescue Gem::RemoteFetcher::FetchError => e
|
|
160
168
|
errors << Gem::SourceFetchProblem.new(source, e)
|
|
161
169
|
else
|
|
@@ -165,6 +173,17 @@ class Gem::SpecFetcher
|
|
|
165
173
|
[specs, errors]
|
|
166
174
|
end
|
|
167
175
|
|
|
176
|
+
##
|
|
177
|
+
# Decodes the content-addressable tuples in +spec_tuples+ ([tuple, source]
|
|
178
|
+
# pairs) to carry their real platform and Ruby ABI via each source.
|
|
179
|
+
|
|
180
|
+
def decode_content_addressable_tuples(spec_tuples, latest: false)
|
|
181
|
+
spec_tuples.group_by {|_, source| source }.flat_map do |source, source_tuples|
|
|
182
|
+
tuples = source_tuples.map(&:first)
|
|
183
|
+
decode_source_content_addressable_tuples(source, tuples, latest: latest).map {|tuple| [tuple, source] }
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
168
187
|
##
|
|
169
188
|
# Suggests gems based on the supplied +gem_name+. Returns an array of
|
|
170
189
|
# alternative gem names.
|
|
@@ -287,4 +306,20 @@ class Gem::SpecFetcher
|
|
|
287
306
|
raise unless gracefully_ignore
|
|
288
307
|
[]
|
|
289
308
|
end
|
|
309
|
+
|
|
310
|
+
private
|
|
311
|
+
|
|
312
|
+
def decode_source_content_addressable_tuples(source, tuples, latest: false) # :nodoc:
|
|
313
|
+
return tuples unless source.respond_to?(:decode_content_addressable_tuples)
|
|
314
|
+
|
|
315
|
+
source.decode_content_addressable_tuples(tuples, latest: latest)
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def ruby_abi_match?(tuple) # :nodoc:
|
|
319
|
+
!tuple.ruby_abi || tuple.ruby_abi == current_ruby_abi
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
def current_ruby_abi # :nodoc:
|
|
323
|
+
@current_ruby_abi ||= Gem.ruby_abi
|
|
324
|
+
end
|
|
290
325
|
end
|
|
@@ -11,7 +11,6 @@ require_relative "basic_specification"
|
|
|
11
11
|
require_relative "stub_specification"
|
|
12
12
|
require_relative "platform"
|
|
13
13
|
require_relative "specification_record"
|
|
14
|
-
require_relative "util/list"
|
|
15
14
|
|
|
16
15
|
require "rbconfig"
|
|
17
16
|
|
|
@@ -420,6 +419,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
420
419
|
|
|
421
420
|
attr_accessor :metadata
|
|
422
421
|
|
|
422
|
+
##
|
|
423
|
+
# The content address of this gem, a SHA-256 prefix of the gem file
|
|
424
|
+
# contents used in place of the platform in file and install names
|
|
425
|
+
# (e.g. "example-1.0-78be552b"), or +nil+ for non-content-addressable gems.
|
|
426
|
+
|
|
427
|
+
attr_accessor :content_address
|
|
428
|
+
|
|
423
429
|
######################################################################
|
|
424
430
|
# :section: Optional gemspec attributes
|
|
425
431
|
|
|
@@ -545,7 +551,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
545
551
|
#
|
|
546
552
|
# Usage:
|
|
547
553
|
#
|
|
548
|
-
# spec.add_development_dependency 'example', '
|
|
554
|
+
# spec.add_development_dependency 'example', '>= 1.1.4', '< 2'
|
|
549
555
|
#
|
|
550
556
|
# Development dependencies aren't installed by default and aren't
|
|
551
557
|
# activated when a gem is required.
|
|
@@ -559,7 +565,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
559
565
|
#
|
|
560
566
|
# Usage:
|
|
561
567
|
#
|
|
562
|
-
# spec.add_dependency 'example', '
|
|
568
|
+
# spec.add_dependency 'example', '>= 1.1.4', '< 2'
|
|
563
569
|
|
|
564
570
|
def add_dependency(gem, *requirements)
|
|
565
571
|
if requirements.uniq.size != requirements.size
|
|
@@ -569,6 +575,15 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
569
575
|
add_dependency_with_type(gem, :runtime, requirements)
|
|
570
576
|
end
|
|
571
577
|
|
|
578
|
+
##
|
|
579
|
+
# Ruby ABI of the gem derived from required_ruby_version
|
|
580
|
+
# Only supports required_ruby_version in "~> X.Y.0" format (single pessimistic requirement with 3 segments)
|
|
581
|
+
# Returns nil if the required_ruby_version does not specify a single Ruby ABI
|
|
582
|
+
|
|
583
|
+
def ruby_abi
|
|
584
|
+
Gem::ContentAddress.ruby_abi_for(required_ruby_version)
|
|
585
|
+
end
|
|
586
|
+
|
|
572
587
|
##
|
|
573
588
|
# Executables included in the gem.
|
|
574
589
|
#
|
|
@@ -1248,7 +1263,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
1248
1263
|
# Keeps track of all currently known specifications
|
|
1249
1264
|
|
|
1250
1265
|
def self.specification_record
|
|
1251
|
-
@specification_record ||= Gem::SpecificationRecord.new(
|
|
1266
|
+
@specification_record ||= Gem::SpecificationRecord.new(
|
|
1267
|
+
Gem::SpecificationRecord.dirs_with_abi(dirs)
|
|
1268
|
+
)
|
|
1252
1269
|
end
|
|
1253
1270
|
|
|
1254
1271
|
# DOC: This method needs documented or nodoc'd
|
|
@@ -1288,7 +1305,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
1288
1305
|
raise unless message.include?("YAML::")
|
|
1289
1306
|
|
|
1290
1307
|
unless Object.const_defined?(:YAML)
|
|
1291
|
-
Object.const_set "YAML",
|
|
1308
|
+
Object.const_set "YAML", Module.new
|
|
1292
1309
|
yaml_set = true
|
|
1293
1310
|
end
|
|
1294
1311
|
|
|
@@ -1297,7 +1314,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
1297
1314
|
|
|
1298
1315
|
YAML::Syck.const_set "DefaultKey", Class.new if message.include?("YAML::Syck::DefaultKey") && !YAML::Syck.const_defined?(:DefaultKey)
|
|
1299
1316
|
elsif message.include?("YAML::PrivateType") && !YAML.const_defined?(:PrivateType)
|
|
1300
|
-
YAML.const_set "PrivateType", Class.new
|
|
1317
|
+
YAML.const_set "PrivateType", Class.new { attr_accessor :type_id, :value }
|
|
1301
1318
|
end
|
|
1302
1319
|
|
|
1303
1320
|
retry_count += 1
|
|
@@ -1355,7 +1372,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
1355
1372
|
self.class === other &&
|
|
1356
1373
|
name == other.name &&
|
|
1357
1374
|
version == other.version &&
|
|
1358
|
-
platform == other.platform
|
|
1375
|
+
platform == other.platform &&
|
|
1376
|
+
content_address == other.content_address
|
|
1359
1377
|
end
|
|
1360
1378
|
|
|
1361
1379
|
##
|
|
@@ -1926,7 +1944,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
1926
1944
|
# :startdoc:
|
|
1927
1945
|
|
|
1928
1946
|
def hash # :nodoc:
|
|
1929
|
-
name
|
|
1947
|
+
[name, version, platform, content_address].hash
|
|
1930
1948
|
end
|
|
1931
1949
|
|
|
1932
1950
|
def init_with(coder) # :nodoc:
|
|
@@ -1962,6 +1980,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
1962
1980
|
@loaded_from = nil
|
|
1963
1981
|
@original_platform = nil
|
|
1964
1982
|
@installed_by_version = nil
|
|
1983
|
+
@content_address = nil
|
|
1965
1984
|
|
|
1966
1985
|
set_nil_attributes_to_nil
|
|
1967
1986
|
set_not_nil_attributes_to_default_values
|
|
@@ -2009,13 +2028,19 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2009
2028
|
|
|
2010
2029
|
def base_dir
|
|
2011
2030
|
return Gem.dir unless loaded_from
|
|
2012
|
-
@base_dir ||= if default_gem?
|
|
2031
|
+
@base_dir ||= if default_gem? || loaded_from_abi_scoped_spec_dir?
|
|
2013
2032
|
File.dirname File.dirname File.dirname loaded_from
|
|
2014
2033
|
else
|
|
2015
2034
|
File.dirname File.dirname loaded_from
|
|
2016
2035
|
end
|
|
2017
2036
|
end
|
|
2018
2037
|
|
|
2038
|
+
def loaded_from_abi_scoped_spec_dir?
|
|
2039
|
+
!loaded_from.nil? &&
|
|
2040
|
+
Gem::SpecificationRecord.abi_scoped_spec_dir?(File.dirname(loaded_from))
|
|
2041
|
+
end
|
|
2042
|
+
private :loaded_from_abi_scoped_spec_dir?
|
|
2043
|
+
|
|
2019
2044
|
def inspect # :nodoc:
|
|
2020
2045
|
if $DEBUG
|
|
2021
2046
|
super
|
|
@@ -2115,7 +2140,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2115
2140
|
# Return a NameTuple that represents this Specification
|
|
2116
2141
|
|
|
2117
2142
|
def name_tuple
|
|
2118
|
-
Gem::NameTuple.new name, version, original_platform
|
|
2143
|
+
Gem::NameTuple.new name, version, original_platform, content_address: content_address
|
|
2119
2144
|
end
|
|
2120
2145
|
|
|
2121
2146
|
##
|
|
@@ -2204,10 +2229,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2204
2229
|
end
|
|
2205
2230
|
|
|
2206
2231
|
##
|
|
2207
|
-
# Sets rdoc_options to +value+, ensuring it is
|
|
2232
|
+
# Sets rdoc_options to +value+, ensuring it is a flat array of strings.
|
|
2233
|
+
# Handles malformed gemspecs where rdoc_options may be a Hash or contain Hashes.
|
|
2208
2234
|
|
|
2209
2235
|
def rdoc_options=(options)
|
|
2210
|
-
@rdoc_options = Array
|
|
2236
|
+
@rdoc_options = Array(options).flat_map do |opt|
|
|
2237
|
+
opt.is_a?(Hash) ? opt.to_a.flatten.map(&:to_s) : opt
|
|
2238
|
+
end
|
|
2211
2239
|
end
|
|
2212
2240
|
|
|
2213
2241
|
##
|
|
@@ -2279,7 +2307,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2279
2307
|
# True if this gem has the same attributes as +other+.
|
|
2280
2308
|
|
|
2281
2309
|
def same_attributes?(spec)
|
|
2282
|
-
@@attributes.all? {|name, _default| send(name) == spec.send(name) }
|
|
2310
|
+
@@attributes.all? {|name, _default| send(name) == spec.send(name) } &&
|
|
2311
|
+
content_address == spec.content_address
|
|
2283
2312
|
end
|
|
2284
2313
|
|
|
2285
2314
|
private :same_attributes?
|
|
@@ -2307,11 +2336,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2307
2336
|
end
|
|
2308
2337
|
|
|
2309
2338
|
##
|
|
2310
|
-
#
|
|
2311
|
-
#
|
|
2312
|
-
|
|
2339
|
+
# Full path to the directory containing this spec's gemspec file.
|
|
2340
|
+
# ABI-scoped for content-addressed specs.
|
|
2313
2341
|
def spec_dir
|
|
2314
|
-
@spec_dir ||=
|
|
2342
|
+
@spec_dir ||= if loaded_from && Gem::ContentAddress.content_addressed?(self)
|
|
2343
|
+
File.dirname loaded_from
|
|
2344
|
+
else
|
|
2345
|
+
Gem::SpecificationRecord.specification_dir_for(self, base_dir)
|
|
2346
|
+
end
|
|
2315
2347
|
end
|
|
2316
2348
|
|
|
2317
2349
|
##
|
|
@@ -2378,11 +2410,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2378
2410
|
# still have their default values are omitted.
|
|
2379
2411
|
|
|
2380
2412
|
def to_ruby
|
|
2413
|
+
content_addressed = Gem::ContentAddress.content_addressed?(self)
|
|
2414
|
+
gem_suffix = content_addressed ? content_address : platform
|
|
2381
2415
|
result = []
|
|
2382
2416
|
result << "# -*- encoding: utf-8 -*-"
|
|
2383
|
-
result << "#{Gem::StubSpecification::PREFIX}#{name} #{version} #{
|
|
2417
|
+
result << "#{Gem::StubSpecification::PREFIX}#{name} #{version} #{gem_suffix} #{raw_require_paths.join("\0")}"
|
|
2384
2418
|
result << "#{Gem::StubSpecification::PREFIX}#{extensions.join "\0"}" unless
|
|
2385
2419
|
extensions.empty?
|
|
2420
|
+
result << "#{Gem::StubSpecification::TARGET_PREFIX}platform=#{platform}" if content_addressed
|
|
2386
2421
|
result << nil
|
|
2387
2422
|
result << "Gem::Specification.new do |s|"
|
|
2388
2423
|
|
|
@@ -2391,6 +2426,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2391
2426
|
unless platform.nil? || platform == Gem::Platform::RUBY
|
|
2392
2427
|
result << " s.platform = #{ruby_code original_platform}"
|
|
2393
2428
|
end
|
|
2429
|
+
result << " s.content_address = #{ruby_code content_address} if s.respond_to? :content_address=" if content_addressed
|
|
2394
2430
|
result << ""
|
|
2395
2431
|
result << " s.required_rubygems_version = #{ruby_code required_rubygems_version} if s.respond_to? :required_rubygems_version="
|
|
2396
2432
|
|
|
@@ -2469,24 +2505,28 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2469
2505
|
def to_yaml(opts = {}) # :nodoc:
|
|
2470
2506
|
Gem.load_yaml
|
|
2471
2507
|
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2508
|
+
if Gem.use_psych?
|
|
2509
|
+
# Because the user can switch the YAML engine behind our
|
|
2510
|
+
# back, we have to check again here to make sure that our
|
|
2511
|
+
# psych code was properly loaded, and load it if not.
|
|
2512
|
+
unless Gem.const_defined?(:NoAliasYAMLTree)
|
|
2513
|
+
require_relative "psych_tree"
|
|
2514
|
+
end
|
|
2478
2515
|
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2516
|
+
builder = Gem::NoAliasYAMLTree.create
|
|
2517
|
+
builder << self
|
|
2518
|
+
ast = builder.tree
|
|
2482
2519
|
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2520
|
+
require "stringio"
|
|
2521
|
+
io = StringIO.new
|
|
2522
|
+
io.set_encoding Encoding::UTF_8
|
|
2486
2523
|
|
|
2487
|
-
|
|
2524
|
+
Psych::Visitors::Emitter.new(io).accept(ast)
|
|
2488
2525
|
|
|
2489
|
-
|
|
2526
|
+
io.string.gsub(/ !!null \n/, " \n")
|
|
2527
|
+
else
|
|
2528
|
+
Gem::YAMLSerializer.dump(self)
|
|
2529
|
+
end
|
|
2490
2530
|
end
|
|
2491
2531
|
|
|
2492
2532
|
##
|
|
@@ -2563,6 +2603,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
|
2563
2603
|
self.date = val
|
|
2564
2604
|
when "platform"
|
|
2565
2605
|
self.platform = val
|
|
2606
|
+
when "rdoc_options"
|
|
2607
|
+
self.rdoc_options = val
|
|
2608
|
+
when "requirements"
|
|
2609
|
+
self.requirements = val
|
|
2566
2610
|
else
|
|
2567
2611
|
instance_variable_set "@#{ivar}", val
|
|
2568
2612
|
end
|