rubygems-update 3.5.5 → 3.6.9
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 +606 -1
- data/CODE_OF_CONDUCT.md +79 -28
- data/Manifest.txt +114 -73
- data/README.md +16 -11
- data/bundler/CHANGELOG.md +506 -6
- data/bundler/README.md +2 -2
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- 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/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 +13 -17
- 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 +14 -5
- 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 +22 -22
- 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.rb +51 -107
- 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 +2 -12
- data/bundler/lib/bundler/compact_index_client.rb +51 -80
- data/bundler/lib/bundler/constants.rb +8 -1
- data/bundler/lib/bundler/current_ruby.rb +23 -33
- data/bundler/lib/bundler/definition.rb +485 -313
- data/bundler/lib/bundler/dependency.rb +92 -46
- data/bundler/lib/bundler/dsl.rb +135 -101
- 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 +3 -6
- data/bundler/lib/bundler/fetcher/compact_index.rb +16 -25
- data/bundler/lib/bundler/fetcher/downloader.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +14 -7
- data/bundler/lib/bundler/force_platform.rb +0 -2
- data/bundler/lib/bundler/friendly_errors.rb +1 -1
- data/bundler/lib/bundler/gem_helper.rb +1 -1
- data/bundler/lib/bundler/gem_helpers.rb +36 -19
- data/bundler/lib/bundler/gem_version_promoter.rb +42 -40
- 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 +17 -41
- data/bundler/lib/bundler/lazy_specification.rb +117 -46
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +18 -7
- 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 +11 -15
- data/bundler/lib/bundler/man/bundle-config.1.ronn +12 -15
- 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 +4 -4
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
- 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 +25 -7
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +38 -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 +12 -4
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +9 -1
- data/bundler/lib/bundler/man/bundle-install.1 +19 -16
- data/bundler/lib/bundler/man/bundle-install.1.ronn +24 -20
- 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 +15 -9
- data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
- 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/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 -50
- 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 +282 -125
- data/bundler/lib/bundler/rubygems_gem_installer.rb +40 -5
- data/bundler/lib/bundler/rubygems_integration.rb +29 -67
- data/bundler/lib/bundler/runtime.rb +48 -35
- data/bundler/lib/bundler/self_manager.rb +27 -7
- data/bundler/lib/bundler/settings.rb +32 -21
- data/bundler/lib/bundler/setup.rb +6 -0
- data/bundler/lib/bundler/shared_helpers.rb +39 -21
- data/bundler/lib/bundler/source/gemspec.rb +1 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +23 -6
- 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 +7 -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 +53 -7
- data/bundler/lib/bundler/spec_set.rb +187 -88
- data/bundler/lib/bundler/stub_specification.rb +29 -2
- 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 +15 -15
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -7
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/bundler/lib/bundler/ui/shell.rb +24 -2
- 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/lib/net/http/persistent.rb +68 -30
- 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 +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +12 -7
- data/bundler/lib/bundler.rb +89 -51
- data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +10 -14
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +81 -12
- data/exe/update_rubygems +1 -1
- data/lib/rubygems/basic_specification.rb +43 -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 +30 -17
- 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 +11 -16
- 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 +10 -17
- data/lib/rubygems/config_file.rb +45 -16
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +6 -6
- 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 +12 -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 +1 -1
- 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 +31 -40
- 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 +7 -5
- 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 +3 -4
- data/lib/rubygems/request.rb +5 -5
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set.rb +1 -1
- 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 +0 -28
- 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/spec_specification.rb +7 -0
- data/lib/rubygems/resolver.rb +7 -7
- data/lib/rubygems/s3_uri_signer.rb +3 -3
- 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 +10 -8
- data/lib/rubygems/source_list.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +47 -15
- data/lib/rubygems/specification.rb +107 -180
- 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/util/licenses.rb +97 -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 +135 -51
- 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 +117 -49
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/rubygems/vendor/timeout/.document +1 -0
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +10 -11
- data/lib/rubygems/vendor/tsort/.document +1 -0
- data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
- data/lib/rubygems/vendor/uri/.document +1 -0
- 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 +82 -47
- data/rubygems-update.gemspec +11 -6
- data/setup.rb +1 -1
- metadata +131 -86
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +0 -32
- data/lib/rubygems/net/http.rb +0 -3
- 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/LICENSE.txt +0 -22
- data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
- data/lib/rubygems/optparse.rb +0 -3
- data/lib/rubygems/resolv/LICENSE.txt +0 -22
- 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/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/timeout.rb +0 -3
- 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/{lib/rubygems/net-http → bundler/lib/bundler/vendor/securerandom}/.document +0 -0
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{bundler → doc/bundler}/UPGRADING.md +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
- /data/lib/rubygems/{net-protocol → vendor/molinillo}/.document +0 -0
- /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
- /data/lib/rubygems/{optparse → vendor/net-http}/.document +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/lib/rubygems/{resolv → vendor/net-protocol}/.document +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/{resolver/molinillo → vendor/optparse}/.document +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/lib/rubygems/{timeout → vendor/resolv}/.document +0 -0
- /data/lib/rubygems/{tsort → vendor/securerandom}/.document +0 -0
- /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require_relative '../../../../../vendored_net_http'
|
|
2
|
-
require_relative '
|
|
2
|
+
require_relative '../../../../../vendored_uri'
|
|
3
3
|
require 'cgi' # for escaping
|
|
4
4
|
require_relative '../../../../connection_pool/lib/connection_pool'
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ autoload :OpenSSL, 'openssl'
|
|
|
22
22
|
#
|
|
23
23
|
# require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
|
|
24
24
|
#
|
|
25
|
-
# uri =
|
|
25
|
+
# uri = Gem::URI 'http://example.com/awesome/web/service'
|
|
26
26
|
#
|
|
27
27
|
# http = Gem::Net::HTTP::Persistent.new
|
|
28
28
|
#
|
|
@@ -39,17 +39,17 @@ autoload :OpenSSL, 'openssl'
|
|
|
39
39
|
# post = Gem::Net::HTTP::Post.new post_uri.path
|
|
40
40
|
# post.set_form_data 'some' => 'cool data'
|
|
41
41
|
#
|
|
42
|
-
# # perform the POST, the
|
|
42
|
+
# # perform the POST, the Gem::URI is always required
|
|
43
43
|
# response http.request post_uri, post
|
|
44
44
|
#
|
|
45
45
|
# Note that for GET, HEAD and other requests that do not have a body you want
|
|
46
|
-
# to use
|
|
46
|
+
# to use Gem::URI#request_uri not Gem::URI#path. The request_uri contains the query
|
|
47
47
|
# params which are sent in the body for other requests.
|
|
48
48
|
#
|
|
49
49
|
# == TLS/SSL
|
|
50
50
|
#
|
|
51
51
|
# TLS connections are automatically created depending upon the scheme of the
|
|
52
|
-
#
|
|
52
|
+
# Gem::URI. TLS connections are automatically verified against the default
|
|
53
53
|
# certificate store for your computer. You can override this by changing
|
|
54
54
|
# verify_mode or by specifying an alternate cert_store.
|
|
55
55
|
#
|
|
@@ -68,11 +68,13 @@ autoload :OpenSSL, 'openssl'
|
|
|
68
68
|
# #verify_callback :: For server certificate verification
|
|
69
69
|
# #verify_depth :: Depth of certificate verification
|
|
70
70
|
# #verify_mode :: How connections should be verified
|
|
71
|
+
# #verify_hostname :: Use hostname verification for server certificate
|
|
72
|
+
# during the handshake
|
|
71
73
|
#
|
|
72
74
|
# == Proxies
|
|
73
75
|
#
|
|
74
76
|
# A proxy can be set through #proxy= or at initialization time by providing a
|
|
75
|
-
# second argument to ::new. The proxy may be the
|
|
77
|
+
# second argument to ::new. The proxy may be the Gem::URI of the proxy server or
|
|
76
78
|
# <code>:ENV</code> which will consult environment variables.
|
|
77
79
|
#
|
|
78
80
|
# See #proxy= and #proxy_from_env for details.
|
|
@@ -174,7 +176,7 @@ class Gem::Net::HTTP::Persistent
|
|
|
174
176
|
##
|
|
175
177
|
# The version of Gem::Net::HTTP::Persistent you are using
|
|
176
178
|
|
|
177
|
-
VERSION = '4.0.
|
|
179
|
+
VERSION = '4.0.4'
|
|
178
180
|
|
|
179
181
|
##
|
|
180
182
|
# Error class for errors raised by Gem::Net::HTTP::Persistent. Various
|
|
@@ -197,7 +199,7 @@ class Gem::Net::HTTP::Persistent
|
|
|
197
199
|
# NOTE: This may not work on ruby > 1.9.
|
|
198
200
|
|
|
199
201
|
def self.detect_idle_timeout uri, max = 10
|
|
200
|
-
uri =
|
|
202
|
+
uri = Gem::URI uri unless Gem::URI::Generic === uri
|
|
201
203
|
uri += '/'
|
|
202
204
|
|
|
203
205
|
req = Gem::Net::HTTP::Head.new uri.request_uri
|
|
@@ -449,19 +451,34 @@ class Gem::Net::HTTP::Persistent
|
|
|
449
451
|
|
|
450
452
|
attr_reader :verify_mode
|
|
451
453
|
|
|
454
|
+
##
|
|
455
|
+
# HTTPS verify_hostname.
|
|
456
|
+
#
|
|
457
|
+
# If a client sets this to true and enables SNI with SSLSocket#hostname=,
|
|
458
|
+
# the hostname verification on the server certificate is performed
|
|
459
|
+
# automatically during the handshake using
|
|
460
|
+
# OpenSSL::SSL.verify_certificate_identity().
|
|
461
|
+
#
|
|
462
|
+
# You can set +verify_hostname+ as true to use hostname verification
|
|
463
|
+
# during the handshake.
|
|
464
|
+
#
|
|
465
|
+
# NOTE: This works with Ruby > 3.0.
|
|
466
|
+
|
|
467
|
+
attr_reader :verify_hostname
|
|
468
|
+
|
|
452
469
|
##
|
|
453
470
|
# Creates a new Gem::Net::HTTP::Persistent.
|
|
454
471
|
#
|
|
455
472
|
# Set a +name+ for fun. Your library name should be good enough, but this
|
|
456
473
|
# otherwise has no purpose.
|
|
457
474
|
#
|
|
458
|
-
# +proxy+ may be set to a
|
|
475
|
+
# +proxy+ may be set to a Gem::URI::HTTP or :ENV to pick up proxy options from
|
|
459
476
|
# the environment. See proxy_from_env for details.
|
|
460
477
|
#
|
|
461
|
-
# In order to use a
|
|
462
|
-
# beyond
|
|
478
|
+
# In order to use a Gem::URI for the proxy you may need to do some extra work
|
|
479
|
+
# beyond Gem::URI parsing if the proxy requires a password:
|
|
463
480
|
#
|
|
464
|
-
# proxy =
|
|
481
|
+
# proxy = Gem::URI 'http://proxy.example'
|
|
465
482
|
# proxy.user = 'AzureDiamond'
|
|
466
483
|
# proxy.password = 'hunter2'
|
|
467
484
|
#
|
|
@@ -508,9 +525,10 @@ class Gem::Net::HTTP::Persistent
|
|
|
508
525
|
@verify_callback = nil
|
|
509
526
|
@verify_depth = nil
|
|
510
527
|
@verify_mode = nil
|
|
528
|
+
@verify_hostname = nil
|
|
511
529
|
@cert_store = nil
|
|
512
530
|
|
|
513
|
-
@generation = 0 # incremented when proxy
|
|
531
|
+
@generation = 0 # incremented when proxy Gem::URI changes
|
|
514
532
|
|
|
515
533
|
if HAVE_OPENSSL then
|
|
516
534
|
@verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
@@ -607,13 +625,23 @@ class Gem::Net::HTTP::Persistent
|
|
|
607
625
|
|
|
608
626
|
return yield connection
|
|
609
627
|
rescue Errno::ECONNREFUSED
|
|
610
|
-
|
|
611
|
-
|
|
628
|
+
if http.proxy?
|
|
629
|
+
address = http.proxy_address
|
|
630
|
+
port = http.proxy_port
|
|
631
|
+
else
|
|
632
|
+
address = http.address
|
|
633
|
+
port = http.port
|
|
634
|
+
end
|
|
612
635
|
|
|
613
636
|
raise Error, "connection refused: #{address}:#{port}"
|
|
614
637
|
rescue Errno::EHOSTDOWN
|
|
615
|
-
|
|
616
|
-
|
|
638
|
+
if http.proxy?
|
|
639
|
+
address = http.proxy_address
|
|
640
|
+
port = http.proxy_port
|
|
641
|
+
else
|
|
642
|
+
address = http.address
|
|
643
|
+
port = http.port
|
|
644
|
+
end
|
|
617
645
|
|
|
618
646
|
raise Error, "host down: #{address}:#{port}"
|
|
619
647
|
ensure
|
|
@@ -720,12 +748,12 @@ class Gem::Net::HTTP::Persistent
|
|
|
720
748
|
alias key= private_key=
|
|
721
749
|
|
|
722
750
|
##
|
|
723
|
-
# Sets the proxy server. The +proxy+ may be the
|
|
751
|
+
# Sets the proxy server. The +proxy+ may be the Gem::URI of the proxy server,
|
|
724
752
|
# the symbol +:ENV+ which will read the proxy from the environment or nil to
|
|
725
753
|
# disable use of a proxy. See #proxy_from_env for details on setting the
|
|
726
754
|
# proxy from the environment.
|
|
727
755
|
#
|
|
728
|
-
# If the proxy
|
|
756
|
+
# If the proxy Gem::URI is set after requests have been made, the next request
|
|
729
757
|
# will shut-down and re-open all connections.
|
|
730
758
|
#
|
|
731
759
|
# The +no_proxy+ query parameter can be used to specify hosts which shouldn't
|
|
@@ -736,9 +764,9 @@ class Gem::Net::HTTP::Persistent
|
|
|
736
764
|
def proxy= proxy
|
|
737
765
|
@proxy_uri = case proxy
|
|
738
766
|
when :ENV then proxy_from_env
|
|
739
|
-
when
|
|
767
|
+
when Gem::URI::HTTP then proxy
|
|
740
768
|
when nil then # ignore
|
|
741
|
-
else raise ArgumentError, 'proxy must be :ENV or a
|
|
769
|
+
else raise ArgumentError, 'proxy must be :ENV or a Gem::URI::HTTP'
|
|
742
770
|
end
|
|
743
771
|
|
|
744
772
|
@no_proxy.clear
|
|
@@ -763,13 +791,13 @@ class Gem::Net::HTTP::Persistent
|
|
|
763
791
|
end
|
|
764
792
|
|
|
765
793
|
##
|
|
766
|
-
# Creates a
|
|
794
|
+
# Creates a Gem::URI for an HTTP proxy server from ENV variables.
|
|
767
795
|
#
|
|
768
796
|
# If +HTTP_PROXY+ is set a proxy will be returned.
|
|
769
797
|
#
|
|
770
|
-
# If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the
|
|
798
|
+
# If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Gem::URI is given the
|
|
771
799
|
# indicated user and password unless HTTP_PROXY contains either of these in
|
|
772
|
-
# the
|
|
800
|
+
# the Gem::URI.
|
|
773
801
|
#
|
|
774
802
|
# The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
|
|
775
803
|
# be reached via proxy; if set it should be a comma separated list of
|
|
@@ -785,7 +813,7 @@ class Gem::Net::HTTP::Persistent
|
|
|
785
813
|
|
|
786
814
|
return nil if env_proxy.nil? or env_proxy.empty?
|
|
787
815
|
|
|
788
|
-
uri =
|
|
816
|
+
uri = Gem::URI normalize_uri env_proxy
|
|
789
817
|
|
|
790
818
|
env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
|
|
791
819
|
|
|
@@ -863,7 +891,7 @@ class Gem::Net::HTTP::Persistent
|
|
|
863
891
|
# +req+ must be a Gem::Net::HTTPGenericRequest subclass (see Gem::Net::HTTP for a list).
|
|
864
892
|
|
|
865
893
|
def request uri, req = nil, &block
|
|
866
|
-
uri =
|
|
894
|
+
uri = Gem::URI uri
|
|
867
895
|
req = request_setup req || uri
|
|
868
896
|
response = nil
|
|
869
897
|
|
|
@@ -896,7 +924,7 @@ class Gem::Net::HTTP::Persistent
|
|
|
896
924
|
end
|
|
897
925
|
|
|
898
926
|
##
|
|
899
|
-
# Creates a GET request if +req_or_uri+ is a
|
|
927
|
+
# Creates a GET request if +req_or_uri+ is a Gem::URI and adds headers to the
|
|
900
928
|
# request.
|
|
901
929
|
#
|
|
902
930
|
# Returns the request.
|
|
@@ -948,8 +976,10 @@ class Gem::Net::HTTP::Persistent
|
|
|
948
976
|
connection.min_version = @min_version if @min_version
|
|
949
977
|
connection.max_version = @max_version if @max_version
|
|
950
978
|
|
|
951
|
-
connection.verify_depth
|
|
952
|
-
connection.verify_mode
|
|
979
|
+
connection.verify_depth = @verify_depth
|
|
980
|
+
connection.verify_mode = @verify_mode
|
|
981
|
+
connection.verify_hostname = @verify_hostname if
|
|
982
|
+
@verify_hostname != nil && connection.respond_to?(:verify_hostname=)
|
|
953
983
|
|
|
954
984
|
if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
|
|
955
985
|
not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
|
|
@@ -1058,6 +1088,15 @@ application:
|
|
|
1058
1088
|
reconnect_ssl
|
|
1059
1089
|
end
|
|
1060
1090
|
|
|
1091
|
+
##
|
|
1092
|
+
# Sets the HTTPS verify_hostname.
|
|
1093
|
+
|
|
1094
|
+
def verify_hostname= verify_hostname
|
|
1095
|
+
@verify_hostname = verify_hostname
|
|
1096
|
+
|
|
1097
|
+
reconnect_ssl
|
|
1098
|
+
end
|
|
1099
|
+
|
|
1061
1100
|
##
|
|
1062
1101
|
# SSL verification callback.
|
|
1063
1102
|
|
|
@@ -1070,4 +1109,3 @@ end
|
|
|
1070
1109
|
|
|
1071
1110
|
require_relative 'persistent/connection'
|
|
1072
1111
|
require_relative 'persistent/pool'
|
|
1073
|
-
|
|
@@ -79,29 +79,17 @@ module Bundler::PubGrub
|
|
|
79
79
|
dependencies_for(@root_package, @root_version)
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
# Override me (maybe)
|
|
83
|
-
#
|
|
84
|
-
# If not overridden, the order returned by all_versions_for will be used
|
|
85
|
-
#
|
|
86
|
-
# Returns: Array of versions in preferred order
|
|
87
|
-
def sort_versions_by_preferred(package, sorted_versions)
|
|
88
|
-
indexes = @version_indexes[package]
|
|
89
|
-
sorted_versions.sort_by { |version| indexes[version] }
|
|
90
|
-
end
|
|
91
|
-
|
|
92
82
|
def initialize
|
|
93
83
|
@root_package = Package.root
|
|
94
84
|
@root_version = Package.root_version
|
|
95
85
|
|
|
96
|
-
@
|
|
86
|
+
@sorted_versions = Hash.new do |h,k|
|
|
97
87
|
if k == @root_package
|
|
98
88
|
h[k] = [@root_version]
|
|
99
89
|
else
|
|
100
|
-
h[k] = all_versions_for(k)
|
|
90
|
+
h[k] = all_versions_for(k).sort
|
|
101
91
|
end
|
|
102
92
|
end
|
|
103
|
-
@sorted_versions = Hash.new { |h,k| h[k] = @cached_versions[k].sort }
|
|
104
|
-
@version_indexes = Hash.new { |h,k| h[k] = @cached_versions[k].each.with_index.to_h }
|
|
105
93
|
|
|
106
94
|
@cached_dependencies = Hash.new do |packages, package|
|
|
107
95
|
if package == @root_package
|
|
@@ -117,15 +105,7 @@ module Bundler::PubGrub
|
|
|
117
105
|
end
|
|
118
106
|
|
|
119
107
|
def versions_for(package, range=VersionRange.any)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# Conditional avoids (among other things) calling
|
|
123
|
-
# sort_versions_by_preferred with the root package
|
|
124
|
-
if versions.size > 1
|
|
125
|
-
sort_versions_by_preferred(package, versions)
|
|
126
|
-
else
|
|
127
|
-
versions
|
|
128
|
-
end
|
|
108
|
+
range.select_versions(@sorted_versions[package])
|
|
129
109
|
end
|
|
130
110
|
|
|
131
111
|
def no_versions_incompatibility_for(_package, unsatisfied_term)
|
|
@@ -164,7 +144,7 @@ module Bundler::PubGrub
|
|
|
164
144
|
sorted_versions[high]
|
|
165
145
|
end
|
|
166
146
|
|
|
167
|
-
range = VersionRange.new(min: low, max: high, include_min:
|
|
147
|
+
range = VersionRange.new(min: low, max: high, include_min: !low.nil?)
|
|
168
148
|
|
|
169
149
|
self_constraint = VersionConstraint.new(package, range: range)
|
|
170
150
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module Bundler::PubGrub
|
|
2
|
+
class Strategy
|
|
3
|
+
def initialize(source)
|
|
4
|
+
@source = source
|
|
5
|
+
|
|
6
|
+
@root_package = Package.root
|
|
7
|
+
@root_version = Package.root_version
|
|
8
|
+
|
|
9
|
+
@version_indexes = Hash.new do |h,k|
|
|
10
|
+
if k == @root_package
|
|
11
|
+
h[k] = { @root_version => 0 }
|
|
12
|
+
else
|
|
13
|
+
h[k] = @source.all_versions_for(k).each.with_index.to_h
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def next_package_and_version(unsatisfied)
|
|
19
|
+
package, range = next_term_to_try_from(unsatisfied)
|
|
20
|
+
|
|
21
|
+
[package, most_preferred_version_of(package, range)]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def most_preferred_version_of(package, range)
|
|
27
|
+
versions = @source.versions_for(package, range)
|
|
28
|
+
|
|
29
|
+
indexes = @version_indexes[package]
|
|
30
|
+
versions.min_by { |version| indexes[version] }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def next_term_to_try_from(unsatisfied)
|
|
34
|
+
unsatisfied.min_by do |package, range|
|
|
35
|
+
matching_versions = @source.versions_for(package, range)
|
|
36
|
+
higher_versions = @source.versions_for(package, range.upper_invert)
|
|
37
|
+
|
|
38
|
+
[matching_versions.count <= 1 ? 0 : 1, higher_versions.count]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -76,6 +76,9 @@ module Bundler::PubGrub
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def initialize(min: nil, max: nil, include_min: false, include_max: false, name: nil)
|
|
79
|
+
raise ArgumentError, "Ranges without a lower bound cannot have include_min == true" if !min && include_min == true
|
|
80
|
+
raise ArgumentError, "Ranges without an upper bound cannot have include_max == true" if !max && include_max == true
|
|
81
|
+
|
|
79
82
|
@min = min
|
|
80
83
|
@max = max
|
|
81
84
|
@include_min = include_min
|
|
@@ -311,10 +314,19 @@ module Bundler::PubGrub
|
|
|
311
314
|
|
|
312
315
|
def contiguous_to?(other)
|
|
313
316
|
return false if other.empty?
|
|
317
|
+
return true if any?
|
|
318
|
+
|
|
319
|
+
intersects?(other) || contiguous_below?(other) || contiguous_above?(other)
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
def contiguous_below?(other)
|
|
323
|
+
return false if !max || !other.min
|
|
324
|
+
|
|
325
|
+
max == other.min && (include_max || other.include_min)
|
|
326
|
+
end
|
|
314
327
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
(max == other.min && (include_max || other.include_min))
|
|
328
|
+
def contiguous_above?(other)
|
|
329
|
+
other.contiguous_below?(self)
|
|
318
330
|
end
|
|
319
331
|
|
|
320
332
|
def allows_all?(other)
|
|
@@ -375,15 +387,15 @@ module Bundler::PubGrub
|
|
|
375
387
|
def invert
|
|
376
388
|
return self.class.empty if any?
|
|
377
389
|
|
|
378
|
-
low = VersionRange.new(max: min, include_max: !include_min)
|
|
379
|
-
high = VersionRange.new(min: max, include_min: !include_max)
|
|
390
|
+
low = -> { VersionRange.new(max: min, include_max: !include_min) }
|
|
391
|
+
high = -> { VersionRange.new(min: max, include_min: !include_max) }
|
|
380
392
|
|
|
381
393
|
if !min
|
|
382
|
-
high
|
|
394
|
+
high.call
|
|
383
395
|
elsif !max
|
|
384
|
-
low
|
|
396
|
+
low.call
|
|
385
397
|
else
|
|
386
|
-
low.union(high)
|
|
398
|
+
low.call.union(high.call)
|
|
387
399
|
end
|
|
388
400
|
end
|
|
389
401
|
|
|
@@ -2,17 +2,20 @@ require_relative 'partial_solution'
|
|
|
2
2
|
require_relative 'term'
|
|
3
3
|
require_relative 'incompatibility'
|
|
4
4
|
require_relative 'solve_failure'
|
|
5
|
+
require_relative 'strategy'
|
|
5
6
|
|
|
6
7
|
module Bundler::PubGrub
|
|
7
8
|
class VersionSolver
|
|
8
9
|
attr_reader :logger
|
|
9
10
|
attr_reader :source
|
|
10
11
|
attr_reader :solution
|
|
12
|
+
attr_reader :strategy
|
|
11
13
|
|
|
12
|
-
def initialize(source:, root: Package.root, logger: Bundler::PubGrub.logger)
|
|
14
|
+
def initialize(source:, root: Package.root, strategy: Strategy.new(source), logger: Bundler::PubGrub.logger)
|
|
13
15
|
@logger = logger
|
|
14
16
|
|
|
15
17
|
@source = source
|
|
18
|
+
@strategy = strategy
|
|
16
19
|
|
|
17
20
|
# { package => [incompatibility, ...]}
|
|
18
21
|
@incompatibilities = Hash.new do |h, k|
|
|
@@ -36,26 +39,25 @@ module Bundler::PubGrub
|
|
|
36
39
|
|
|
37
40
|
# Returns true if there is more work to be done, false otherwise
|
|
38
41
|
def work
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
next_package = choose_package_version
|
|
42
|
-
propagate(next_package)
|
|
43
|
-
|
|
44
|
-
if solved?
|
|
42
|
+
unsatisfied_terms = solution.unsatisfied
|
|
43
|
+
if unsatisfied_terms.empty?
|
|
45
44
|
logger.info { "Solution found after #{solution.attempted_solutions} attempts:" }
|
|
46
45
|
solution.decisions.each do |package, version|
|
|
47
46
|
next if Package.root?(package)
|
|
48
47
|
logger.info { "* #{package} #{version}" }
|
|
49
48
|
end
|
|
50
49
|
|
|
51
|
-
false
|
|
52
|
-
else
|
|
53
|
-
true
|
|
50
|
+
return false
|
|
54
51
|
end
|
|
52
|
+
|
|
53
|
+
next_package = choose_package_version_from(unsatisfied_terms)
|
|
54
|
+
propagate(next_package)
|
|
55
|
+
|
|
56
|
+
true
|
|
55
57
|
end
|
|
56
58
|
|
|
57
59
|
def solve
|
|
58
|
-
work
|
|
60
|
+
while work; end
|
|
59
61
|
|
|
60
62
|
solution.decisions
|
|
61
63
|
end
|
|
@@ -105,29 +107,15 @@ module Bundler::PubGrub
|
|
|
105
107
|
unsatisfied.package
|
|
106
108
|
end
|
|
107
109
|
|
|
108
|
-
def
|
|
109
|
-
|
|
110
|
-
package = term.package
|
|
111
|
-
range = term.constraint.range
|
|
112
|
-
matching_versions = source.versions_for(package, range)
|
|
113
|
-
higher_versions = source.versions_for(package, range.upper_invert)
|
|
110
|
+
def choose_package_version_from(unsatisfied_terms)
|
|
111
|
+
remaining = unsatisfied_terms.map { |t| [t.package, t.constraint.range] }.to_h
|
|
114
112
|
|
|
115
|
-
|
|
116
|
-
end.package
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
def choose_package_version
|
|
120
|
-
if solution.unsatisfied.empty?
|
|
121
|
-
logger.info "No packages unsatisfied. Solving complete!"
|
|
122
|
-
return nil
|
|
123
|
-
end
|
|
113
|
+
package, version = strategy.next_package_and_version(remaining)
|
|
124
114
|
|
|
125
|
-
package = next_package_to_try
|
|
126
|
-
unsatisfied_term = solution.unsatisfied.find { |t| t.package == package }
|
|
127
|
-
version = source.versions_for(package, unsatisfied_term.constraint.range).first
|
|
128
115
|
logger.debug { "attempting #{package} #{version}" }
|
|
129
116
|
|
|
130
117
|
if version.nil?
|
|
118
|
+
unsatisfied_term = unsatisfied_terms.find { |t| t.package == package }
|
|
131
119
|
add_incompatibility source.no_versions_incompatibility_for(package, unsatisfied_term)
|
|
132
120
|
return package
|
|
133
121
|
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
|
4
|
+
|
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
|
6
|
+
software without restriction, provided that you duplicate all of the
|
|
7
|
+
original copyright notices and associated disclaimers.
|
|
8
|
+
|
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
|
10
|
+
you do at least ONE of the following:
|
|
11
|
+
|
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
|
13
|
+
make them Freely Available, such as by posting said
|
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
|
15
|
+
the author to include your modifications in the software.
|
|
16
|
+
|
|
17
|
+
b. use the modified software only within your corporation or
|
|
18
|
+
organization.
|
|
19
|
+
|
|
20
|
+
c. give non-standard binaries non-standard names, with
|
|
21
|
+
instructions on where to get the original software distribution.
|
|
22
|
+
|
|
23
|
+
d. make other distribution arrangements with the author.
|
|
24
|
+
|
|
25
|
+
3. You may distribute the software in object code or binary form,
|
|
26
|
+
provided that you do at least ONE of the following:
|
|
27
|
+
|
|
28
|
+
a. distribute the binaries and library files of the software,
|
|
29
|
+
together with instructions (in the manual page or equivalent)
|
|
30
|
+
on where to get the original distribution.
|
|
31
|
+
|
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
|
33
|
+
the software.
|
|
34
|
+
|
|
35
|
+
c. give non-standard binaries non-standard names, with
|
|
36
|
+
instructions on where to get the original software distribution.
|
|
37
|
+
|
|
38
|
+
d. make other distribution arrangements with the author.
|
|
39
|
+
|
|
40
|
+
4. You may modify and include the part of the software into any other
|
|
41
|
+
software (possibly commercial). But some files in the distribution
|
|
42
|
+
are not written by the author, so that they are not under these terms.
|
|
43
|
+
|
|
44
|
+
For the list of those files and their copying conditions, see the
|
|
45
|
+
file LEGAL.
|
|
46
|
+
|
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
|
48
|
+
output from the software do not automatically fall under the
|
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
|
51
|
+
software.
|
|
52
|
+
|
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
56
|
+
PURPOSE.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# -*- coding: us-ascii -*-
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'random/formatter'
|
|
5
|
+
|
|
6
|
+
# == Secure random number generator interface.
|
|
7
|
+
#
|
|
8
|
+
# This library is an interface to secure random number generators which are
|
|
9
|
+
# suitable for generating session keys in HTTP cookies, etc.
|
|
10
|
+
#
|
|
11
|
+
# You can use this library in your application by requiring it:
|
|
12
|
+
#
|
|
13
|
+
# require 'bundler/vendor/securerandom/lib/securerandom'
|
|
14
|
+
#
|
|
15
|
+
# It supports the following secure random number generators:
|
|
16
|
+
#
|
|
17
|
+
# * openssl
|
|
18
|
+
# * /dev/urandom
|
|
19
|
+
# * Win32
|
|
20
|
+
#
|
|
21
|
+
# Bundler::SecureRandom is extended by the Random::Formatter module which
|
|
22
|
+
# defines the following methods:
|
|
23
|
+
#
|
|
24
|
+
# * alphanumeric
|
|
25
|
+
# * base64
|
|
26
|
+
# * choose
|
|
27
|
+
# * gen_random
|
|
28
|
+
# * hex
|
|
29
|
+
# * rand
|
|
30
|
+
# * random_bytes
|
|
31
|
+
# * random_number
|
|
32
|
+
# * urlsafe_base64
|
|
33
|
+
# * uuid
|
|
34
|
+
#
|
|
35
|
+
# These methods are usable as class methods of Bundler::SecureRandom such as
|
|
36
|
+
# +Bundler::SecureRandom.hex+.
|
|
37
|
+
#
|
|
38
|
+
# If a secure random number generator is not available,
|
|
39
|
+
# +NotImplementedError+ is raised.
|
|
40
|
+
|
|
41
|
+
module Bundler::SecureRandom
|
|
42
|
+
|
|
43
|
+
# The version
|
|
44
|
+
VERSION = "0.4.1"
|
|
45
|
+
|
|
46
|
+
class << self
|
|
47
|
+
# Returns a random binary string containing +size+ bytes.
|
|
48
|
+
#
|
|
49
|
+
# See Random.bytes
|
|
50
|
+
def bytes(n)
|
|
51
|
+
return gen_random(n)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Compatibility methods for Ruby 3.2, we can remove this after dropping to support Ruby 3.2
|
|
55
|
+
def alphanumeric(n = nil, chars: ALPHANUMERIC)
|
|
56
|
+
n = 16 if n.nil?
|
|
57
|
+
choose(chars, n)
|
|
58
|
+
end if RUBY_VERSION < '3.3'
|
|
59
|
+
|
|
60
|
+
private
|
|
61
|
+
|
|
62
|
+
# :stopdoc:
|
|
63
|
+
|
|
64
|
+
# Implementation using OpenSSL
|
|
65
|
+
def gen_random_openssl(n)
|
|
66
|
+
return OpenSSL::Random.random_bytes(n)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Implementation using system random device
|
|
70
|
+
def gen_random_urandom(n)
|
|
71
|
+
ret = Random.urandom(n)
|
|
72
|
+
unless ret
|
|
73
|
+
raise NotImplementedError, "No random device"
|
|
74
|
+
end
|
|
75
|
+
unless ret.length == n
|
|
76
|
+
raise NotImplementedError, "Unexpected partial read from random device: only #{ret.length} for #{n} bytes"
|
|
77
|
+
end
|
|
78
|
+
ret
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
begin
|
|
82
|
+
# Check if Random.urandom is available
|
|
83
|
+
Random.urandom(1)
|
|
84
|
+
alias gen_random gen_random_urandom
|
|
85
|
+
rescue RuntimeError
|
|
86
|
+
begin
|
|
87
|
+
require 'openssl'
|
|
88
|
+
rescue NoMethodError
|
|
89
|
+
raise NotImplementedError, "No random device"
|
|
90
|
+
else
|
|
91
|
+
alias gen_random gen_random_openssl
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# :startdoc:
|
|
96
|
+
|
|
97
|
+
# Generate random data bytes for Random::Formatter
|
|
98
|
+
public :gen_random
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
Bundler::SecureRandom.extend(Random::Formatter)
|
|
@@ -10,7 +10,6 @@ class Bundler::Thor
|
|
|
10
10
|
# destination<String>:: the relative path to the destination root.
|
|
11
11
|
# config<Hash>:: give :verbose => false to not log the status, and
|
|
12
12
|
# :mode => :preserve, to preserve the file mode from the source.
|
|
13
|
-
|
|
14
13
|
#
|
|
15
14
|
# ==== Examples
|
|
16
15
|
#
|
|
@@ -275,9 +274,8 @@ class Bundler::Thor
|
|
|
275
274
|
end
|
|
276
275
|
end
|
|
277
276
|
|
|
278
|
-
# Uncomment all lines matching a given regex.
|
|
279
|
-
#
|
|
280
|
-
# between the comment hash and the beginning of the line.
|
|
277
|
+
# Uncomment all lines matching a given regex. Preserves indentation before
|
|
278
|
+
# the comment hash and removes the hash and any immediate following space.
|
|
281
279
|
#
|
|
282
280
|
# ==== Parameters
|
|
283
281
|
# path<String>:: path of the file to be changed
|
|
@@ -291,7 +289,7 @@ class Bundler::Thor
|
|
|
291
289
|
def uncomment_lines(path, flag, *args)
|
|
292
290
|
flag = flag.respond_to?(:source) ? flag.source : flag
|
|
293
291
|
|
|
294
|
-
gsub_file(path, /^(\s*)#[[:blank:]]
|
|
292
|
+
gsub_file(path, /^(\s*)#[[:blank:]]?(.*#{flag})/, '\1\2', *args)
|
|
295
293
|
end
|
|
296
294
|
|
|
297
295
|
# Comment all lines matching a given regex. It will leave the space
|