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
|
@@ -16,8 +16,7 @@ module Bundler
|
|
|
16
16
|
|
|
17
17
|
check_for_conflicting_options
|
|
18
18
|
|
|
19
|
-
Bundler::CLI::Common.
|
|
20
|
-
Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
|
|
19
|
+
Bundler::CLI::Common.configure_cooldown(options)
|
|
21
20
|
|
|
22
21
|
print = options[:print]
|
|
23
22
|
previous_output_stream = Bundler.ui.output_stream
|
|
@@ -26,8 +26,7 @@ module Bundler
|
|
|
26
26
|
def run
|
|
27
27
|
check_for_deployment_mode!
|
|
28
28
|
|
|
29
|
-
Bundler::CLI::Common.
|
|
30
|
-
Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
|
|
29
|
+
Bundler::CLI::Common.configure_cooldown(options)
|
|
31
30
|
|
|
32
31
|
Bundler.definition.validate_runtime!
|
|
33
32
|
current_specs = Bundler.ui.silence { Bundler.definition.resolve }
|
|
@@ -77,7 +76,7 @@ module Bundler
|
|
|
77
76
|
gemfile_specs + dependency_specs
|
|
78
77
|
end
|
|
79
78
|
|
|
80
|
-
specs
|
|
79
|
+
specs_for_outdated_check(specs).each do |current_spec|
|
|
81
80
|
next unless gems.empty? || gems.include?(current_spec.name)
|
|
82
81
|
|
|
83
82
|
active_spec = retrieve_active_spec(definition, current_spec)
|
|
@@ -152,6 +151,12 @@ module Bundler
|
|
|
152
151
|
end
|
|
153
152
|
end
|
|
154
153
|
|
|
154
|
+
def specs_for_outdated_check(specs)
|
|
155
|
+
specs.group_by(&:name).values.filter_map do |matching_specs|
|
|
156
|
+
MatchPlatform.select_best_platform_match(matching_specs, Bundler.local_platform).first || matching_specs.first
|
|
157
|
+
end.sort_by(&:name)
|
|
158
|
+
end
|
|
159
|
+
|
|
155
160
|
def retrieve_active_spec(definition, current_spec)
|
|
156
161
|
active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
|
157
162
|
return unless active_spec
|
|
@@ -25,7 +25,8 @@ module Bundler
|
|
|
25
25
|
when Source::Rubygems
|
|
26
26
|
cached_gem = spec.cache_file
|
|
27
27
|
unless File.exist?(cached_gem)
|
|
28
|
-
Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist."
|
|
28
|
+
Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist. " \
|
|
29
|
+
"Run `bundle install --redownload` to download it again.")
|
|
29
30
|
next
|
|
30
31
|
end
|
|
31
32
|
|
|
@@ -13,9 +13,7 @@ module Bundler
|
|
|
13
13
|
|
|
14
14
|
update_bundler = options[:bundler]
|
|
15
15
|
|
|
16
|
-
Bundler.self_manager.update_bundler_and_restart_with_it_if_needed(update_bundler
|
|
17
|
-
|
|
18
|
-
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
|
|
16
|
+
Bundler.self_manager.update_bundler_and_restart_with_it_if_needed(update_bundler) if update_bundler
|
|
19
17
|
|
|
20
18
|
sources = Array(options[:source])
|
|
21
19
|
groups = Array(options[:group]).map(&:to_sym)
|
|
@@ -33,29 +31,39 @@ module Bundler
|
|
|
33
31
|
|
|
34
32
|
conservative = options[:conservative]
|
|
35
33
|
|
|
36
|
-
if full_update
|
|
34
|
+
unlock = if full_update
|
|
37
35
|
if conservative
|
|
38
|
-
|
|
36
|
+
{ conservative: conservative }
|
|
39
37
|
else
|
|
40
|
-
|
|
38
|
+
true
|
|
41
39
|
end
|
|
42
40
|
else
|
|
43
41
|
unless Bundler.default_lockfile.exist?
|
|
44
42
|
raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
|
|
45
43
|
"Run `bundle install` to update and install the bundled gems."
|
|
46
44
|
end
|
|
47
|
-
|
|
45
|
+
explicit_gems = gems.dup
|
|
48
46
|
|
|
49
47
|
if groups.any?
|
|
50
48
|
deps = Bundler.definition.dependencies.select {|d| (d.groups & groups).any? }
|
|
51
49
|
gems.concat(deps.map(&:name))
|
|
52
50
|
end
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
{
|
|
53
|
+
gems: gems,
|
|
54
|
+
sources: sources,
|
|
55
|
+
ruby: options[:ruby],
|
|
56
|
+
conservative: conservative,
|
|
57
|
+
bundler: update_bundler,
|
|
58
|
+
}
|
|
57
59
|
end
|
|
58
60
|
|
|
61
|
+
Plugin.gemfile_install(Bundler.default_gemfile, Bundler.default_lockfile, unlock.dup) if Bundler.settings[:plugins]
|
|
62
|
+
|
|
63
|
+
Bundler::CLI::Common.ensure_all_gems_in_lockfile!(explicit_gems) if explicit_gems
|
|
64
|
+
|
|
65
|
+
Bundler.definition(unlock)
|
|
66
|
+
|
|
59
67
|
Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
|
|
60
68
|
|
|
61
69
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
|
@@ -66,8 +74,7 @@ module Bundler
|
|
|
66
74
|
opts["force"] = options[:redownload] if options[:redownload]
|
|
67
75
|
|
|
68
76
|
Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
|
|
69
|
-
Bundler::CLI::Common.
|
|
70
|
-
Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
|
|
77
|
+
Bundler::CLI::Common.configure_cooldown(options)
|
|
71
78
|
|
|
72
79
|
Bundler.definition.validate_runtime!
|
|
73
80
|
|
|
@@ -84,6 +91,8 @@ module Bundler
|
|
|
84
91
|
if CLI::Common.clean_after_install?
|
|
85
92
|
require_relative "clean"
|
|
86
93
|
Bundler::CLI::Clean.new(options).run
|
|
94
|
+
else
|
|
95
|
+
CLI::Common.prune(options)
|
|
87
96
|
end
|
|
88
97
|
|
|
89
98
|
if locked_gems
|
|
@@ -276,10 +276,12 @@ module Bundler
|
|
|
276
276
|
method_option "with", type: :array, banner: "Include gems that are part of the specified named group (removed)."
|
|
277
277
|
method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
|
|
278
278
|
def install
|
|
279
|
-
%w[clean deployment frozen
|
|
279
|
+
%w[clean deployment frozen path shebang without with].each do |option|
|
|
280
280
|
remembered_flag_deprecation(option)
|
|
281
281
|
end
|
|
282
282
|
|
|
283
|
+
remembered_flag_deprecation("no-prune", option_name: "keep_outdated_cache")
|
|
284
|
+
|
|
283
285
|
print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
|
|
284
286
|
|
|
285
287
|
remembered_flag_deprecation("deployment", negative: true)
|
|
@@ -317,7 +319,7 @@ module Bundler
|
|
|
317
319
|
method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
|
|
318
320
|
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
|
|
319
321
|
method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
|
|
320
|
-
method_option "bundler", type: :string, lazy_default: "
|
|
322
|
+
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
|
|
321
323
|
method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
|
|
322
324
|
method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
|
|
323
325
|
method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
|
|
@@ -405,7 +407,8 @@ module Bundler
|
|
|
405
407
|
method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
|
|
406
408
|
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
|
407
409
|
method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
|
|
408
|
-
method_option "optimistic", type: :boolean, banner: "
|
|
410
|
+
method_option "optimistic", type: :boolean, banner: "Ignored (now default behavior)"
|
|
411
|
+
method_option "pessimistic", type: :boolean, banner: "Adds pessimistic declaration of version to gem"
|
|
409
412
|
method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
|
|
410
413
|
method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
|
|
411
414
|
def add(*gems)
|
|
@@ -472,9 +475,8 @@ module Bundler
|
|
|
472
475
|
print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
|
|
473
476
|
print_remembered_flag_deprecation("--no-all", "cache_all", "false") if ARGV.include?("--no-all")
|
|
474
477
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
end
|
|
478
|
+
remembered_flag_deprecation("frozen")
|
|
479
|
+
remembered_flag_deprecation("no-prune", option_name: "keep_outdated_cache")
|
|
478
480
|
|
|
479
481
|
if flag_passed?("--path")
|
|
480
482
|
removed_message =
|
|
@@ -642,7 +644,7 @@ module Bundler
|
|
|
642
644
|
method_option "pre", type: :boolean, banner: "If updating, always choose the highest allowed version, regardless of prerelease status"
|
|
643
645
|
method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
|
|
644
646
|
method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
|
|
645
|
-
method_option "bundler", type: :string, lazy_default: "
|
|
647
|
+
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
|
|
646
648
|
method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
|
|
647
649
|
def lock
|
|
648
650
|
require_relative "cli/lock"
|
|
@@ -759,9 +761,6 @@ module Bundler
|
|
|
759
761
|
config[:current_command] = original_command
|
|
760
762
|
end
|
|
761
763
|
|
|
762
|
-
def current_command=(command)
|
|
763
|
-
end
|
|
764
|
-
|
|
765
764
|
def print_command
|
|
766
765
|
return unless Bundler.ui.debug?
|
|
767
766
|
cmd = current_command
|
|
@@ -787,9 +786,13 @@ module Bundler
|
|
|
787
786
|
return unless SharedHelpers.md5_available?
|
|
788
787
|
|
|
789
788
|
require_relative "vendored_uri"
|
|
789
|
+
require "rubygems/compact_index_client"
|
|
790
|
+
if Gem::CompactIndexClient.respond_to?(:filesystem_access=)
|
|
791
|
+
Gem::CompactIndexClient.filesystem_access = SharedHelpers.method(:filesystem_access)
|
|
792
|
+
end
|
|
790
793
|
remote = Source::Rubygems::Remote.new(Gem::URI("https://rubygems.org"))
|
|
791
794
|
cache_path = Bundler.user_cache.join("compact_index", remote.cache_slug)
|
|
792
|
-
latest =
|
|
795
|
+
latest = Gem::CompactIndexClient.new(cache_path).latest_version("bundler")
|
|
793
796
|
return unless latest
|
|
794
797
|
|
|
795
798
|
current = Gem::Version.new(VERSION)
|
|
@@ -10,13 +10,14 @@ module Bundler
|
|
|
10
10
|
attr_accessor :no_lock
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
attr_writer :lockfile
|
|
13
|
+
attr_writer :lockfile, :overrides
|
|
14
14
|
|
|
15
15
|
attr_reader(
|
|
16
16
|
:dependencies,
|
|
17
17
|
:locked_checksums,
|
|
18
18
|
:locked_deps,
|
|
19
19
|
:locked_gems,
|
|
20
|
+
:overrides,
|
|
20
21
|
:platforms,
|
|
21
22
|
:ruby_version,
|
|
22
23
|
:lockfile,
|
|
@@ -37,7 +38,10 @@ module Bundler
|
|
|
37
38
|
|
|
38
39
|
raise GemfileNotFound, "#{gemfile} not found" unless gemfile.file?
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_EVAL, gemfile, lockfile)
|
|
42
|
+
Dsl.evaluate(gemfile, lockfile, unlock).tap do |definition|
|
|
43
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_EVAL, definition)
|
|
44
|
+
end
|
|
41
45
|
end
|
|
42
46
|
|
|
43
47
|
#
|
|
@@ -58,7 +62,7 @@ module Bundler
|
|
|
58
62
|
# to be updated or true if all gems should be updated
|
|
59
63
|
# @param ruby_version [Bundler::RubyVersion, nil] Requested Ruby Version
|
|
60
64
|
# @param optional_groups [Array(String)] A list of optional groups
|
|
61
|
-
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
|
|
65
|
+
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [], overrides = [])
|
|
62
66
|
unlock ||= {}
|
|
63
67
|
|
|
64
68
|
if unlock == true
|
|
@@ -88,6 +92,7 @@ module Bundler
|
|
|
88
92
|
@specs = nil
|
|
89
93
|
@ruby_version = ruby_version
|
|
90
94
|
@gemfiles = gemfiles
|
|
95
|
+
@overrides = overrides
|
|
91
96
|
|
|
92
97
|
@lockfile = lockfile
|
|
93
98
|
@lockfile_contents = String.new
|
|
@@ -109,6 +114,7 @@ module Bundler
|
|
|
109
114
|
@locked_bundler_version = @locked_gems.bundler_version
|
|
110
115
|
@locked_ruby_version = @locked_gems.ruby_version
|
|
111
116
|
@locked_deps = @locked_gems.dependencies
|
|
117
|
+
Override.attach(@locked_gems.specs, @overrides)
|
|
112
118
|
@originally_locked_specs = SpecSet.new(@locked_gems.specs)
|
|
113
119
|
@originally_locked_sources = @locked_gems.sources
|
|
114
120
|
@locked_checksums = @locked_gems.checksums
|
|
@@ -192,7 +198,7 @@ module Bundler
|
|
|
192
198
|
|
|
193
199
|
sources.cached!
|
|
194
200
|
|
|
195
|
-
if options[:add_checksums] || (!options[:local] && (install_needed? ||
|
|
201
|
+
if options[:add_checksums] || (!options[:local] && (install_needed? || refetch_needed?(options)))
|
|
196
202
|
sources.remote!
|
|
197
203
|
true
|
|
198
204
|
else
|
|
@@ -509,12 +515,6 @@ module Bundler
|
|
|
509
515
|
"Your Ruby version is #{actual}, but your Gemfile specified #{expected}"
|
|
510
516
|
when :engine_version
|
|
511
517
|
"Your #{Bundler::RubyVersion.system.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}"
|
|
512
|
-
when :patchlevel
|
|
513
|
-
if !expected.is_a?(String)
|
|
514
|
-
"The Ruby patchlevel in your Gemfile must be a string"
|
|
515
|
-
else
|
|
516
|
-
"Your Ruby patchlevel is #{actual}, but your Gemfile specified #{expected}"
|
|
517
|
-
end
|
|
518
518
|
end
|
|
519
519
|
|
|
520
520
|
raise RubyVersionMismatch, msg
|
|
@@ -627,6 +627,17 @@ module Bundler
|
|
|
627
627
|
resolve_needed? || missing_specs?
|
|
628
628
|
end
|
|
629
629
|
|
|
630
|
+
# Reinstalling installs from the cached archive, and `bundle cache` copies it
|
|
631
|
+
# into the app cache, so a cache emptied by the `prune` setting or by hand has
|
|
632
|
+
# to go back to the remotes to refill it.
|
|
633
|
+
def refetch_needed?(options)
|
|
634
|
+
return false unless options[:force] || options["cache-archives"]
|
|
635
|
+
|
|
636
|
+
resolve.for(requested_dependencies, [Bundler.local_platform]).any? do |spec|
|
|
637
|
+
spec.source.is_a?(Source::Rubygems) && spec.source.uncached?(spec)
|
|
638
|
+
end
|
|
639
|
+
end
|
|
640
|
+
|
|
630
641
|
def something_changed?
|
|
631
642
|
return true unless lockfile_exists?
|
|
632
643
|
|
|
@@ -639,7 +650,7 @@ module Bundler
|
|
|
639
650
|
@missing_lockfile_dep ||
|
|
640
651
|
@unlocking_bundler ||
|
|
641
652
|
@locked_spec_with_missing_checksums ||
|
|
642
|
-
|
|
653
|
+
@locked_spec_with_empty_checksums ||
|
|
643
654
|
@locked_spec_with_missing_deps ||
|
|
644
655
|
@locked_spec_with_invalid_deps
|
|
645
656
|
end
|
|
@@ -648,16 +659,6 @@ module Bundler
|
|
|
648
659
|
unlocking? || something_changed?
|
|
649
660
|
end
|
|
650
661
|
|
|
651
|
-
# Only a remote fetch can fill an empty CHECKSUMS entry, so it justifies a
|
|
652
|
-
# resolution only when one is coming. Resolving locally for it would repeat
|
|
653
|
-
# on every `Bundler.setup` without changing the lockfile. Frozen mode still
|
|
654
|
-
# has to refuse the entry.
|
|
655
|
-
def empty_checksums_actionable?
|
|
656
|
-
return false unless @locked_spec_with_empty_checksums
|
|
657
|
-
|
|
658
|
-
Bundler.frozen_bundle? || !sources.local_mode?
|
|
659
|
-
end
|
|
660
|
-
|
|
661
662
|
def should_add_extra_platforms?
|
|
662
663
|
!lockfile_exists? && Bundler::MatchPlatform.generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
|
|
663
664
|
end
|
|
@@ -671,7 +672,20 @@ module Bundler
|
|
|
671
672
|
end
|
|
672
673
|
|
|
673
674
|
def expanded_dependencies
|
|
674
|
-
dependencies_with_bundler + metadata_dependencies
|
|
675
|
+
apply_overrides_to(dependencies_with_bundler) + metadata_dependencies
|
|
676
|
+
end
|
|
677
|
+
|
|
678
|
+
def apply_overrides_to(deps)
|
|
679
|
+
return deps if @overrides.empty?
|
|
680
|
+
deps.map {|dep| apply_override_to(dep) }
|
|
681
|
+
end
|
|
682
|
+
|
|
683
|
+
def apply_override_to(dep)
|
|
684
|
+
override = Override.find_for(@overrides, dep.name, :version)
|
|
685
|
+
return dep unless override
|
|
686
|
+
new_dep = dep.dup
|
|
687
|
+
new_dep.instance_variable_set(:@requirement, override.apply_to(dep.requirement))
|
|
688
|
+
new_dep
|
|
675
689
|
end
|
|
676
690
|
|
|
677
691
|
def dependencies_with_bundler
|
|
@@ -1070,7 +1084,7 @@ module Bundler
|
|
|
1070
1084
|
@locked_specs.delete(locked_specs.select {|s| s.source != dep.source })
|
|
1071
1085
|
end
|
|
1072
1086
|
|
|
1073
|
-
unless dep.matches_spec?(locked_specs.first)
|
|
1087
|
+
unless apply_override_to(dep).matches_spec?(locked_specs.first)
|
|
1074
1088
|
@gems_to_unlock << name
|
|
1075
1089
|
dep_changed = true
|
|
1076
1090
|
end
|
|
@@ -1080,9 +1094,32 @@ module Bundler
|
|
|
1080
1094
|
@changed_dependencies << name if dep_changed
|
|
1081
1095
|
end
|
|
1082
1096
|
|
|
1097
|
+
converge_overrides_outside_dependencies
|
|
1098
|
+
|
|
1083
1099
|
@changed_dependencies.any?
|
|
1084
1100
|
end
|
|
1085
1101
|
|
|
1102
|
+
def converge_overrides_outside_dependencies
|
|
1103
|
+
@overrides.each do |override|
|
|
1104
|
+
# :all overrides are intentionally not pre-unlocked. They take effect on
|
|
1105
|
+
# fresh resolution (no lockfile) or when the user runs `bundle update`.
|
|
1106
|
+
# Forcing a full re-resolve from a single :all directive would surprise
|
|
1107
|
+
# users with unrelated dependency churn.
|
|
1108
|
+
next unless override.target.is_a?(String)
|
|
1109
|
+
|
|
1110
|
+
name = override.target
|
|
1111
|
+
next if @changed_dependencies.include?(name)
|
|
1112
|
+
next if @originally_locked_specs[name].empty?
|
|
1113
|
+
# version: overrides on direct deps are detected in the per-dep
|
|
1114
|
+
# converge_dependencies loop via apply_override_to + matches_spec?.
|
|
1115
|
+
# Other fields are not visible there, so they always reach here.
|
|
1116
|
+
next if override.field == :version && @dependencies.any? {|d| d.name == name }
|
|
1117
|
+
|
|
1118
|
+
@gems_to_unlock << name
|
|
1119
|
+
@changed_dependencies << name
|
|
1120
|
+
end
|
|
1121
|
+
end
|
|
1122
|
+
|
|
1086
1123
|
# Remove elements from the locked specs that are expired. This will most
|
|
1087
1124
|
# commonly happen if the Gemfile has changed since the lockfile was last
|
|
1088
1125
|
# generated
|
|
@@ -1318,7 +1355,7 @@ module Bundler
|
|
|
1318
1355
|
|
|
1319
1356
|
def new_resolution_base(last_resolve:, unlock:)
|
|
1320
1357
|
new_resolution_platforms = @current_platform_missing ? @new_platforms + [Bundler.local_platform] : @new_platforms
|
|
1321
|
-
Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: unlock, prerelease: gem_version_promoter.pre?, prefer_local: @prefer_local, new_platforms: new_resolution_platforms, explicit_unlocks: @explicit_unlocks)
|
|
1358
|
+
Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: unlock, prerelease: gem_version_promoter.pre?, prefer_local: @prefer_local, new_platforms: new_resolution_platforms, overrides: @overrides, explicit_unlocks: @explicit_unlocks)
|
|
1322
1359
|
end
|
|
1323
1360
|
|
|
1324
1361
|
def new_resolver(base)
|
|
@@ -22,7 +22,7 @@ module Bundler
|
|
|
22
22
|
GITHUB_PULL_REQUEST_URL = %r{\Ahttps://github\.com/([A-Za-z0-9_\-\.]+/[A-Za-z0-9_\-\.]+)/pull/(\d+)\z}
|
|
23
23
|
GITLAB_MERGE_REQUEST_URL = %r{\Ahttps://gitlab\.com/([A-Za-z0-9_\-\./]+)/-/merge_requests/(\d+)\z}
|
|
24
24
|
|
|
25
|
-
attr_reader :gemspecs, :gemfile
|
|
25
|
+
attr_reader :gemspecs, :gemfile, :overrides
|
|
26
26
|
attr_accessor :dependencies
|
|
27
27
|
|
|
28
28
|
def initialize
|
|
@@ -40,6 +40,7 @@ module Bundler
|
|
|
40
40
|
@gemfile = nil
|
|
41
41
|
@gemfiles = []
|
|
42
42
|
@lockfile = nil
|
|
43
|
+
@overrides = []
|
|
43
44
|
add_git_sources
|
|
44
45
|
end
|
|
45
46
|
|
|
@@ -123,9 +124,15 @@ module Bundler
|
|
|
123
124
|
|
|
124
125
|
if options.key?("type")
|
|
125
126
|
options["type"] = options["type"].to_s
|
|
126
|
-
unless Plugin.
|
|
127
|
+
unless (source_plugin = Plugin.source_plugin(options["type"]))
|
|
127
128
|
raise InvalidOption, "No plugin sources available for #{options["type"]}"
|
|
128
129
|
end
|
|
130
|
+
# Implicitly add a dependency on source plugins who are named bundler-source-<type>,
|
|
131
|
+
# and aren't already mentioned in the Gemfile.
|
|
132
|
+
# See also Plugin::DSL#source
|
|
133
|
+
if source_plugin.start_with?("bundler-source-") && !@dependencies.any? {|d| d.name == source_plugin }
|
|
134
|
+
plugin(source_plugin)
|
|
135
|
+
end
|
|
129
136
|
|
|
130
137
|
unless block_given?
|
|
131
138
|
raise InvalidOption, "You need to pass a block to #source with :type option"
|
|
@@ -188,10 +195,32 @@ module Bundler
|
|
|
188
195
|
with_source(git_source) { yield }
|
|
189
196
|
end
|
|
190
197
|
|
|
198
|
+
SUPPORTED_OVERRIDE_FIELDS = [:version, :required_ruby_version, :required_rubygems_version].freeze
|
|
199
|
+
SUPPORTED_OVERRIDE_SYMBOL_OPERATIONS = [:ignore_upper].freeze
|
|
200
|
+
|
|
201
|
+
def override(target, **operations)
|
|
202
|
+
validate_override_target!(target)
|
|
203
|
+
|
|
204
|
+
if target == :all && operations.key?(:version)
|
|
205
|
+
raise ArgumentError, "`override :all, version:` is not allowed; version requirements are per-gem"
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
operations.each do |field, operation|
|
|
209
|
+
validate_override_field!(field)
|
|
210
|
+
validate_override_operation!(operation)
|
|
211
|
+
validate_override_uniqueness!(target, field)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
source_location = caller_locations(1, 1)&.first
|
|
215
|
+
operations.each do |field, operation|
|
|
216
|
+
@overrides << Override.new(target, field, operation, source_location: source_location)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
191
220
|
def to_definition(lockfile, unlock)
|
|
192
221
|
check_primary_source_safety
|
|
193
222
|
lockfile = @lockfile unless @lockfile.nil?
|
|
194
|
-
Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
|
|
223
|
+
Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles, @overrides)
|
|
195
224
|
end
|
|
196
225
|
|
|
197
226
|
def group(*args, &blk)
|
|
@@ -233,8 +262,15 @@ module Bundler
|
|
|
233
262
|
@env = old
|
|
234
263
|
end
|
|
235
264
|
|
|
236
|
-
def plugin(*args)
|
|
237
|
-
|
|
265
|
+
def plugin(name, *args)
|
|
266
|
+
options = args.last.is_a?(Hash) ? args.pop.dup : {}
|
|
267
|
+
version = args || [">= 0"]
|
|
268
|
+
|
|
269
|
+
normalize_options(name, version, options)
|
|
270
|
+
options["plugin"] = true
|
|
271
|
+
options["require"] = false
|
|
272
|
+
|
|
273
|
+
add_dependency(name, version, options)
|
|
238
274
|
end
|
|
239
275
|
|
|
240
276
|
def method_missing(name, *args)
|
|
@@ -248,6 +284,39 @@ module Bundler
|
|
|
248
284
|
|
|
249
285
|
private
|
|
250
286
|
|
|
287
|
+
def validate_override_target!(target)
|
|
288
|
+
return if target == :all
|
|
289
|
+
return if target.is_a?(String)
|
|
290
|
+
raise ArgumentError, "override target must be :all or a gem name string, got #{target.inspect}"
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
def validate_override_field!(field)
|
|
294
|
+
return if SUPPORTED_OVERRIDE_FIELDS.include?(field)
|
|
295
|
+
supported = SUPPORTED_OVERRIDE_FIELDS.map {|f| "`#{f}:`" }.join(", ")
|
|
296
|
+
raise ArgumentError, "unsupported override field `#{field}:`; supported fields: #{supported}"
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def validate_override_operation!(operation)
|
|
300
|
+
case operation
|
|
301
|
+
when String
|
|
302
|
+
Gem::Requirement.new(operation)
|
|
303
|
+
when nil
|
|
304
|
+
# ok
|
|
305
|
+
when Symbol
|
|
306
|
+
return if SUPPORTED_OVERRIDE_SYMBOL_OPERATIONS.include?(operation)
|
|
307
|
+
raise ArgumentError, "unsupported override operation: #{operation.inspect}"
|
|
308
|
+
else
|
|
309
|
+
raise ArgumentError, "override operation must be a String, Symbol, or nil, got #{operation.inspect}"
|
|
310
|
+
end
|
|
311
|
+
rescue Gem::Requirement::BadRequirementError => e
|
|
312
|
+
raise ArgumentError, "invalid override version requirement #{operation.inspect}: #{e.message}"
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
def validate_override_uniqueness!(target, field)
|
|
316
|
+
return unless @overrides.any? {|o| o.target == target && o.field == field }
|
|
317
|
+
raise ArgumentError, "duplicate override for #{target.inspect} `#{field}:`"
|
|
318
|
+
end
|
|
319
|
+
|
|
251
320
|
def add_dependency(name, version = nil, options = {})
|
|
252
321
|
options["gemfile"] = @gemfile
|
|
253
322
|
options["source"] ||= @source
|
|
@@ -262,13 +331,10 @@ module Bundler
|
|
|
262
331
|
|
|
263
332
|
gemspec_dep = [dep, current].find(&:gemspec_dev_dep?)
|
|
264
333
|
if gemspec_dep
|
|
265
|
-
require_relative "
|
|
266
|
-
require_relative "vendor/pub_grub/lib/pub_grub/version_constraint"
|
|
267
|
-
require_relative "vendor/pub_grub/lib/pub_grub/version_union"
|
|
268
|
-
require_relative "vendor/pub_grub/lib/pub_grub/rubygems"
|
|
334
|
+
require_relative "vendored_pub_grub"
|
|
269
335
|
|
|
270
|
-
current_gemspec_range = PubGrub::RubyGems.requirement_to_range(current.requirement)
|
|
271
|
-
next_gemspec_range = PubGrub::RubyGems.requirement_to_range(dep.requirement)
|
|
336
|
+
current_gemspec_range = Gem::PubGrub::RubyGems.requirement_to_range(current.requirement)
|
|
337
|
+
next_gemspec_range = Gem::PubGrub::RubyGems.requirement_to_range(dep.requirement)
|
|
272
338
|
|
|
273
339
|
if current_gemspec_range.intersects?(next_gemspec_range)
|
|
274
340
|
dep = Dependency.new(name, current.requirement.as_list + dep.requirement.as_list, options)
|
|
@@ -5,24 +5,33 @@ module Bundler
|
|
|
5
5
|
class EndpointSpecification < Gem::Specification
|
|
6
6
|
include MatchRemoteMetadata
|
|
7
7
|
|
|
8
|
-
attr_reader :name, :version, :platform, :checksum, :created_at
|
|
8
|
+
attr_reader :name, :version, :platform, :checksum, :created_at, :content_address
|
|
9
9
|
attr_writer :dependencies
|
|
10
10
|
attr_accessor :remote, :locked_platform
|
|
11
11
|
|
|
12
|
-
def initialize(name, version,
|
|
12
|
+
def initialize(name, version, suffix, spec_fetcher, dependencies, metadata = nil)
|
|
13
13
|
super()
|
|
14
14
|
@name = name
|
|
15
15
|
@version = Gem::Version.create version
|
|
16
|
-
@platform = Gem::Platform.new(platform)
|
|
17
16
|
@spec_fetcher = spec_fetcher
|
|
18
17
|
@dependencies = nil
|
|
19
18
|
@unbuilt_dependencies = dependencies
|
|
19
|
+
@content_address = nil
|
|
20
|
+
@required_platform = nil
|
|
20
21
|
|
|
21
22
|
@loaded_from = nil
|
|
22
23
|
@remote_specification = nil
|
|
23
24
|
@locked_platform = nil
|
|
24
25
|
|
|
25
26
|
parse_metadata(metadata)
|
|
27
|
+
|
|
28
|
+
if Gem::ContentAddress.content_addressed_row?(suffix, @required_platform, @required_ruby_version)
|
|
29
|
+
@content_address = suffix
|
|
30
|
+
@platform = @required_platform
|
|
31
|
+
@required_rubygems_version ||= Gem::Requirement.default
|
|
32
|
+
else
|
|
33
|
+
@platform = Gem::Platform.new(suffix)
|
|
34
|
+
end
|
|
26
35
|
end
|
|
27
36
|
|
|
28
37
|
def insecurely_materialized?
|
|
@@ -147,18 +156,21 @@ module Bundler
|
|
|
147
156
|
private
|
|
148
157
|
|
|
149
158
|
def _remote_specification
|
|
150
|
-
|
|
159
|
+
suffix = @content_address || @platform
|
|
160
|
+
@_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, suffix])
|
|
151
161
|
end
|
|
152
162
|
|
|
153
163
|
def local_specification_path
|
|
154
|
-
|
|
164
|
+
File.join(Gem::SpecificationRecord.specification_dir_for(self, base_dir),
|
|
165
|
+
"#{full_name}.gemspec")
|
|
155
166
|
end
|
|
156
167
|
|
|
157
168
|
def parse_metadata(data)
|
|
169
|
+
@created_at = nil
|
|
170
|
+
|
|
158
171
|
unless data
|
|
159
172
|
@required_ruby_version = nil
|
|
160
173
|
@required_rubygems_version = nil
|
|
161
|
-
@created_at = nil
|
|
162
174
|
return
|
|
163
175
|
end
|
|
164
176
|
|
|
@@ -181,22 +193,47 @@ module Bundler
|
|
|
181
193
|
when "ruby"
|
|
182
194
|
@required_ruby_version = Gem::Requirement.new(v)
|
|
183
195
|
when "created_at"
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
Time.new(value)
|
|
188
|
-
rescue ArgumentError
|
|
189
|
-
nil
|
|
190
|
-
end
|
|
191
|
-
end
|
|
196
|
+
@created_at = parse_created_at(v.is_a?(Array) ? v.last : v)&.freeze
|
|
197
|
+
when "platform"
|
|
198
|
+
@required_platform = required_platform_from(Array(v).last)
|
|
192
199
|
end
|
|
193
200
|
end
|
|
194
201
|
rescue StandardError => e
|
|
195
202
|
raise GemspecError, "There was an error parsing the metadata for the gem #{name} (#{version}): #{e.class}\n#{e}\nThe metadata was #{data.inspect}"
|
|
196
203
|
end
|
|
197
204
|
|
|
205
|
+
# Matches an ISO 8601 time zone designator at the end of a timestamp.
|
|
206
|
+
TIME_ZONE_SUFFIX = /(?:Z|z|[+-]\d{2}(?::?\d{2})?)\z/
|
|
207
|
+
private_constant :TIME_ZONE_SUFFIX
|
|
208
|
+
|
|
209
|
+
# See Gem::Cooldown::FOUR_DIGIT_YEAR.
|
|
210
|
+
FOUR_DIGIT_YEAR = /\A\d{4}-/
|
|
211
|
+
private_constant :FOUR_DIGIT_YEAR
|
|
212
|
+
|
|
213
|
+
# A timestamp without a time zone offset is read as UTC, because reading
|
|
214
|
+
# it as local time would shift the cooldown window by the environment's
|
|
215
|
+
# offset. Unparsable values and years outside four digits become nil so
|
|
216
|
+
# the cooldown fails open.
|
|
217
|
+
def parse_created_at(value)
|
|
218
|
+
return unless value.is_a?(String) && value.match?(FOUR_DIGIT_YEAR)
|
|
219
|
+
|
|
220
|
+
require "time"
|
|
221
|
+
begin
|
|
222
|
+
Time.iso8601(value.match?(TIME_ZONE_SUFFIX) ? value : "#{value}Z")
|
|
223
|
+
rescue ArgumentError
|
|
224
|
+
nil
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
198
228
|
def build_dependency(name, requirements)
|
|
199
229
|
Dependency.new(name, requirements)
|
|
200
230
|
end
|
|
231
|
+
|
|
232
|
+
def required_platform_from(value)
|
|
233
|
+
value = value.to_s
|
|
234
|
+
return if value.empty?
|
|
235
|
+
|
|
236
|
+
Gem::Platform.new(value)
|
|
237
|
+
end
|
|
201
238
|
end
|
|
202
239
|
end
|