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
|
@@ -193,6 +193,24 @@ module Bundler
|
|
|
193
193
|
status_code(31)
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
+
class ReadOnlyFileSystemError < PermissionError
|
|
197
|
+
def message
|
|
198
|
+
"There was an error while trying to #{action} `#{@path}`. " \
|
|
199
|
+
"File system is read-only."
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
status_code(42)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
class OperationNotPermittedError < PermissionError
|
|
206
|
+
def message
|
|
207
|
+
"There was an error while trying to #{action} `#{@path}`. " \
|
|
208
|
+
"Underlying OS system call raised an EPERM error."
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
status_code(43)
|
|
212
|
+
end
|
|
213
|
+
|
|
196
214
|
class GenericSystemCallError < BundlerError
|
|
197
215
|
attr_reader :underlying_error
|
|
198
216
|
|
|
@@ -217,17 +235,47 @@ module Bundler
|
|
|
217
235
|
end
|
|
218
236
|
|
|
219
237
|
class InsecureInstallPathError < BundlerError
|
|
220
|
-
def initialize(path)
|
|
238
|
+
def initialize(name, path)
|
|
239
|
+
@name = name
|
|
221
240
|
@path = path
|
|
222
241
|
end
|
|
223
242
|
|
|
224
243
|
def message
|
|
225
|
-
"
|
|
226
|
-
"#{@path} is world-writable
|
|
227
|
-
"
|
|
228
|
-
"Please change the permissions of this directory or choose a different install path."
|
|
244
|
+
"Bundler cannot reinstall #{@name} because there's a previous installation of it at #{@path} that is unsafe to remove.\n" \
|
|
245
|
+
"The parent of #{@path} is world-writable and does not have the sticky bit set, making it insecure to remove due to potential vulnerabilities.\n" \
|
|
246
|
+
"Please change the permissions of #{File.dirname(@path)} or choose a different install path."
|
|
229
247
|
end
|
|
230
248
|
|
|
231
249
|
status_code(38)
|
|
232
250
|
end
|
|
251
|
+
|
|
252
|
+
class CorruptBundlerInstallError < BundlerError
|
|
253
|
+
def initialize(loaded_spec)
|
|
254
|
+
@loaded_spec = loaded_spec
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
def message
|
|
258
|
+
"The running version of Bundler (#{Bundler::VERSION}) does not match the version of the specification installed for it (#{@loaded_spec.version}). " \
|
|
259
|
+
"This can be caused by reinstalling Ruby without removing previous installation, leaving around an upgraded default version of Bundler. " \
|
|
260
|
+
"Reinstalling Ruby from scratch should fix the problem."
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
status_code(39)
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
class InvalidArgumentError < BundlerError; status_code(40); end
|
|
267
|
+
|
|
268
|
+
class IncorrectLockfileDependencies < BundlerError
|
|
269
|
+
attr_reader :spec
|
|
270
|
+
|
|
271
|
+
def initialize(spec)
|
|
272
|
+
@spec = spec
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
def message
|
|
276
|
+
"Bundler found incorrect dependencies in the lockfile for #{spec.full_name}"
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
status_code(41)
|
|
280
|
+
end
|
|
233
281
|
end
|
|
@@ -25,7 +25,7 @@ module Bundler
|
|
|
25
25
|
end
|
|
26
26
|
private_class_method :settings_method
|
|
27
27
|
|
|
28
|
-
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
|
|
28
|
+
(1..10).each {|v| define_method("bundler_#{v}_mode?") { @major_version >= v } }
|
|
29
29
|
|
|
30
30
|
settings_flag(:allow_offline_install) { bundler_3_mode? }
|
|
31
31
|
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
|
|
@@ -33,6 +33,7 @@ module Bundler
|
|
|
33
33
|
settings_flag(:default_install_uses_path) { bundler_3_mode? }
|
|
34
34
|
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
|
35
35
|
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
|
36
|
+
settings_flag(:lockfile_checksums) { bundler_3_mode? }
|
|
36
37
|
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
|
37
38
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
|
38
39
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
|
@@ -43,11 +44,7 @@ module Bundler
|
|
|
43
44
|
|
|
44
45
|
def initialize(bundler_version)
|
|
45
46
|
@bundler_version = Gem::Version.create(bundler_version)
|
|
47
|
+
@major_version = @bundler_version.segments.first
|
|
46
48
|
end
|
|
47
|
-
|
|
48
|
-
def major_version
|
|
49
|
-
@bundler_version.segments.first
|
|
50
|
-
end
|
|
51
|
-
private :major_version
|
|
52
49
|
end
|
|
53
50
|
end
|
|
@@ -4,15 +4,13 @@ require_relative "base"
|
|
|
4
4
|
require_relative "../worker"
|
|
5
5
|
|
|
6
6
|
module Bundler
|
|
7
|
-
autoload :CompactIndexClient, File.expand_path("../compact_index_client", __dir__)
|
|
8
|
-
|
|
9
7
|
class Fetcher
|
|
10
8
|
class CompactIndex < Base
|
|
11
9
|
def self.compact_index_request(method_name)
|
|
12
10
|
method = instance_method(method_name)
|
|
13
11
|
undef_method(method_name)
|
|
14
12
|
define_method(method_name) do |*args, &blk|
|
|
15
|
-
method.
|
|
13
|
+
method.bind_call(self, *args, &blk)
|
|
16
14
|
rescue NetworkDownError, CompactIndexClient::Updater::MismatchedChecksumError => e
|
|
17
15
|
raise HTTPError, e.message
|
|
18
16
|
rescue AuthenticationRequiredError, BadAuthenticationError
|
|
@@ -36,15 +34,8 @@ module Bundler
|
|
|
36
34
|
|
|
37
35
|
until remaining_gems.empty?
|
|
38
36
|
log_specs { "Looking up gems #{remaining_gems.inspect}" }
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
parallel_compact_index_client.dependencies(remaining_gems)
|
|
42
|
-
rescue TooManyRequestsError
|
|
43
|
-
@bundle_worker&.stop
|
|
44
|
-
@bundle_worker = nil # reset it. Not sure if necessary
|
|
45
|
-
serial_compact_index_client.dependencies(remaining_gems)
|
|
46
|
-
end
|
|
47
|
-
next_gems = deps.flat_map {|d| d[3].flat_map(&:first) }.uniq
|
|
37
|
+
deps = fetch_gem_infos(remaining_gems).flatten(1)
|
|
38
|
+
next_gems = deps.flat_map {|d| d[CompactIndexClient::INFO_DEPS].flat_map(&:first) }.uniq
|
|
48
39
|
deps.each {|dep| gem_info << dep }
|
|
49
40
|
complete_gems.concat(deps.map(&:first)).uniq!
|
|
50
41
|
remaining_gems = next_gems - complete_gems
|
|
@@ -61,7 +52,7 @@ module Bundler
|
|
|
61
52
|
return nil
|
|
62
53
|
end
|
|
63
54
|
# Read info file checksums out of /versions, so we can know if gems are up to date
|
|
64
|
-
compact_index_client.
|
|
55
|
+
compact_index_client.available?
|
|
65
56
|
rescue CompactIndexClient::Updater::MismatchedChecksumError => e
|
|
66
57
|
Bundler.ui.debug(e.message)
|
|
67
58
|
nil
|
|
@@ -81,20 +72,20 @@ module Bundler
|
|
|
81
72
|
end
|
|
82
73
|
end
|
|
83
74
|
|
|
84
|
-
def
|
|
85
|
-
compact_index_client.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
compact_index_client
|
|
75
|
+
def fetch_gem_infos(names)
|
|
76
|
+
in_parallel(names) {|name| compact_index_client.info(name) }
|
|
77
|
+
rescue TooManyRequestsError # rubygems.org is rate limiting us, slow down.
|
|
78
|
+
@bundle_worker&.stop
|
|
79
|
+
@bundle_worker = nil # reset it. Not sure if necessary
|
|
80
|
+
compact_index_client.reset!
|
|
81
|
+
names.map {|name| compact_index_client.info(name) }
|
|
93
82
|
end
|
|
94
83
|
|
|
95
|
-
def
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
def in_parallel(inputs, &blk)
|
|
85
|
+
func = lambda {|object, _index| blk.call(object) }
|
|
86
|
+
worker = bundle_worker(func)
|
|
87
|
+
inputs.each {|input| worker.enq(input) }
|
|
88
|
+
inputs.map { worker.deq }
|
|
98
89
|
end
|
|
99
90
|
|
|
100
91
|
def bundle_worker(func = nil)
|
|
@@ -23,7 +23,7 @@ module Bundler
|
|
|
23
23
|
when Gem::Net::HTTPSuccess, Gem::Net::HTTPNotModified
|
|
24
24
|
response
|
|
25
25
|
when Gem::Net::HTTPRedirection
|
|
26
|
-
new_uri =
|
|
26
|
+
new_uri = Gem::URI.parse(response["location"])
|
|
27
27
|
if new_uri.host == uri.host
|
|
28
28
|
new_uri.user = uri.user
|
|
29
29
|
new_uri.password = uri.password
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require_relative "vendored_persistent"
|
|
4
4
|
require_relative "vendored_timeout"
|
|
5
5
|
require "cgi"
|
|
6
|
-
|
|
6
|
+
require_relative "vendored_securerandom"
|
|
7
7
|
require "zlib"
|
|
8
8
|
|
|
9
9
|
module Bundler
|
|
@@ -37,8 +37,9 @@ module Bundler
|
|
|
37
37
|
# This is the error raised when a source is HTTPS and OpenSSL didn't load
|
|
38
38
|
class SSLError < HTTPError
|
|
39
39
|
def initialize(msg = nil)
|
|
40
|
-
super
|
|
41
|
-
|
|
40
|
+
super "Could not load OpenSSL.\n" \
|
|
41
|
+
"You must recompile Ruby with OpenSSL support.\n" \
|
|
42
|
+
"original error: #{msg}\n"
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
|
|
@@ -111,7 +112,7 @@ module Bundler
|
|
|
111
112
|
spec -= [nil, "ruby", ""]
|
|
112
113
|
spec_file_name = "#{spec.join "-"}.gemspec"
|
|
113
114
|
|
|
114
|
-
uri =
|
|
115
|
+
uri = Gem::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
|
115
116
|
spec = if uri.scheme == "file"
|
|
116
117
|
path = Gem::Util.correct_for_windows_path(uri.path)
|
|
117
118
|
Bundler.safe_load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
|
|
@@ -182,7 +183,7 @@ module Bundler
|
|
|
182
183
|
agent << " ci/#{cis.join(",")}" if cis.any?
|
|
183
184
|
|
|
184
185
|
# add a random ID so we can consolidate runs server-side
|
|
185
|
-
agent << " " << SecureRandom.hex(8)
|
|
186
|
+
agent << " " << Gem::SecureRandom.hex(8)
|
|
186
187
|
|
|
187
188
|
# add any user agent strings set in the config
|
|
188
189
|
extra_ua = Bundler.settings[:user_agent]
|
|
@@ -251,11 +252,17 @@ module Bundler
|
|
|
251
252
|
needs_ssl = remote_uri.scheme == "https" ||
|
|
252
253
|
Bundler.settings[:ssl_verify_mode] ||
|
|
253
254
|
Bundler.settings[:ssl_client_cert]
|
|
254
|
-
|
|
255
|
+
if needs_ssl
|
|
256
|
+
begin
|
|
257
|
+
require "openssl"
|
|
258
|
+
rescue StandardError, LoadError => e
|
|
259
|
+
raise SSLError.new(e.message)
|
|
260
|
+
end
|
|
261
|
+
end
|
|
255
262
|
|
|
256
263
|
con = Gem::Net::HTTP::Persistent.new name: "bundler", proxy: :ENV
|
|
257
264
|
if gem_proxy = Gem.configuration[:http_proxy]
|
|
258
|
-
con.proxy =
|
|
265
|
+
con.proxy = Gem::URI.parse(gem_proxy) if gem_proxy != :no_proxy
|
|
259
266
|
end
|
|
260
267
|
|
|
261
268
|
if remote_uri.scheme == "https"
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
module Bundler
|
|
4
4
|
module ForcePlatform
|
|
5
|
-
private
|
|
6
|
-
|
|
7
5
|
# The `:force_ruby_platform` value used by dependencies for resolution, and
|
|
8
6
|
# by locked specifications for materialization is `false` by default, except
|
|
9
7
|
# for TruffleRuby. TruffleRuby generally needs to force the RUBY platform
|
|
@@ -80,7 +80,7 @@ module Bundler
|
|
|
80
80
|
First, try this link to see if there are any existing issue reports for this error:
|
|
81
81
|
#{issues_url(e)}
|
|
82
82
|
|
|
83
|
-
If there aren't any reports for this error yet, please fill in the new issue form located at #{new_issue_url}
|
|
83
|
+
If there aren't any reports for this error yet, please fill in the new issue form located at #{new_issue_url}. Make sure to copy and paste the full output of this command under the "What happened instead?" section.
|
|
84
84
|
EOS
|
|
85
85
|
end
|
|
86
86
|
|
|
@@ -47,7 +47,7 @@ module Bundler
|
|
|
47
47
|
built_gem_path = build_gem
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
desc "Generate SHA512 checksum
|
|
50
|
+
desc "Generate SHA512 checksum of #{name}-#{version}.gem into the checksums directory."
|
|
51
51
|
task "build:checksum" => "build" do
|
|
52
52
|
build_checksum(built_gem_path)
|
|
53
53
|
end
|
|
@@ -4,20 +4,14 @@ module Bundler
|
|
|
4
4
|
module GemHelpers
|
|
5
5
|
GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
|
|
6
6
|
GENERICS = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[Gem::Platform.new("mswin64"), Gem::Platform.new("mswin64")],
|
|
10
|
-
[Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
|
|
11
|
-
[Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
|
12
|
-
[Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
|
13
|
-
[Gem::Platform.new("x64-mingw-ucrt"), Gem::Platform.new("x64-mingw-ucrt")],
|
|
14
|
-
[Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
|
|
7
|
+
Gem::Platform::JAVA,
|
|
8
|
+
*Gem::Platform::WINDOWS,
|
|
15
9
|
].freeze
|
|
16
10
|
|
|
17
11
|
def generic(p)
|
|
18
12
|
GENERIC_CACHE[p] ||= begin
|
|
19
|
-
|
|
20
|
-
p
|
|
13
|
+
found = GENERICS.find do |match|
|
|
14
|
+
p === match
|
|
21
15
|
end
|
|
22
16
|
found || Gem::Platform::RUBY
|
|
23
17
|
end
|
|
@@ -46,29 +40,52 @@ module Bundler
|
|
|
46
40
|
end
|
|
47
41
|
module_function :platform_specificity_match
|
|
48
42
|
|
|
49
|
-
def
|
|
50
|
-
matching =
|
|
43
|
+
def select_all_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
|
|
44
|
+
matching = if force_ruby
|
|
45
|
+
specs.select {|spec| spec.match_platform(Gem::Platform::RUBY) && spec.force_ruby_platform! }
|
|
46
|
+
else
|
|
47
|
+
specs.select {|spec| spec.match_platform(platform) }
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
if prefer_locked
|
|
51
|
+
locked_originally = matching.select {|spec| spec.is_a?(LazySpecification) }
|
|
52
|
+
return locked_originally if locked_originally.any?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
matching
|
|
56
|
+
end
|
|
57
|
+
module_function :select_all_platform_match
|
|
58
|
+
|
|
59
|
+
def select_best_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
|
|
60
|
+
matching = select_all_platform_match(specs, platform, force_ruby: force_ruby, prefer_locked: prefer_locked)
|
|
51
61
|
|
|
52
|
-
|
|
62
|
+
sort_and_filter_best_platform_match(matching, platform)
|
|
53
63
|
end
|
|
54
64
|
module_function :select_best_platform_match
|
|
55
65
|
|
|
56
|
-
def
|
|
57
|
-
matching = specs
|
|
66
|
+
def select_best_local_platform_match(specs, force_ruby: false)
|
|
67
|
+
matching = select_all_platform_match(specs, local_platform, force_ruby: force_ruby).filter_map(&:materialized_for_installation)
|
|
58
68
|
|
|
59
|
-
sort_best_platform_match(matching,
|
|
69
|
+
sort_best_platform_match(matching, local_platform)
|
|
60
70
|
end
|
|
61
|
-
module_function :
|
|
71
|
+
module_function :select_best_local_platform_match
|
|
72
|
+
|
|
73
|
+
def sort_and_filter_best_platform_match(matching, platform)
|
|
74
|
+
return matching if matching.one?
|
|
62
75
|
|
|
63
|
-
def sort_best_platform_match(matching, platform)
|
|
64
76
|
exact = matching.select {|spec| spec.platform == platform }
|
|
65
77
|
return exact if exact.any?
|
|
66
78
|
|
|
67
|
-
sorted_matching = matching
|
|
79
|
+
sorted_matching = sort_best_platform_match(matching, platform)
|
|
68
80
|
exemplary_spec = sorted_matching.first
|
|
69
81
|
|
|
70
82
|
sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
|
|
71
83
|
end
|
|
84
|
+
module_function :sort_and_filter_best_platform_match
|
|
85
|
+
|
|
86
|
+
def sort_best_platform_match(matching, platform)
|
|
87
|
+
matching.sort_by {|spec| platform_specificity_match(spec.platform, platform) }
|
|
88
|
+
end
|
|
72
89
|
module_function :sort_best_platform_match
|
|
73
90
|
|
|
74
91
|
class PlatformMatch
|
|
@@ -45,17 +45,37 @@ module Bundler
|
|
|
45
45
|
|
|
46
46
|
# Given a Resolver::Package and an Array of Specifications of available
|
|
47
47
|
# versions for a gem, this method will return the Array of Specifications
|
|
48
|
-
# sorted
|
|
49
|
-
#
|
|
50
|
-
#
|
|
48
|
+
# sorted in an order to give preference to the current level (:major, :minor
|
|
49
|
+
# or :patch) when resolution is deciding what versions best resolve all
|
|
50
|
+
# dependencies in the bundle.
|
|
51
51
|
# @param package [Resolver::Package] The package being resolved.
|
|
52
52
|
# @param specs [Specification] An array of Specifications for the package.
|
|
53
|
-
# @return [Specification] A new instance of the Specification Array sorted
|
|
54
|
-
# possibly filtered.
|
|
53
|
+
# @return [Specification] A new instance of the Specification Array sorted.
|
|
55
54
|
def sort_versions(package, specs)
|
|
56
|
-
|
|
55
|
+
locked_version = package.locked_version
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
result = specs.sort do |a, b|
|
|
58
|
+
unless package.prerelease_specified? || pre?
|
|
59
|
+
a_pre = a.prerelease?
|
|
60
|
+
b_pre = b.prerelease?
|
|
61
|
+
|
|
62
|
+
next 1 if a_pre && !b_pre
|
|
63
|
+
next -1 if b_pre && !a_pre
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if major? || locked_version.nil?
|
|
67
|
+
b <=> a
|
|
68
|
+
elsif either_version_older_than_locked?(a, b, locked_version)
|
|
69
|
+
b <=> a
|
|
70
|
+
elsif segments_do_not_match?(a, b, :major)
|
|
71
|
+
a <=> b
|
|
72
|
+
elsif !minor? && segments_do_not_match?(a, b, :minor)
|
|
73
|
+
a <=> b
|
|
74
|
+
else
|
|
75
|
+
b <=> a
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
post_sort(result, package.unlock?, locked_version)
|
|
59
79
|
end
|
|
60
80
|
|
|
61
81
|
# @return [bool] Convenience method for testing value of level variable.
|
|
@@ -73,9 +93,18 @@ module Bundler
|
|
|
73
93
|
pre == true
|
|
74
94
|
end
|
|
75
95
|
|
|
76
|
-
|
|
96
|
+
# Given a Resolver::Package and an Array of Specifications of available
|
|
97
|
+
# versions for a gem, this method will truncate the Array if strict
|
|
98
|
+
# is true. That means filtering out downgrades from the version currently
|
|
99
|
+
# locked, and filtering out upgrades that go past the selected level (major,
|
|
100
|
+
# minor, or patch).
|
|
101
|
+
# @param package [Resolver::Package] The package being resolved.
|
|
102
|
+
# @param specs [Specification] An array of Specifications for the package.
|
|
103
|
+
# @return [Specification] A new instance of the Specification Array
|
|
104
|
+
# truncated.
|
|
105
|
+
def filter_versions(package, specs)
|
|
106
|
+
return specs unless strict
|
|
77
107
|
|
|
78
|
-
def filter_dep_specs(specs, package)
|
|
79
108
|
locked_version = package.locked_version
|
|
80
109
|
return specs if locked_version.nil? || major?
|
|
81
110
|
|
|
@@ -89,32 +118,7 @@ module Bundler
|
|
|
89
118
|
end
|
|
90
119
|
end
|
|
91
120
|
|
|
92
|
-
|
|
93
|
-
locked_version = package.locked_version
|
|
94
|
-
|
|
95
|
-
result = specs.sort do |a, b|
|
|
96
|
-
unless package.prerelease_specified? || pre?
|
|
97
|
-
a_pre = a.prerelease?
|
|
98
|
-
b_pre = b.prerelease?
|
|
99
|
-
|
|
100
|
-
next -1 if a_pre && !b_pre
|
|
101
|
-
next 1 if b_pre && !a_pre
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
if major? || locked_version.nil?
|
|
105
|
-
a <=> b
|
|
106
|
-
elsif either_version_older_than_locked?(a, b, locked_version)
|
|
107
|
-
a <=> b
|
|
108
|
-
elsif segments_do_not_match?(a, b, :major)
|
|
109
|
-
b <=> a
|
|
110
|
-
elsif !minor? && segments_do_not_match?(a, b, :minor)
|
|
111
|
-
b <=> a
|
|
112
|
-
else
|
|
113
|
-
a <=> b
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
post_sort(result, package.unlock?, locked_version)
|
|
117
|
-
end
|
|
121
|
+
private
|
|
118
122
|
|
|
119
123
|
def either_version_older_than_locked?(a, b, locked_version)
|
|
120
124
|
a.version < locked_version || b.version < locked_version
|
|
@@ -128,18 +132,16 @@ module Bundler
|
|
|
128
132
|
# Specific version moves can't always reliably be done during sorting
|
|
129
133
|
# as not all elements are compared against each other.
|
|
130
134
|
def post_sort(result, unlock, locked_version)
|
|
131
|
-
# default :major behavior in Bundler does not do this
|
|
132
|
-
return result if major?
|
|
133
135
|
if unlock || locked_version.nil?
|
|
134
136
|
result
|
|
135
137
|
else
|
|
136
|
-
|
|
138
|
+
move_version_to_beginning(result, locked_version)
|
|
137
139
|
end
|
|
138
140
|
end
|
|
139
141
|
|
|
140
|
-
def
|
|
142
|
+
def move_version_to_beginning(result, version)
|
|
141
143
|
move, keep = result.partition {|s| s.version.to_s == version.to_s }
|
|
142
|
-
|
|
144
|
+
move.concat(keep)
|
|
143
145
|
end
|
|
144
146
|
end
|
|
145
147
|
end
|
|
@@ -23,10 +23,7 @@ module Bundler
|
|
|
23
23
|
# @param [Pathname] lockfile_path The lockfile in which to inject the new dependency.
|
|
24
24
|
# @return [Array]
|
|
25
25
|
def inject(gemfile_path, lockfile_path)
|
|
26
|
-
|
|
27
|
-
# ensure the lock and Gemfile are synced
|
|
28
|
-
Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
|
|
29
|
-
end
|
|
26
|
+
Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
|
|
30
27
|
|
|
31
28
|
# temporarily unfreeze
|
|
32
29
|
Bundler.settings.temporary(deployment: false, frozen: false) do
|
|
@@ -44,13 +41,13 @@ module Bundler
|
|
|
44
41
|
|
|
45
42
|
# resolve to see if the new deps broke anything
|
|
46
43
|
@definition = builder.to_definition(lockfile_path, {})
|
|
47
|
-
@definition.
|
|
44
|
+
@definition.remotely!
|
|
48
45
|
|
|
49
46
|
# since nothing broke, we can add those gems to the gemfile
|
|
50
47
|
append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @deps.any?
|
|
51
48
|
|
|
52
49
|
# since we resolved successfully, write out the lockfile
|
|
53
|
-
@definition.lock
|
|
50
|
+
@definition.lock
|
|
54
51
|
|
|
55
52
|
# invalidate the cached Bundler.definition
|
|
56
53
|
Bundler.reset_paths!
|
|
@@ -111,18 +108,19 @@ module Bundler
|
|
|
111
108
|
end
|
|
112
109
|
|
|
113
110
|
if d.groups != Array(:default)
|
|
114
|
-
group = d.groups.size == 1 ? ", :
|
|
111
|
+
group = d.groups.size == 1 ? ", group: #{d.groups.first.inspect}" : ", groups: #{d.groups.inspect}"
|
|
115
112
|
end
|
|
116
113
|
|
|
117
|
-
source = ", :
|
|
118
|
-
path = ", :
|
|
119
|
-
git = ", :
|
|
120
|
-
github = ", :
|
|
121
|
-
branch = ", :
|
|
122
|
-
ref = ", :
|
|
123
|
-
|
|
114
|
+
source = ", source: \"#{d.source}\"" unless d.source.nil?
|
|
115
|
+
path = ", path: \"#{d.path}\"" unless d.path.nil?
|
|
116
|
+
git = ", git: \"#{d.git}\"" unless d.git.nil?
|
|
117
|
+
github = ", github: \"#{d.github}\"" unless d.github.nil?
|
|
118
|
+
branch = ", branch: \"#{d.branch}\"" unless d.branch.nil?
|
|
119
|
+
ref = ", ref: \"#{d.ref}\"" unless d.ref.nil?
|
|
120
|
+
glob = ", glob: \"#{d.glob}\"" unless d.glob.nil?
|
|
121
|
+
require_path = ", require: #{convert_autorequire(d.autorequire)}" unless d.autorequire.nil?
|
|
124
122
|
|
|
125
|
-
%(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{require_path})
|
|
123
|
+
%(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{glob}#{require_path})
|
|
126
124
|
end.join("\n")
|
|
127
125
|
end
|
|
128
126
|
|
|
@@ -186,7 +184,7 @@ module Bundler
|
|
|
186
184
|
# @param [Array] gems Array of names of gems to be removed.
|
|
187
185
|
# @param [Pathname] gemfile_path The Gemfile from which to remove dependencies.
|
|
188
186
|
def remove_gems_from_gemfile(gems, gemfile_path)
|
|
189
|
-
patterns = /gem\s+(['"])#{Regexp.union(gems)}\1|gem\s*\((['"])#{Regexp.union(gems)}\2
|
|
187
|
+
patterns = /gem\s+(['"])#{Regexp.union(gems)}\1|gem\s*\((['"])#{Regexp.union(gems)}\2.*\)/
|
|
190
188
|
new_gemfile = []
|
|
191
189
|
multiline_removal = false
|
|
192
190
|
File.readlines(gemfile_path).each do |line|
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Allows for declaring a Gemfile inline in a ruby script,
|
|
4
|
-
#
|
|
3
|
+
# Allows for declaring a Gemfile inline in a ruby script, installing any gems
|
|
4
|
+
# that aren't already installed on the user's system.
|
|
5
5
|
#
|
|
6
6
|
# @note Every gem that is specified in this 'Gemfile' will be `require`d, as if
|
|
7
7
|
# the user had manually called `Bundler.require`. To avoid a requested gem
|
|
8
8
|
# being automatically required, add the `:require => false` option to the
|
|
9
9
|
# `gem` dependency declaration.
|
|
10
10
|
#
|
|
11
|
-
# @param
|
|
12
|
-
#
|
|
13
|
-
#
|
|
11
|
+
# @param force_latest_compatible [Boolean] Force installing the *latest*
|
|
12
|
+
# compatible versions of the gems,
|
|
13
|
+
# even if compatible versions are
|
|
14
|
+
# already installed locally.
|
|
15
|
+
# This also logs output if the
|
|
16
|
+
# `:quiet` option is not set.
|
|
17
|
+
# Defaults to `false`.
|
|
14
18
|
#
|
|
15
19
|
# @param gemfile [Proc] a block that is evaluated as a `Gemfile`.
|
|
16
20
|
#
|
|
@@ -29,31 +33,33 @@
|
|
|
29
33
|
#
|
|
30
34
|
# puts Pod::VERSION # => "0.34.4"
|
|
31
35
|
#
|
|
32
|
-
def gemfile(
|
|
36
|
+
def gemfile(force_latest_compatible = false, options = {}, &gemfile)
|
|
33
37
|
require_relative "../bundler"
|
|
34
38
|
Bundler.reset!
|
|
35
39
|
|
|
36
40
|
opts = options.dup
|
|
37
41
|
ui = opts.delete(:ui) { Bundler::UI::Shell.new }
|
|
38
|
-
ui.level = "silent" if opts.delete(:quiet) || !
|
|
42
|
+
ui.level = "silent" if opts.delete(:quiet) || !force_latest_compatible
|
|
39
43
|
Bundler.ui = ui
|
|
40
44
|
raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
old_gemfile = ENV["BUNDLE_GEMFILE"]
|
|
47
|
+
|
|
48
|
+
Bundler.unbundle_env!
|
|
49
|
+
|
|
50
|
+
begin
|
|
43
51
|
Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
|
|
44
52
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
|
|
45
53
|
|
|
46
54
|
Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
|
|
47
55
|
builder = Bundler::Dsl.new
|
|
48
56
|
builder.instance_eval(&gemfile)
|
|
49
|
-
builder.check_primary_source_safety
|
|
50
57
|
|
|
51
58
|
Bundler.settings.temporary(deployment: false, frozen: false) do
|
|
52
59
|
definition = builder.to_definition(nil, true)
|
|
53
|
-
def definition.lock(*); end
|
|
54
60
|
definition.validate_runtime!
|
|
55
61
|
|
|
56
|
-
if
|
|
62
|
+
if force_latest_compatible || definition.missing_specs?
|
|
57
63
|
Bundler.settings.temporary(inline: true, no_install: false) do
|
|
58
64
|
installer = Bundler::Installer.install(Bundler.root, definition, system: true)
|
|
59
65
|
installer.post_install_messages.each do |name, message|
|
|
@@ -62,12 +68,31 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
|
62
68
|
end
|
|
63
69
|
end
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
begin
|
|
72
|
+
runtime = Bundler::Runtime.new(nil, definition).setup
|
|
73
|
+
rescue Gem::LoadError => e
|
|
74
|
+
name = e.name
|
|
75
|
+
version = e.requirement.requirements.first[1]
|
|
76
|
+
activated_version = Gem.loaded_specs[name].version
|
|
77
|
+
|
|
78
|
+
Bundler.ui.info \
|
|
79
|
+
"The #{name} gem was resolved to #{version}, but #{activated_version} was activated by Bundler while installing it, causing a conflict. " \
|
|
80
|
+
"Bundler will now retry resolving with #{activated_version} instead."
|
|
69
81
|
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
builder.dependencies.delete_if {|d| d.name == name }
|
|
83
|
+
builder.instance_eval { gem name, activated_version }
|
|
84
|
+
definition = builder.to_definition(nil, true)
|
|
85
|
+
|
|
86
|
+
retry
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
runtime.require
|
|
90
|
+
end
|
|
91
|
+
ensure
|
|
92
|
+
if old_gemfile
|
|
93
|
+
ENV["BUNDLE_GEMFILE"] = old_gemfile
|
|
94
|
+
else
|
|
95
|
+
ENV["BUNDLE_GEMFILE"] = ""
|
|
96
|
+
end
|
|
72
97
|
end
|
|
73
98
|
end
|