rubygems-update 3.5.3 → 3.7.1
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 +1410 -686
- data/CODE_OF_CONDUCT.md +79 -28
- data/CONTRIBUTING.md +4 -226
- data/Manifest.txt +107 -83
- data/README.md +16 -11
- data/SECURITY.md +7 -0
- data/bundler/CHANGELOG.md +1525 -931
- data/bundler/README.md +9 -9
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +10 -11
- data/bundler/lib/bundler/checksum.rb +22 -12
- data/bundler/lib/bundler/cli/add.rb +3 -1
- data/bundler/lib/bundler/cli/binstubs.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +3 -3
- data/bundler/lib/bundler/cli/common.rb +1 -1
- data/bundler/lib/bundler/cli/config.rb +2 -2
- data/bundler/lib/bundler/cli/console.rb +8 -10
- data/bundler/lib/bundler/cli/doctor/diagnose.rb +167 -0
- data/bundler/lib/bundler/cli/doctor/ssl.rb +249 -0
- data/bundler/lib/bundler/cli/doctor.rb +27 -151
- data/bundler/lib/bundler/cli/exec.rb +1 -0
- data/bundler/lib/bundler/cli/fund.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +74 -46
- data/bundler/lib/bundler/cli/info.rb +6 -6
- data/bundler/lib/bundler/cli/inject.rb +3 -3
- data/bundler/lib/bundler/cli/install.rb +19 -10
- data/bundler/lib/bundler/cli/issue.rb +3 -3
- data/bundler/lib/bundler/cli/lock.rb +32 -11
- data/bundler/lib/bundler/cli/outdated.rb +23 -23
- data/bundler/lib/bundler/cli/plugin.rb +3 -2
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +3 -3
- data/bundler/lib/bundler/cli/update.rb +3 -3
- data/bundler/lib/bundler/cli.rb +75 -145
- data/bundler/lib/bundler/compact_index_client/cache.rb +48 -73
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +6 -16
- data/bundler/lib/bundler/compact_index_client.rb +52 -85
- data/bundler/lib/bundler/constants.rb +8 -1
- data/bundler/lib/bundler/current_ruby.rb +48 -34
- data/bundler/lib/bundler/definition.rb +501 -328
- data/bundler/lib/bundler/dependency.rb +93 -47
- data/bundler/lib/bundler/dsl.rb +147 -103
- data/bundler/lib/bundler/endpoint_specification.rb +30 -3
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/environment_preserver.rb +5 -23
- data/bundler/lib/bundler/errors.rb +53 -5
- data/bundler/lib/bundler/feature_flag.rb +18 -18
- data/bundler/lib/bundler/fetcher/compact_index.rb +16 -25
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +34 -8
- data/bundler/lib/bundler/fetcher.rb +63 -26
- data/bundler/lib/bundler/force_platform.rb +0 -2
- data/bundler/lib/bundler/friendly_errors.rb +3 -2
- data/bundler/lib/bundler/gem_helper.rb +1 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +42 -40
- data/bundler/lib/bundler/index.rb +7 -2
- data/bundler/lib/bundler/injector.rb +14 -16
- data/bundler/lib/bundler/inline.rb +42 -17
- data/bundler/lib/bundler/installer/gem_installer.rb +4 -3
- data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
- data/bundler/lib/bundler/installer/standalone.rb +2 -5
- data/bundler/lib/bundler/installer.rb +22 -45
- data/bundler/lib/bundler/lazy_specification.rb +121 -48
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +36 -9
- data/bundler/lib/bundler/man/bundle-add.1 +44 -27
- data/bundler/lib/bundler/man/bundle-add.1.ronn +52 -23
- data/bundler/lib/bundler/man/bundle-binstubs.1 +9 -6
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-cache.1 +32 -4
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/bundler/lib/bundler/man/bundle-check.1 +7 -5
- data/bundler/lib/bundler/man/bundle-check.1.ronn +7 -2
- data/bundler/lib/bundler/man/bundle-clean.1 +3 -3
- data/bundler/lib/bundler/man/bundle-config.1 +180 -138
- data/bundler/lib/bundler/man/bundle-config.1.ronn +96 -99
- data/bundler/lib/bundler/man/bundle-console.1 +4 -6
- data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-doctor.1 +46 -7
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +49 -5
- data/bundler/lib/bundler/man/bundle-env.1 +9 -0
- data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +9 -6
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
- data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +69 -28
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +42 -6
- data/bundler/lib/bundler/man/bundle-help.1 +3 -3
- data/bundler/lib/bundler/man/bundle-info.1 +7 -4
- data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/bundler/lib/bundler/man/bundle-init.1 +5 -5
- data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/bundler/lib/bundler/man/bundle-inject.1 +13 -5
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +10 -2
- data/bundler/lib/bundler/man/bundle-install.1 +20 -17
- data/bundler/lib/bundler/man/bundle-install.1.ronn +26 -23
- data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
- data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
- data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-list.1 +3 -3
- data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +23 -8
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/bundler/lib/bundler/man/bundle-open.1 +4 -4
- data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +10 -7
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- data/bundler/lib/bundler/man/bundle-platform.1 +3 -3
- data/bundler/lib/bundler/man/bundle-plugin.1 +9 -6
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle-pristine.1 +3 -3
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +3 -3
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +7 -4
- data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/bundler/lib/bundler/man/bundle-update.1 +17 -11
- data/bundler/lib/bundler/man/bundle-update.1.ronn +17 -9
- data/bundler/lib/bundler/man/bundle-version.1 +3 -3
- data/bundler/lib/bundler/man/bundle-viz.1 +6 -6
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle.1 +3 -3
- data/bundler/lib/bundler/man/gemfile.5 +7 -5
- data/bundler/lib/bundler/man/gemfile.5.ronn +8 -2
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_platform.rb +31 -12
- data/bundler/lib/bundler/materialization.rb +59 -0
- data/bundler/lib/bundler/mirror.rb +3 -3
- data/bundler/lib/bundler/plugin/api/source.rb +5 -4
- data/bundler/lib/bundler/plugin/events.rb +24 -0
- data/bundler/lib/bundler/plugin/index.rb +5 -1
- data/bundler/lib/bundler/plugin/installer/path.rb +26 -0
- data/bundler/lib/bundler/plugin/installer.rb +37 -17
- data/bundler/lib/bundler/plugin/source_list.rb +4 -4
- data/bundler/lib/bundler/plugin.rb +21 -2
- data/bundler/lib/bundler/process_lock.rb +10 -14
- data/bundler/lib/bundler/remote_specification.rb +6 -1
- data/bundler/lib/bundler/resolver/base.rb +14 -3
- data/bundler/lib/bundler/resolver/candidate.rb +18 -27
- data/bundler/lib/bundler/resolver/package.rb +20 -3
- data/bundler/lib/bundler/resolver/spec_group.rb +22 -27
- data/bundler/lib/bundler/resolver/strategy.rb +40 -0
- data/bundler/lib/bundler/resolver.rb +114 -52
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/ruby_dsl.rb +12 -3
- data/bundler/lib/bundler/ruby_version.rb +7 -1
- data/bundler/lib/bundler/rubygems_ext.rb +303 -150
- data/bundler/lib/bundler/rubygems_gem_installer.rb +40 -5
- data/bundler/lib/bundler/rubygems_integration.rb +40 -73
- data/bundler/lib/bundler/runtime.rb +48 -35
- data/bundler/lib/bundler/self_manager.rb +36 -26
- data/bundler/lib/bundler/settings/validator.rb +0 -23
- data/bundler/lib/bundler/settings.rb +36 -27
- data/bundler/lib/bundler/setup.rb +6 -0
- data/bundler/lib/bundler/shared_helpers.rb +45 -25
- data/bundler/lib/bundler/source/gemspec.rb +1 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +26 -9
- data/bundler/lib/bundler/source/git.rb +113 -41
- data/bundler/lib/bundler/source/metadata.rb +4 -3
- data/bundler/lib/bundler/source/path.rb +14 -18
- data/bundler/lib/bundler/source/rubygems/remote.rb +12 -4
- data/bundler/lib/bundler/source/rubygems.rb +54 -48
- data/bundler/lib/bundler/source.rb +2 -0
- data/bundler/lib/bundler/source_list.rb +54 -12
- data/bundler/lib/bundler/source_map.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +227 -103
- data/bundler/lib/bundler/stub_specification.rb +29 -2
- data/bundler/lib/bundler/templates/Executable +0 -11
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -3
- data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -3
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +17 -15
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +14 -12
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/bundler/lib/bundler/ui/shell.rb +26 -4
- data/bundler/lib/bundler/ui/silent.rb +12 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +3 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +134 -57
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
- data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +43 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +28 -37
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -9
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/bundler/lib/bundler/vendored_net_http.rb +20 -5
- data/bundler/lib/bundler/vendored_securerandom.rb +12 -0
- data/bundler/lib/bundler/vendored_timeout.rb +7 -3
- data/bundler/lib/bundler/vendored_uri.rb +18 -1
- data/bundler/lib/bundler/version.rb +10 -2
- data/bundler/lib/bundler/worker.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +12 -7
- data/bundler/lib/bundler.rb +101 -61
- data/{bundler → doc/bundler}/UPGRADING.md +132 -127
- data/doc/rubygems/CONTRIBUTING.md +227 -0
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +86 -17
- data/exe/update_rubygems +1 -1
- data/lib/rubygems/basic_specification.rb +50 -10
- data/lib/rubygems/bundler_version_finder.rb +1 -1
- data/lib/rubygems/command.rb +1 -4
- data/lib/rubygems/command_manager.rb +5 -6
- data/lib/rubygems/commands/build_command.rb +2 -11
- data/lib/rubygems/commands/cleanup_command.rb +3 -13
- data/lib/rubygems/commands/contents_command.rb +17 -10
- data/lib/rubygems/commands/environment_command.rb +5 -0
- data/lib/rubygems/commands/exec_command.rb +18 -11
- data/lib/rubygems/commands/fetch_command.rb +14 -0
- data/lib/rubygems/commands/help_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +0 -4
- data/lib/rubygems/commands/pristine_command.rb +29 -19
- data/lib/rubygems/commands/push_command.rb +31 -6
- data/lib/rubygems/commands/rdoc_command.rb +3 -10
- data/lib/rubygems/commands/rebuild_command.rb +262 -0
- data/lib/rubygems/commands/setup_command.rb +13 -18
- data/lib/rubygems/commands/sources_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +9 -4
- data/lib/rubygems/commands/unpack_command.rb +0 -6
- data/lib/rubygems/commands/update_command.rb +13 -22
- data/lib/rubygems/config_file.rb +45 -16
- data/lib/rubygems/core_ext/kernel_require.rb +15 -3
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +7 -7
- data/lib/rubygems/dependency.rb +12 -16
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/deprecate.rb +79 -77
- data/lib/rubygems/errors.rb +2 -1
- data/lib/rubygems/exceptions.rb +2 -9
- data/lib/rubygems/ext/builder.rb +21 -8
- data/lib/rubygems/ext/cargo_builder.rb +16 -26
- data/lib/rubygems/ext/cmake_builder.rb +7 -2
- data/lib/rubygems/ext/configure_builder.rb +7 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
- data/lib/rubygems/ext/rake_builder.rb +7 -4
- data/lib/rubygems/gem_runner.rb +9 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +11 -4
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -1
- data/lib/rubygems/gemcutter_utilities.rb +52 -26
- data/lib/rubygems/gemspec_helpers.rb +19 -0
- data/lib/rubygems/install_update_options.rb +5 -0
- data/lib/rubygems/installer.rb +76 -90
- data/lib/rubygems/local_remote_options.rb +8 -8
- data/lib/rubygems/package/tar_header.rb +31 -4
- data/lib/rubygems/package/tar_reader/entry.rb +1 -5
- data/lib/rubygems/package/tar_writer.rb +5 -4
- data/lib/rubygems/package.rb +13 -8
- data/lib/rubygems/platform.rb +148 -43
- data/lib/rubygems/psych_tree.rb +4 -0
- data/lib/rubygems/query_utils.rb +2 -2
- data/lib/rubygems/rdoc.rb +16 -3
- data/lib/rubygems/remote_fetcher.rb +6 -7
- data/lib/rubygems/request.rb +5 -5
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set.rb +4 -7
- data/lib/rubygems/requirement.rb +16 -12
- data/lib/rubygems/resolver/activation_request.rb +1 -1
- data/lib/rubygems/resolver/api_set/gem_parser.rb +2 -5
- data/lib/rubygems/resolver/api_set.rb +13 -8
- data/lib/rubygems/resolver/best_set.rb +1 -29
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/git_set.rb +0 -1
- data/lib/rubygems/resolver/index_set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +1 -1
- data/lib/rubygems/resolver/spec_specification.rb +7 -0
- data/lib/rubygems/resolver.rb +8 -8
- data/lib/rubygems/s3_uri_signer.rb +8 -6
- data/lib/rubygems/safe_marshal/reader.rb +31 -14
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +29 -16
- data/lib/rubygems/safe_yaml.rb +10 -1
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/source/git.rb +22 -17
- data/lib/rubygems/source/installed.rb +3 -1
- data/lib/rubygems/source/local.rb +8 -4
- data/lib/rubygems/source/specific_file.rb +5 -3
- data/lib/rubygems/source.rb +37 -29
- data/lib/rubygems/source_list.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +47 -15
- data/lib/rubygems/specification.rb +110 -183
- data/lib/rubygems/specification_policy.rb +33 -13
- data/lib/rubygems/specification_record.rb +212 -0
- data/lib/rubygems/stub_specification.rb +32 -10
- data/lib/rubygems/target_rbconfig.rb +50 -0
- data/lib/rubygems/uninstaller.rb +42 -22
- data/lib/rubygems/uri.rb +6 -6
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/util/licenses.rb +118 -1
- data/lib/rubygems/util.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/ui.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolution.rb +4 -4
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolver.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/state.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo.rb +2 -2
- data/lib/rubygems/vendor/net-http/COPYING +56 -0
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/generic_request.rb +9 -9
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/header.rb +3 -3
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/request.rb +3 -3
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/requests.rb +35 -30
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/response.rb +2 -2
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/responses.rb +6 -6
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/status.rb +1 -1
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http.rb +149 -70
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/https.rb +1 -1
- data/lib/rubygems/vendor/optparse/COPYING +56 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +16 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +8 -3
- data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +9 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +158 -62
- data/lib/rubygems/vendor/resolv/COPYING +56 -0
- data/lib/rubygems/{resolv → vendor/resolv}/lib/resolv.rb +165 -69
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +10 -11
- data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
- data/lib/rubygems/vendor/uri/COPYING +56 -0
- data/lib/rubygems/vendor/uri/lib/uri/common.rb +880 -0
- data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
- data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1579 -0
- data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
- data/lib/rubygems/vendored_molinillo.rb +3 -0
- data/lib/rubygems/vendored_net_http.rb +5 -0
- data/lib/rubygems/vendored_optparse.rb +3 -0
- data/lib/rubygems/vendored_securerandom.rb +3 -0
- data/lib/rubygems/vendored_timeout.rb +5 -0
- data/lib/rubygems/vendored_tsort.rb +3 -0
- data/lib/rubygems/version.rb +26 -9
- data/lib/rubygems/yaml_serializer.rb +12 -7
- data/lib/rubygems.rb +160 -53
- data/rubygems-update.gemspec +11 -6
- data/setup.rb +1 -1
- metadata +124 -96
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +0 -32
- data/bundler/lib/bundler/gem_helpers.rb +0 -127
- data/bundler/lib/bundler/templates/Executable.bundler +0 -109
- data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
- data/bundler/lib/bundler/vendor/thor/.document +0 -1
- data/bundler/lib/bundler/vendor/tsort/.document +0 -1
- data/bundler/lib/bundler/vendor/uri/.document +0 -1
- data/lib/rubygems/net/http.rb +0 -3
- data/lib/rubygems/net-http/.document +0 -1
- data/lib/rubygems/net-http/LICENSE.txt +0 -22
- data/lib/rubygems/net-http/lib/net/http/backward.rb +0 -40
- data/lib/rubygems/net-protocol/.document +0 -1
- data/lib/rubygems/net-protocol/LICENSE.txt +0 -22
- data/lib/rubygems/optparse/.document +0 -1
- data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
- data/lib/rubygems/optparse.rb +0 -3
- data/lib/rubygems/resolv/.document +0 -1
- data/lib/rubygems/resolv/LICENSE.txt +0 -22
- data/lib/rubygems/resolver/molinillo/.document +0 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/rubygems/resolver/molinillo.rb +0 -3
- data/lib/rubygems/shellwords.rb +0 -3
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/rubygems/timeout/.document +0 -1
- data/lib/rubygems/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/timeout.rb +0 -3
- data/lib/rubygems/tsort/.document +0 -1
- data/lib/rubygems/tsort/LICENSE.txt +0 -22
- data/lib/rubygems/tsort.rb +0 -3
- /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/fileutils}/COPYING +0 -0
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
- /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
- /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
- /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
- /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/exceptions.rb +0 -0
- /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/proxy_delta.rb +0 -0
- /data/{bundler/lib/bundler/vendor/fileutils → lib/rubygems/vendor/net-protocol}/LICENSE.txt +0 -0
- /data/lib/rubygems/{net-protocol → vendor/net-protocol}/lib/net/protocol.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
- /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
@@ -22,6 +22,7 @@ module Bundler
|
|
22
22
|
@metadata_source = Source::Metadata.new
|
23
23
|
|
24
24
|
@merged_gem_lockfile_sections = false
|
25
|
+
@local_mode = true
|
25
26
|
end
|
26
27
|
|
27
28
|
def merged_gem_lockfile_sections?
|
@@ -73,6 +74,10 @@ module Bundler
|
|
73
74
|
global_rubygems_source
|
74
75
|
end
|
75
76
|
|
77
|
+
def local_mode?
|
78
|
+
@local_mode
|
79
|
+
end
|
80
|
+
|
76
81
|
def default_source
|
77
82
|
global_path_source || global_rubygems_source
|
78
83
|
end
|
@@ -86,7 +91,7 @@ module Bundler
|
|
86
91
|
end
|
87
92
|
|
88
93
|
def rubygems_remotes
|
89
|
-
rubygems_sources.
|
94
|
+
rubygems_sources.flat_map(&:remotes).uniq
|
90
95
|
end
|
91
96
|
|
92
97
|
def all_sources
|
@@ -98,7 +103,7 @@ module Bundler
|
|
98
103
|
end
|
99
104
|
|
100
105
|
def get(source)
|
101
|
-
source_list_for(source).find {|s|
|
106
|
+
source_list_for(source).find {|s| s.include?(source) }
|
102
107
|
end
|
103
108
|
|
104
109
|
def lock_sources
|
@@ -136,15 +141,25 @@ module Bundler
|
|
136
141
|
different_sources?(lock_sources, replacement_sources)
|
137
142
|
end
|
138
143
|
|
144
|
+
def prefer_local!
|
145
|
+
all_sources.each(&:prefer_local!)
|
146
|
+
end
|
147
|
+
|
139
148
|
def local_only!
|
140
149
|
all_sources.each(&:local_only!)
|
141
150
|
end
|
142
151
|
|
152
|
+
def local!
|
153
|
+
all_sources.each(&:local!)
|
154
|
+
end
|
155
|
+
|
143
156
|
def cached!
|
144
157
|
all_sources.each(&:cached!)
|
145
158
|
end
|
146
159
|
|
147
160
|
def remote!
|
161
|
+
@local_mode = false
|
162
|
+
|
148
163
|
all_sources.each(&:remote!)
|
149
164
|
end
|
150
165
|
|
@@ -157,27 +172,58 @@ module Bundler
|
|
157
172
|
end
|
158
173
|
|
159
174
|
def map_sources(replacement_sources)
|
160
|
-
rubygems
|
175
|
+
rubygems = @rubygems_sources.map do |source|
|
176
|
+
replace_rubygems_source(replacement_sources, source)
|
177
|
+
end
|
178
|
+
|
179
|
+
git, plugin = [@git_sources, @plugin_sources].map do |sources|
|
161
180
|
sources.map do |source|
|
162
|
-
replacement_sources
|
181
|
+
replace_source(replacement_sources, source)
|
163
182
|
end
|
164
183
|
end
|
165
184
|
|
166
185
|
path = @path_sources.map do |source|
|
167
|
-
replacement_sources
|
186
|
+
replace_path_source(replacement_sources, source)
|
168
187
|
end
|
169
188
|
|
170
189
|
[rubygems, path, git, plugin]
|
171
190
|
end
|
172
191
|
|
173
192
|
def global_replacement_source(replacement_sources)
|
174
|
-
|
175
|
-
|
193
|
+
replace_rubygems_source(replacement_sources, global_rubygems_source, &:local!)
|
194
|
+
end
|
195
|
+
|
196
|
+
def replace_rubygems_source(replacement_sources, gemfile_source)
|
197
|
+
replace_source(replacement_sources, gemfile_source) do |replacement_source|
|
198
|
+
# locked sources never include credentials so always prefer remotes from the gemfile
|
199
|
+
replacement_source.remotes = gemfile_source.remotes
|
200
|
+
|
201
|
+
yield replacement_source if block_given?
|
202
|
+
|
203
|
+
replacement_source
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
def replace_source(replacement_sources, gemfile_source)
|
208
|
+
replacement_source = replacement_sources.find {|s| s == gemfile_source }
|
209
|
+
return gemfile_source unless replacement_source
|
210
|
+
|
211
|
+
replacement_source = yield(replacement_source) if block_given?
|
176
212
|
|
177
|
-
replacement_source.local!
|
178
213
|
replacement_source
|
179
214
|
end
|
180
215
|
|
216
|
+
def replace_path_source(replacement_sources, gemfile_source)
|
217
|
+
replace_source(replacement_sources, gemfile_source) do |replacement_source|
|
218
|
+
if gemfile_source.is_a?(Source::Gemspec)
|
219
|
+
gemfile_source.checksum_store = replacement_source.checksum_store
|
220
|
+
gemfile_source
|
221
|
+
else
|
222
|
+
replacement_source
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
181
227
|
def different_sources?(lock_sources, replacement_sources)
|
182
228
|
!equivalent_sources?(lock_sources, replacement_sources)
|
183
229
|
end
|
@@ -219,9 +265,5 @@ module Bundler
|
|
219
265
|
def equivalent_sources?(lock_sources, replacement_sources)
|
220
266
|
lock_sources.sort_by(&:identifier) == replacement_sources.sort_by(&:identifier)
|
221
267
|
end
|
222
|
-
|
223
|
-
def equivalent_source?(source, other_source)
|
224
|
-
source == other_source
|
225
|
-
end
|
226
268
|
end
|
227
269
|
end
|
@@ -23,7 +23,7 @@ module Bundler
|
|
23
23
|
if previous_source.nil?
|
24
24
|
requirements[indirect_dependency_name] = source
|
25
25
|
else
|
26
|
-
no_ambiguous_sources = Bundler.feature_flag.
|
26
|
+
no_ambiguous_sources = Bundler.feature_flag.bundler_4_mode?
|
27
27
|
|
28
28
|
msg = ["The gem '#{indirect_dependency_name}' was found in multiple relevant sources."]
|
29
29
|
msg.concat [previous_source, source].map {|s| " * #{s}" }.sort
|
@@ -7,89 +7,86 @@ module Bundler
|
|
7
7
|
include Enumerable
|
8
8
|
include TSort
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
def initialize(specs, incomplete_specs = [])
|
10
|
+
def initialize(specs)
|
13
11
|
@specs = specs
|
14
|
-
@incomplete_specs = incomplete_specs
|
15
12
|
end
|
16
13
|
|
17
|
-
def for(dependencies,
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
def for(dependencies, platforms_or_legacy_check = [nil], legacy_platforms = [nil], skips: [])
|
15
|
+
platforms = if [true, false].include?(platforms_or_legacy_check)
|
16
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
17
|
+
"SpecSet#for received a `check` parameter, but that's no longer used and deprecated. " \
|
18
|
+
"SpecSet#for always implicitly performs validation. Please remove this parameter",
|
19
|
+
print_caller_location: true
|
21
20
|
|
22
|
-
|
23
|
-
|
21
|
+
legacy_platforms
|
22
|
+
else
|
23
|
+
platforms_or_legacy_check
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
platform = dep[1]
|
27
|
-
incomplete = false
|
26
|
+
materialize_dependencies(dependencies, platforms, skips: skips)
|
28
27
|
|
29
|
-
|
30
|
-
|
28
|
+
@materializations.flat_map(&:specs).uniq
|
29
|
+
end
|
31
30
|
|
32
|
-
|
31
|
+
def normalize_platforms!(deps, platforms)
|
32
|
+
remove_invalid_platforms!(deps, platforms)
|
33
|
+
add_extra_platforms!(platforms)
|
33
34
|
|
34
|
-
|
35
|
-
if
|
36
|
-
specs.concat(specs_for_dep)
|
35
|
+
platforms.map! do |platform|
|
36
|
+
next platform if platform == Gem::Platform::RUBY
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
else
|
44
|
-
incomplete = true
|
38
|
+
begin
|
39
|
+
Integer(platform.version)
|
40
|
+
rescue ArgumentError, TypeError
|
41
|
+
next platform
|
45
42
|
end
|
46
43
|
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
less_specific_platform = Gem::Platform.new([platform.cpu, platform.os, nil])
|
45
|
+
next platform if incomplete_for_platform?(deps, less_specific_platform)
|
46
|
+
|
47
|
+
less_specific_platform
|
48
|
+
end.uniq!
|
49
|
+
end
|
50
|
+
|
51
|
+
def add_originally_invalid_platforms!(platforms, originally_invalid_platforms)
|
52
|
+
originally_invalid_platforms.each do |originally_invalid_platform|
|
53
|
+
platforms << originally_invalid_platform if complete_platform(originally_invalid_platform)
|
50
54
|
end
|
55
|
+
end
|
51
56
|
|
52
|
-
|
57
|
+
def remove_invalid_platforms!(deps, platforms, skips: [])
|
58
|
+
invalid_platforms = []
|
59
|
+
|
60
|
+
platforms.reject! do |platform|
|
61
|
+
next false if skips.include?(platform)
|
62
|
+
|
63
|
+
invalid = incomplete_for_platform?(deps, platform)
|
64
|
+
invalid_platforms << platform if invalid
|
65
|
+
invalid
|
66
|
+
end
|
67
|
+
|
68
|
+
invalid_platforms
|
53
69
|
end
|
54
70
|
|
55
|
-
def
|
56
|
-
|
71
|
+
def add_extra_platforms!(platforms)
|
72
|
+
if @specs.empty?
|
73
|
+
platforms.concat([Gem::Platform::RUBY]).uniq
|
74
|
+
return
|
75
|
+
end
|
57
76
|
|
58
|
-
new_platforms =
|
77
|
+
new_platforms = all_platforms.select do |platform|
|
59
78
|
next if platforms.include?(platform)
|
60
|
-
next unless
|
61
|
-
|
62
|
-
new_specs = []
|
63
|
-
|
64
|
-
valid_platform = lookup.all? do |_, specs|
|
65
|
-
spec = specs.first
|
66
|
-
matching_specs = spec.source.specs.search([spec.name, spec.version])
|
67
|
-
platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
|
68
|
-
s.matches_current_metadata? && valid_dependencies?(s)
|
69
|
-
end
|
70
|
-
|
71
|
-
if platform_spec
|
72
|
-
new_specs << LazySpecification.from_spec(platform_spec)
|
73
|
-
true
|
74
|
-
else
|
75
|
-
false
|
76
|
-
end
|
77
|
-
end
|
78
|
-
next unless valid_platform
|
79
|
+
next unless Gem::Platform.generic(platform) == Gem::Platform::RUBY
|
79
80
|
|
80
|
-
|
81
|
+
complete_platform(platform)
|
81
82
|
end
|
82
|
-
return
|
83
|
+
return if new_platforms.empty?
|
83
84
|
|
84
85
|
platforms.concat(new_platforms)
|
86
|
+
return if new_platforms.include?(Bundler.local_platform)
|
85
87
|
|
86
|
-
less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && platform === Bundler.local_platform }
|
88
|
+
less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
|
87
89
|
platforms.delete(Bundler.local_platform) if less_specific_platform
|
88
|
-
|
89
|
-
@sorted = nil
|
90
|
-
@lookup = nil
|
91
|
-
|
92
|
-
platforms
|
93
90
|
end
|
94
91
|
|
95
92
|
def validate_deps(s)
|
@@ -109,15 +106,13 @@ module Bundler
|
|
109
106
|
end
|
110
107
|
|
111
108
|
def []=(key, value)
|
112
|
-
|
113
|
-
|
114
|
-
|
109
|
+
delete_by_name(key)
|
110
|
+
|
111
|
+
add_spec(value)
|
115
112
|
end
|
116
113
|
|
117
114
|
def delete(specs)
|
118
|
-
specs.each {|spec|
|
119
|
-
@lookup = nil
|
120
|
-
@sorted = nil
|
115
|
+
Array(specs).each {|spec| remove_spec(spec) }
|
121
116
|
end
|
122
117
|
|
123
118
|
def sort!
|
@@ -133,50 +128,80 @@ module Bundler
|
|
133
128
|
end
|
134
129
|
|
135
130
|
def materialize(deps)
|
136
|
-
|
131
|
+
materialize_dependencies(deps)
|
137
132
|
|
138
|
-
SpecSet.new(
|
133
|
+
SpecSet.new(materialized_specs)
|
139
134
|
end
|
140
135
|
|
141
136
|
# Materialize for all the specs in the spec set, regardless of what platform they're for
|
142
|
-
# This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
|
143
137
|
# @return [Array<Gem::Specification>]
|
144
138
|
def materialized_for_all_platforms
|
145
139
|
@specs.map do |s|
|
146
140
|
next s unless s.is_a?(LazySpecification)
|
147
|
-
s.
|
148
|
-
spec = s.materialize_for_installation
|
141
|
+
spec = s.materialize_for_cache
|
149
142
|
raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
|
150
143
|
spec
|
151
144
|
end
|
152
145
|
end
|
153
146
|
|
154
147
|
def incomplete_for_platform?(deps, platform)
|
155
|
-
|
148
|
+
incomplete_specs_for_platform(deps, platform).any?
|
149
|
+
end
|
150
|
+
|
151
|
+
def incomplete_specs_for_platform(deps, platform)
|
152
|
+
return [] if @specs.empty?
|
156
153
|
|
157
|
-
|
154
|
+
validation_set = self.class.new(@specs)
|
155
|
+
validation_set.for(deps, [platform])
|
156
|
+
validation_set.incomplete_specs
|
157
|
+
end
|
158
158
|
|
159
|
-
|
159
|
+
def missing_specs_for(deps)
|
160
|
+
materialize_dependencies(deps)
|
160
161
|
|
161
|
-
|
162
|
+
missing_specs
|
162
163
|
end
|
163
164
|
|
164
165
|
def missing_specs
|
165
|
-
@
|
166
|
+
@materializations.flat_map(&:completely_missing_specs)
|
167
|
+
end
|
168
|
+
|
169
|
+
def partially_missing_specs
|
170
|
+
@materializations.flat_map(&:partially_missing_specs)
|
171
|
+
end
|
172
|
+
|
173
|
+
def incomplete_specs
|
174
|
+
@materializations.flat_map(&:incomplete_specs)
|
175
|
+
end
|
176
|
+
|
177
|
+
def insecurely_materialized_specs
|
178
|
+
materialized_specs.select(&:insecurely_materialized?)
|
166
179
|
end
|
167
180
|
|
168
181
|
def -(other)
|
182
|
+
SharedHelpers.major_deprecation 2, "SpecSet#- has been removed with no replacement"
|
183
|
+
|
169
184
|
SpecSet.new(to_a - other.to_a)
|
170
185
|
end
|
171
186
|
|
172
187
|
def find_by_name_and_platform(name, platform)
|
173
|
-
@specs.detect {|spec| spec.name == name && spec.
|
188
|
+
@specs.detect {|spec| spec.name == name && spec.installable_on_platform?(platform) }
|
189
|
+
end
|
190
|
+
|
191
|
+
def specs_with_additional_variants_from(other)
|
192
|
+
sorted | additional_variants_from(other)
|
174
193
|
end
|
175
194
|
|
176
195
|
def delete_by_name(name)
|
177
196
|
@specs.reject! {|spec| spec.name == name }
|
178
|
-
@
|
179
|
-
|
197
|
+
@sorted&.reject! {|spec| spec.name == name }
|
198
|
+
return if @lookup.nil?
|
199
|
+
|
200
|
+
@lookup[name] = nil
|
201
|
+
end
|
202
|
+
|
203
|
+
def version_for(name)
|
204
|
+
exemplary_spec(name)&.version
|
180
205
|
end
|
181
206
|
|
182
207
|
def what_required(spec)
|
@@ -187,6 +212,8 @@ module Bundler
|
|
187
212
|
end
|
188
213
|
|
189
214
|
def <<(spec)
|
215
|
+
SharedHelpers.major_deprecation 2, "SpecSet#<< has been removed with no replacement"
|
216
|
+
|
190
217
|
@specs << spec
|
191
218
|
end
|
192
219
|
|
@@ -210,22 +237,98 @@ module Bundler
|
|
210
237
|
lookup.keys
|
211
238
|
end
|
212
239
|
|
240
|
+
def valid?(s)
|
241
|
+
s.matches_current_metadata? && valid_dependencies?(s)
|
242
|
+
end
|
243
|
+
|
244
|
+
def to_s
|
245
|
+
map(&:full_name).to_s
|
246
|
+
end
|
247
|
+
|
213
248
|
private
|
214
249
|
|
250
|
+
def materialize_dependencies(dependencies, platforms = [nil], skips: [])
|
251
|
+
handled = ["bundler"].product(platforms).map {|k| [k, true] }.to_h
|
252
|
+
deps = dependencies.product(platforms)
|
253
|
+
@materializations = []
|
254
|
+
|
255
|
+
loop do
|
256
|
+
break unless dep = deps.shift
|
257
|
+
|
258
|
+
dependency = dep[0]
|
259
|
+
platform = dep[1]
|
260
|
+
name = dependency.name
|
261
|
+
|
262
|
+
key = [name, platform]
|
263
|
+
next if handled.key?(key)
|
264
|
+
|
265
|
+
handled[key] = true
|
266
|
+
|
267
|
+
materialization = Materialization.new(dependency, platform, candidates: lookup[name])
|
268
|
+
|
269
|
+
deps.concat(materialization.dependencies) if materialization.complete?
|
270
|
+
|
271
|
+
@materializations << materialization unless skips.include?(name)
|
272
|
+
end
|
273
|
+
|
274
|
+
@materializations
|
275
|
+
end
|
276
|
+
|
277
|
+
def materialized_specs
|
278
|
+
@materializations.filter_map(&:materialized_spec)
|
279
|
+
end
|
280
|
+
|
281
|
+
def complete_platform(platform)
|
282
|
+
new_specs = []
|
283
|
+
|
284
|
+
valid_platform = lookup.all? do |_, specs|
|
285
|
+
spec = specs.first
|
286
|
+
matching_specs = spec.source.specs.search([spec.name, spec.version])
|
287
|
+
platform_spec = MatchPlatform.select_best_platform_match(matching_specs, platform).find do |s|
|
288
|
+
valid?(s)
|
289
|
+
end
|
290
|
+
|
291
|
+
if platform_spec
|
292
|
+
new_specs << LazySpecification.from_spec(platform_spec) unless specs.include?(platform_spec)
|
293
|
+
true
|
294
|
+
else
|
295
|
+
false
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
if valid_platform && new_specs.any?
|
300
|
+
new_specs.each {|spec| add_spec(spec) }
|
301
|
+
end
|
302
|
+
|
303
|
+
valid_platform
|
304
|
+
end
|
305
|
+
|
306
|
+
def all_platforms
|
307
|
+
@specs.flat_map {|spec| spec.source.specs.search([spec.name, spec.version]).map(&:platform) }.uniq
|
308
|
+
end
|
309
|
+
|
310
|
+
def additional_variants_from(other)
|
311
|
+
other.select do |other_spec|
|
312
|
+
spec = exemplary_spec(other_spec.name)
|
313
|
+
next unless spec
|
314
|
+
|
315
|
+
selected = spec.version == other_spec.version && valid_dependencies?(other_spec)
|
316
|
+
other_spec.source = spec.source if selected
|
317
|
+
selected
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
215
321
|
def valid_dependencies?(s)
|
216
322
|
validate_deps(s) == :valid
|
217
323
|
end
|
218
324
|
|
219
325
|
def sorted
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
" on each other, creating an infinite loop. Please remove either" \
|
227
|
-
" gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again."
|
228
|
-
end
|
326
|
+
@sorted ||= ([@specs.find {|s| s.name == "rake" }] + tsort).compact.uniq
|
327
|
+
rescue TSort::Cyclic => error
|
328
|
+
cgems = extract_circular_gems(error)
|
329
|
+
raise CyclicDependencyError, "Your bundle requires gems that depend" \
|
330
|
+
" on each other, creating an infinite loop. Please remove either" \
|
331
|
+
" gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again."
|
229
332
|
end
|
230
333
|
|
231
334
|
def extract_circular_gems(error)
|
@@ -236,8 +339,7 @@ module Bundler
|
|
236
339
|
@lookup ||= begin
|
237
340
|
lookup = {}
|
238
341
|
@specs.each do |s|
|
239
|
-
lookup
|
240
|
-
lookup[s.name] << s
|
342
|
+
index_spec(lookup, s.name, s)
|
241
343
|
end
|
242
344
|
lookup
|
243
345
|
end
|
@@ -248,19 +350,6 @@ module Bundler
|
|
248
350
|
@specs.sort_by(&:name).each {|s| yield s }
|
249
351
|
end
|
250
352
|
|
251
|
-
def specs_for_dependency(dep, platform)
|
252
|
-
specs_for_name = lookup[dep.name]
|
253
|
-
return [] unless specs_for_name
|
254
|
-
|
255
|
-
matching_specs = if dep.force_ruby_platform
|
256
|
-
GemHelpers.force_ruby_platform(specs_for_name)
|
257
|
-
else
|
258
|
-
GemHelpers.select_best_platform_match(specs_for_name, platform || Bundler.local_platform)
|
259
|
-
end
|
260
|
-
matching_specs.map!(&:materialize_for_installation).compact! if platform.nil?
|
261
|
-
matching_specs
|
262
|
-
end
|
263
|
-
|
264
353
|
def tsort_each_child(s)
|
265
354
|
s.dependencies.sort_by(&:name).each do |d|
|
266
355
|
next if d.type == :development
|
@@ -271,5 +360,40 @@ module Bundler
|
|
271
360
|
specs_for_name.each {|s2| yield s2 }
|
272
361
|
end
|
273
362
|
end
|
363
|
+
|
364
|
+
def add_spec(spec)
|
365
|
+
@specs << spec
|
366
|
+
|
367
|
+
name = spec.name
|
368
|
+
|
369
|
+
@sorted&.insert(@sorted.bsearch_index {|s| s.name >= name } || @sorted.size, spec)
|
370
|
+
return if @lookup.nil?
|
371
|
+
|
372
|
+
index_spec(@lookup, name, spec)
|
373
|
+
end
|
374
|
+
|
375
|
+
def remove_spec(spec)
|
376
|
+
@specs.delete(spec)
|
377
|
+
@sorted&.delete(spec)
|
378
|
+
return if @lookup.nil?
|
379
|
+
|
380
|
+
indexed_specs = @lookup[spec.name]
|
381
|
+
return unless indexed_specs
|
382
|
+
|
383
|
+
if indexed_specs.size > 1
|
384
|
+
@lookup[spec.name].delete(spec)
|
385
|
+
else
|
386
|
+
@lookup[spec.name] = nil
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
def index_spec(hash, key, value)
|
391
|
+
hash[key] ||= []
|
392
|
+
hash[key] << value
|
393
|
+
end
|
394
|
+
|
395
|
+
def exemplary_spec(name)
|
396
|
+
self[name].first
|
397
|
+
end
|
274
398
|
end
|
275
399
|
end
|
@@ -9,6 +9,10 @@ module Bundler
|
|
9
9
|
spec
|
10
10
|
end
|
11
11
|
|
12
|
+
def insecurely_materialized?
|
13
|
+
false
|
14
|
+
end
|
15
|
+
|
12
16
|
attr_reader :checksum
|
13
17
|
attr_accessor :stub, :ignored
|
14
18
|
|
@@ -28,6 +32,17 @@ module Bundler
|
|
28
32
|
|
29
33
|
# @!group Stub Delegates
|
30
34
|
|
35
|
+
def ignored?
|
36
|
+
return @ignored unless @ignored.nil?
|
37
|
+
|
38
|
+
@ignored = missing_extensions?
|
39
|
+
return false unless @ignored
|
40
|
+
|
41
|
+
warn "Source #{source} is ignoring #{self} because it is missing extensions"
|
42
|
+
|
43
|
+
true
|
44
|
+
end
|
45
|
+
|
31
46
|
def manually_installed?
|
32
47
|
# This is for manually installed gems which are gems that were fixed in place after a
|
33
48
|
# failed installation. Once the issue was resolved, the user then manually created
|
@@ -45,8 +60,8 @@ module Bundler
|
|
45
60
|
true
|
46
61
|
end
|
47
62
|
|
48
|
-
def activated
|
49
|
-
stub.activated
|
63
|
+
def activated?
|
64
|
+
stub.activated?
|
50
65
|
end
|
51
66
|
|
52
67
|
def activated=(activated)
|
@@ -77,6 +92,14 @@ module Bundler
|
|
77
92
|
stub.full_require_paths
|
78
93
|
end
|
79
94
|
|
95
|
+
def require_paths
|
96
|
+
stub.require_paths
|
97
|
+
end
|
98
|
+
|
99
|
+
def base_dir=(path)
|
100
|
+
stub.base_dir = path
|
101
|
+
end
|
102
|
+
|
80
103
|
def load_paths
|
81
104
|
full_require_paths
|
82
105
|
end
|
@@ -93,6 +116,10 @@ module Bundler
|
|
93
116
|
stub.raw_require_paths
|
94
117
|
end
|
95
118
|
|
119
|
+
def inspect
|
120
|
+
"#<#{self.class} @name=\"#{name}\" (#{full_name.delete_prefix("#{name}-")})>"
|
121
|
+
end
|
122
|
+
|
96
123
|
private
|
97
124
|
|
98
125
|
def _remote_specification
|
@@ -10,17 +10,6 @@
|
|
10
10
|
|
11
11
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
12
12
|
|
13
|
-
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
-
|
15
|
-
if File.file?(bundle_binstub)
|
16
|
-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
17
|
-
load(bundle_binstub)
|
18
|
-
else
|
19
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
13
|
require "rubygems"
|
25
14
|
require "bundler/setup"
|
26
15
|
|