rubygems-update 3.5.3 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1410 -686
- data/CODE_OF_CONDUCT.md +79 -28
- data/CONTRIBUTING.md +4 -226
- data/Manifest.txt +107 -83
- data/README.md +16 -11
- data/SECURITY.md +7 -0
- data/bundler/CHANGELOG.md +1525 -931
- data/bundler/README.md +9 -9
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +10 -11
- data/bundler/lib/bundler/checksum.rb +22 -12
- data/bundler/lib/bundler/cli/add.rb +3 -1
- data/bundler/lib/bundler/cli/binstubs.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +3 -3
- data/bundler/lib/bundler/cli/common.rb +1 -1
- data/bundler/lib/bundler/cli/config.rb +2 -2
- data/bundler/lib/bundler/cli/console.rb +8 -10
- data/bundler/lib/bundler/cli/doctor/diagnose.rb +167 -0
- data/bundler/lib/bundler/cli/doctor/ssl.rb +249 -0
- data/bundler/lib/bundler/cli/doctor.rb +27 -151
- data/bundler/lib/bundler/cli/exec.rb +1 -0
- data/bundler/lib/bundler/cli/fund.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +74 -46
- data/bundler/lib/bundler/cli/info.rb +6 -6
- data/bundler/lib/bundler/cli/inject.rb +3 -3
- data/bundler/lib/bundler/cli/install.rb +19 -10
- data/bundler/lib/bundler/cli/issue.rb +3 -3
- data/bundler/lib/bundler/cli/lock.rb +32 -11
- data/bundler/lib/bundler/cli/outdated.rb +23 -23
- data/bundler/lib/bundler/cli/plugin.rb +3 -2
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +3 -3
- data/bundler/lib/bundler/cli/update.rb +3 -3
- data/bundler/lib/bundler/cli.rb +75 -145
- data/bundler/lib/bundler/compact_index_client/cache.rb +48 -73
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +6 -16
- data/bundler/lib/bundler/compact_index_client.rb +52 -85
- data/bundler/lib/bundler/constants.rb +8 -1
- data/bundler/lib/bundler/current_ruby.rb +48 -34
- data/bundler/lib/bundler/definition.rb +501 -328
- data/bundler/lib/bundler/dependency.rb +93 -47
- data/bundler/lib/bundler/dsl.rb +147 -103
- data/bundler/lib/bundler/endpoint_specification.rb +30 -3
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/environment_preserver.rb +5 -23
- data/bundler/lib/bundler/errors.rb +53 -5
- data/bundler/lib/bundler/feature_flag.rb +18 -18
- data/bundler/lib/bundler/fetcher/compact_index.rb +16 -25
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +34 -8
- data/bundler/lib/bundler/fetcher.rb +63 -26
- data/bundler/lib/bundler/force_platform.rb +0 -2
- data/bundler/lib/bundler/friendly_errors.rb +3 -2
- data/bundler/lib/bundler/gem_helper.rb +1 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +42 -40
- data/bundler/lib/bundler/index.rb +7 -2
- data/bundler/lib/bundler/injector.rb +14 -16
- data/bundler/lib/bundler/inline.rb +42 -17
- data/bundler/lib/bundler/installer/gem_installer.rb +4 -3
- data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
- data/bundler/lib/bundler/installer/standalone.rb +2 -5
- data/bundler/lib/bundler/installer.rb +22 -45
- data/bundler/lib/bundler/lazy_specification.rb +121 -48
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +36 -9
- data/bundler/lib/bundler/man/bundle-add.1 +44 -27
- data/bundler/lib/bundler/man/bundle-add.1.ronn +52 -23
- data/bundler/lib/bundler/man/bundle-binstubs.1 +9 -6
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-cache.1 +32 -4
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/bundler/lib/bundler/man/bundle-check.1 +7 -5
- data/bundler/lib/bundler/man/bundle-check.1.ronn +7 -2
- data/bundler/lib/bundler/man/bundle-clean.1 +3 -3
- data/bundler/lib/bundler/man/bundle-config.1 +180 -138
- data/bundler/lib/bundler/man/bundle-config.1.ronn +96 -99
- data/bundler/lib/bundler/man/bundle-console.1 +4 -6
- data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-doctor.1 +46 -7
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +49 -5
- data/bundler/lib/bundler/man/bundle-env.1 +9 -0
- data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +9 -6
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
- data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +69 -28
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +42 -6
- data/bundler/lib/bundler/man/bundle-help.1 +3 -3
- data/bundler/lib/bundler/man/bundle-info.1 +7 -4
- data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/bundler/lib/bundler/man/bundle-init.1 +5 -5
- data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/bundler/lib/bundler/man/bundle-inject.1 +13 -5
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +10 -2
- data/bundler/lib/bundler/man/bundle-install.1 +20 -17
- data/bundler/lib/bundler/man/bundle-install.1.ronn +26 -23
- data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
- data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
- data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-list.1 +3 -3
- data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +23 -8
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/bundler/lib/bundler/man/bundle-open.1 +4 -4
- data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +10 -7
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- data/bundler/lib/bundler/man/bundle-platform.1 +3 -3
- data/bundler/lib/bundler/man/bundle-plugin.1 +9 -6
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle-pristine.1 +3 -3
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +3 -3
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +7 -4
- data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/bundler/lib/bundler/man/bundle-update.1 +17 -11
- data/bundler/lib/bundler/man/bundle-update.1.ronn +17 -9
- data/bundler/lib/bundler/man/bundle-version.1 +3 -3
- data/bundler/lib/bundler/man/bundle-viz.1 +6 -6
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle.1 +3 -3
- data/bundler/lib/bundler/man/gemfile.5 +7 -5
- data/bundler/lib/bundler/man/gemfile.5.ronn +8 -2
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_platform.rb +31 -12
- data/bundler/lib/bundler/materialization.rb +59 -0
- data/bundler/lib/bundler/mirror.rb +3 -3
- data/bundler/lib/bundler/plugin/api/source.rb +5 -4
- data/bundler/lib/bundler/plugin/events.rb +24 -0
- data/bundler/lib/bundler/plugin/index.rb +5 -1
- data/bundler/lib/bundler/plugin/installer/path.rb +26 -0
- data/bundler/lib/bundler/plugin/installer.rb +37 -17
- data/bundler/lib/bundler/plugin/source_list.rb +4 -4
- data/bundler/lib/bundler/plugin.rb +21 -2
- data/bundler/lib/bundler/process_lock.rb +10 -14
- data/bundler/lib/bundler/remote_specification.rb +6 -1
- data/bundler/lib/bundler/resolver/base.rb +14 -3
- data/bundler/lib/bundler/resolver/candidate.rb +18 -27
- data/bundler/lib/bundler/resolver/package.rb +20 -3
- data/bundler/lib/bundler/resolver/spec_group.rb +22 -27
- data/bundler/lib/bundler/resolver/strategy.rb +40 -0
- data/bundler/lib/bundler/resolver.rb +114 -52
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/ruby_dsl.rb +12 -3
- data/bundler/lib/bundler/ruby_version.rb +7 -1
- data/bundler/lib/bundler/rubygems_ext.rb +303 -150
- data/bundler/lib/bundler/rubygems_gem_installer.rb +40 -5
- data/bundler/lib/bundler/rubygems_integration.rb +40 -73
- data/bundler/lib/bundler/runtime.rb +48 -35
- data/bundler/lib/bundler/self_manager.rb +36 -26
- data/bundler/lib/bundler/settings/validator.rb +0 -23
- data/bundler/lib/bundler/settings.rb +36 -27
- data/bundler/lib/bundler/setup.rb +6 -0
- data/bundler/lib/bundler/shared_helpers.rb +45 -25
- data/bundler/lib/bundler/source/gemspec.rb +1 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +26 -9
- data/bundler/lib/bundler/source/git.rb +113 -41
- data/bundler/lib/bundler/source/metadata.rb +4 -3
- data/bundler/lib/bundler/source/path.rb +14 -18
- data/bundler/lib/bundler/source/rubygems/remote.rb +12 -4
- data/bundler/lib/bundler/source/rubygems.rb +54 -48
- data/bundler/lib/bundler/source.rb +2 -0
- data/bundler/lib/bundler/source_list.rb +54 -12
- data/bundler/lib/bundler/source_map.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +227 -103
- data/bundler/lib/bundler/stub_specification.rb +29 -2
- data/bundler/lib/bundler/templates/Executable +0 -11
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -3
- data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -3
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +17 -15
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +14 -12
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/bundler/lib/bundler/ui/shell.rb +26 -4
- data/bundler/lib/bundler/ui/silent.rb +12 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +3 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +134 -57
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
- data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +43 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +28 -37
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -9
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/bundler/lib/bundler/vendored_net_http.rb +20 -5
- data/bundler/lib/bundler/vendored_securerandom.rb +12 -0
- data/bundler/lib/bundler/vendored_timeout.rb +7 -3
- data/bundler/lib/bundler/vendored_uri.rb +18 -1
- data/bundler/lib/bundler/version.rb +10 -2
- data/bundler/lib/bundler/worker.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +12 -7
- data/bundler/lib/bundler.rb +101 -61
- data/{bundler → doc/bundler}/UPGRADING.md +132 -127
- data/doc/rubygems/CONTRIBUTING.md +227 -0
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +86 -17
- data/exe/update_rubygems +1 -1
- data/lib/rubygems/basic_specification.rb +50 -10
- data/lib/rubygems/bundler_version_finder.rb +1 -1
- data/lib/rubygems/command.rb +1 -4
- data/lib/rubygems/command_manager.rb +5 -6
- data/lib/rubygems/commands/build_command.rb +2 -11
- data/lib/rubygems/commands/cleanup_command.rb +3 -13
- data/lib/rubygems/commands/contents_command.rb +17 -10
- data/lib/rubygems/commands/environment_command.rb +5 -0
- data/lib/rubygems/commands/exec_command.rb +18 -11
- data/lib/rubygems/commands/fetch_command.rb +14 -0
- data/lib/rubygems/commands/help_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +0 -4
- data/lib/rubygems/commands/pristine_command.rb +29 -19
- data/lib/rubygems/commands/push_command.rb +31 -6
- data/lib/rubygems/commands/rdoc_command.rb +3 -10
- data/lib/rubygems/commands/rebuild_command.rb +262 -0
- data/lib/rubygems/commands/setup_command.rb +13 -18
- data/lib/rubygems/commands/sources_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +9 -4
- data/lib/rubygems/commands/unpack_command.rb +0 -6
- data/lib/rubygems/commands/update_command.rb +13 -22
- data/lib/rubygems/config_file.rb +45 -16
- data/lib/rubygems/core_ext/kernel_require.rb +15 -3
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +7 -7
- data/lib/rubygems/dependency.rb +12 -16
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/deprecate.rb +79 -77
- data/lib/rubygems/errors.rb +2 -1
- data/lib/rubygems/exceptions.rb +2 -9
- data/lib/rubygems/ext/builder.rb +21 -8
- data/lib/rubygems/ext/cargo_builder.rb +16 -26
- data/lib/rubygems/ext/cmake_builder.rb +7 -2
- data/lib/rubygems/ext/configure_builder.rb +7 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
- data/lib/rubygems/ext/rake_builder.rb +7 -4
- data/lib/rubygems/gem_runner.rb +9 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +11 -4
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -1
- data/lib/rubygems/gemcutter_utilities.rb +52 -26
- data/lib/rubygems/gemspec_helpers.rb +19 -0
- data/lib/rubygems/install_update_options.rb +5 -0
- data/lib/rubygems/installer.rb +76 -90
- data/lib/rubygems/local_remote_options.rb +8 -8
- data/lib/rubygems/package/tar_header.rb +31 -4
- data/lib/rubygems/package/tar_reader/entry.rb +1 -5
- data/lib/rubygems/package/tar_writer.rb +5 -4
- data/lib/rubygems/package.rb +13 -8
- data/lib/rubygems/platform.rb +148 -43
- data/lib/rubygems/psych_tree.rb +4 -0
- data/lib/rubygems/query_utils.rb +2 -2
- data/lib/rubygems/rdoc.rb +16 -3
- data/lib/rubygems/remote_fetcher.rb +6 -7
- data/lib/rubygems/request.rb +5 -5
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set.rb +4 -7
- data/lib/rubygems/requirement.rb +16 -12
- data/lib/rubygems/resolver/activation_request.rb +1 -1
- data/lib/rubygems/resolver/api_set/gem_parser.rb +2 -5
- data/lib/rubygems/resolver/api_set.rb +13 -8
- data/lib/rubygems/resolver/best_set.rb +1 -29
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/git_set.rb +0 -1
- data/lib/rubygems/resolver/index_set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +1 -1
- data/lib/rubygems/resolver/spec_specification.rb +7 -0
- data/lib/rubygems/resolver.rb +8 -8
- data/lib/rubygems/s3_uri_signer.rb +8 -6
- data/lib/rubygems/safe_marshal/reader.rb +31 -14
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +29 -16
- data/lib/rubygems/safe_yaml.rb +10 -1
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/source/git.rb +22 -17
- data/lib/rubygems/source/installed.rb +3 -1
- data/lib/rubygems/source/local.rb +8 -4
- data/lib/rubygems/source/specific_file.rb +5 -3
- data/lib/rubygems/source.rb +37 -29
- data/lib/rubygems/source_list.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +47 -15
- data/lib/rubygems/specification.rb +110 -183
- data/lib/rubygems/specification_policy.rb +33 -13
- data/lib/rubygems/specification_record.rb +212 -0
- data/lib/rubygems/stub_specification.rb +32 -10
- data/lib/rubygems/target_rbconfig.rb +50 -0
- data/lib/rubygems/uninstaller.rb +42 -22
- data/lib/rubygems/uri.rb +6 -6
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/util/licenses.rb +118 -1
- data/lib/rubygems/util.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/ui.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolution.rb +4 -4
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolver.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/state.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo.rb +2 -2
- data/lib/rubygems/vendor/net-http/COPYING +56 -0
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/generic_request.rb +9 -9
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/header.rb +3 -3
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/request.rb +3 -3
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/requests.rb +35 -30
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/response.rb +2 -2
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/responses.rb +6 -6
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/status.rb +1 -1
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http.rb +149 -70
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/https.rb +1 -1
- data/lib/rubygems/vendor/optparse/COPYING +56 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +16 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +8 -3
- data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +9 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +158 -62
- data/lib/rubygems/vendor/resolv/COPYING +56 -0
- data/lib/rubygems/{resolv → vendor/resolv}/lib/resolv.rb +165 -69
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +10 -11
- data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
- data/lib/rubygems/vendor/uri/COPYING +56 -0
- data/lib/rubygems/vendor/uri/lib/uri/common.rb +880 -0
- data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
- data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1579 -0
- data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
- data/lib/rubygems/vendored_molinillo.rb +3 -0
- data/lib/rubygems/vendored_net_http.rb +5 -0
- data/lib/rubygems/vendored_optparse.rb +3 -0
- data/lib/rubygems/vendored_securerandom.rb +3 -0
- data/lib/rubygems/vendored_timeout.rb +5 -0
- data/lib/rubygems/vendored_tsort.rb +3 -0
- data/lib/rubygems/version.rb +26 -9
- data/lib/rubygems/yaml_serializer.rb +12 -7
- data/lib/rubygems.rb +160 -53
- data/rubygems-update.gemspec +11 -6
- data/setup.rb +1 -1
- metadata +124 -96
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +0 -32
- data/bundler/lib/bundler/gem_helpers.rb +0 -127
- data/bundler/lib/bundler/templates/Executable.bundler +0 -109
- data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
- data/bundler/lib/bundler/vendor/thor/.document +0 -1
- data/bundler/lib/bundler/vendor/tsort/.document +0 -1
- data/bundler/lib/bundler/vendor/uri/.document +0 -1
- data/lib/rubygems/net/http.rb +0 -3
- data/lib/rubygems/net-http/.document +0 -1
- data/lib/rubygems/net-http/LICENSE.txt +0 -22
- data/lib/rubygems/net-http/lib/net/http/backward.rb +0 -40
- data/lib/rubygems/net-protocol/.document +0 -1
- data/lib/rubygems/net-protocol/LICENSE.txt +0 -22
- data/lib/rubygems/optparse/.document +0 -1
- data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
- data/lib/rubygems/optparse.rb +0 -3
- data/lib/rubygems/resolv/.document +0 -1
- data/lib/rubygems/resolv/LICENSE.txt +0 -22
- data/lib/rubygems/resolver/molinillo/.document +0 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/rubygems/resolver/molinillo.rb +0 -3
- data/lib/rubygems/shellwords.rb +0 -3
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/rubygems/timeout/.document +0 -1
- data/lib/rubygems/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/timeout.rb +0 -3
- data/lib/rubygems/tsort/.document +0 -1
- data/lib/rubygems/tsort/LICENSE.txt +0 -22
- data/lib/rubygems/tsort.rb +0 -3
- /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/fileutils}/COPYING +0 -0
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
- /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
- /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
- /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
- /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/exceptions.rb +0 -0
- /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/proxy_delta.rb +0 -0
- /data/{bundler/lib/bundler/vendor/fileutils → lib/rubygems/vendor/net-protocol}/LICENSE.txt +0 -0
- /data/lib/rubygems/{net-protocol → vendor/net-protocol}/lib/net/protocol.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
- /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
@@ -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
|
@@ -211,6 +211,17 @@ class Bundler::Thor::Group
|
|
211
211
|
raise error, msg
|
212
212
|
end
|
213
213
|
|
214
|
+
# Checks if a specified command exists.
|
215
|
+
#
|
216
|
+
# ==== Parameters
|
217
|
+
# command_name<String>:: The name of the command to check for existence.
|
218
|
+
#
|
219
|
+
# ==== Returns
|
220
|
+
# Boolean:: +true+ if the command exists, +false+ otherwise.
|
221
|
+
def command_exists?(command_name) #:nodoc:
|
222
|
+
commands.keys.include?(command_name)
|
223
|
+
end
|
224
|
+
|
214
225
|
protected
|
215
226
|
|
216
227
|
# The method responsible for dispatching given the args.
|
@@ -89,8 +89,8 @@ class Bundler::Thor
|
|
89
89
|
|
90
90
|
sample = "[#{sample}]".dup unless required?
|
91
91
|
|
92
|
-
if boolean?
|
93
|
-
sample << ", [#{dasherize('no-' + human_name)}]
|
92
|
+
if boolean? && name != "force" && !name.match(/\A(no|skip)[\-_]/)
|
93
|
+
sample << ", [#{dasherize('no-' + human_name)}], [#{dasherize('skip-' + human_name)}]"
|
94
94
|
end
|
95
95
|
|
96
96
|
aliases_for_usage.ljust(padding) + sample
|
@@ -250,7 +250,8 @@ class Bundler::Thor
|
|
250
250
|
@parsing_options
|
251
251
|
end
|
252
252
|
|
253
|
-
# Parse boolean values which can be given as --foo=true
|
253
|
+
# Parse boolean values which can be given as --foo=true or --foo for true values, or
|
254
|
+
# --foo=false, --no-foo or --skip-foo for false values.
|
254
255
|
#
|
255
256
|
def parse_boolean(switch)
|
256
257
|
if current_is_value?
|
@@ -67,15 +67,15 @@ class Bundler::Thor
|
|
67
67
|
# Readline.
|
68
68
|
#
|
69
69
|
# ==== Example
|
70
|
-
#
|
70
|
+
# ask("What is your name?")
|
71
71
|
#
|
72
|
-
#
|
72
|
+
# ask("What is the planet furthest from the sun?", :default => "Neptune")
|
73
73
|
#
|
74
|
-
#
|
74
|
+
# ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
|
75
75
|
#
|
76
|
-
#
|
76
|
+
# ask("What is your password?", :echo => false)
|
77
77
|
#
|
78
|
-
#
|
78
|
+
# ask("Where should the file be saved?", :path => true)
|
79
79
|
#
|
80
80
|
def ask(statement, *args)
|
81
81
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
@@ -93,7 +93,7 @@ class Bundler::Thor
|
|
93
93
|
# are passed straight to puts (behavior got from Highline).
|
94
94
|
#
|
95
95
|
# ==== Example
|
96
|
-
#
|
96
|
+
# say("I know you knew that.")
|
97
97
|
#
|
98
98
|
def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
99
99
|
return if quiet?
|
@@ -110,7 +110,7 @@ class Bundler::Thor
|
|
110
110
|
# are passed straight to puts (behavior got from Highline).
|
111
111
|
#
|
112
112
|
# ==== Example
|
113
|
-
#
|
113
|
+
# say_error("error: something went wrong")
|
114
114
|
#
|
115
115
|
def say_error(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
116
116
|
return if quiet?
|
@@ -143,14 +143,14 @@ class Bundler::Thor
|
|
143
143
|
stdout.flush
|
144
144
|
end
|
145
145
|
|
146
|
-
#
|
146
|
+
# Asks the user a question and returns true if the user replies "y" or
|
147
147
|
# "yes".
|
148
148
|
#
|
149
149
|
def yes?(statement, color = nil)
|
150
150
|
!!(ask(statement, color, add_to_history: false) =~ is?(:yes))
|
151
151
|
end
|
152
152
|
|
153
|
-
#
|
153
|
+
# Asks the user a question and returns true if the user replies "n" or
|
154
154
|
# "no".
|
155
155
|
#
|
156
156
|
def no?(statement, color = nil)
|
@@ -102,33 +102,17 @@ class Bundler::Thor
|
|
102
102
|
|
103
103
|
def truncate(string)
|
104
104
|
return string unless @truncate
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
chars[0, @truncate - 3 - @indent].join + "..."
|
111
|
-
end
|
105
|
+
chars = string.chars.to_a
|
106
|
+
if chars.length <= @truncate
|
107
|
+
chars.join
|
108
|
+
else
|
109
|
+
chars[0, @truncate - 3 - @indent].join + "..."
|
112
110
|
end
|
113
111
|
end
|
114
112
|
|
115
113
|
def indentation
|
116
114
|
" " * @indent
|
117
115
|
end
|
118
|
-
|
119
|
-
if "".respond_to?(:encode)
|
120
|
-
def as_unicode
|
121
|
-
yield
|
122
|
-
end
|
123
|
-
else
|
124
|
-
def as_unicode
|
125
|
-
old = $KCODE # rubocop:disable Style/GlobalVars
|
126
|
-
$KCODE = "U" # rubocop:disable Style/GlobalVars
|
127
|
-
yield
|
128
|
-
ensure
|
129
|
-
$KCODE = old # rubocop:disable Style/GlobalVars
|
130
|
-
end
|
131
|
-
end
|
132
116
|
end
|
133
117
|
end
|
134
118
|
end
|
@@ -133,7 +133,7 @@ class Bundler::Thor
|
|
133
133
|
*pieces, command = namespace.split(":")
|
134
134
|
namespace = pieces.join(":")
|
135
135
|
namespace = "default" if namespace.empty?
|
136
|
-
klass = Bundler::Thor::Base.subclasses.detect { |thor| thor.namespace == namespace && thor.
|
136
|
+
klass = Bundler::Thor::Base.subclasses.detect { |thor| thor.namespace == namespace && thor.command_exists?(command) }
|
137
137
|
end
|
138
138
|
unless klass # look for a Bundler::Thor::Group with the right name
|
139
139
|
klass = Bundler::Thor::Util.find_by_namespace(namespace)
|
@@ -439,6 +439,17 @@ class Bundler::Thor
|
|
439
439
|
command && disable_required_check.include?(command.name.to_sym)
|
440
440
|
end
|
441
441
|
|
442
|
+
# Checks if a specified command exists.
|
443
|
+
#
|
444
|
+
# ==== Parameters
|
445
|
+
# command_name<String>:: The name of the command to check for existence.
|
446
|
+
#
|
447
|
+
# ==== Returns
|
448
|
+
# Boolean:: +true+ if the command exists, +false+ otherwise.
|
449
|
+
def command_exists?(command_name) #:nodoc:
|
450
|
+
commands.keys.include?(normalize_command_name(command_name))
|
451
|
+
end
|
452
|
+
|
442
453
|
protected
|
443
454
|
|
444
455
|
# Returns this class exclusive options array set.
|
@@ -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.
|
@@ -13,24 +13,51 @@ require_relative "rfc2396_parser"
|
|
13
13
|
require_relative "rfc3986_parser"
|
14
14
|
|
15
15
|
module Bundler::URI
|
16
|
-
|
16
|
+
# The default parser instance for RFC 2396.
|
17
|
+
RFC2396_PARSER = RFC2396_Parser.new
|
18
|
+
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
|
17
19
|
|
18
|
-
|
19
|
-
Parser = RFC2396_Parser
|
20
|
+
# The default parser instance for RFC 3986.
|
20
21
|
RFC3986_PARSER = RFC3986_Parser.new
|
21
22
|
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
|
22
23
|
|
23
|
-
#
|
24
|
-
DEFAULT_PARSER =
|
25
|
-
DEFAULT_PARSER
|
26
|
-
|
27
|
-
|
24
|
+
# The default parser instance.
|
25
|
+
DEFAULT_PARSER = RFC3986_PARSER
|
26
|
+
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
27
|
+
|
28
|
+
# Set the default parser instance.
|
29
|
+
def self.parser=(parser = RFC3986_PARSER)
|
30
|
+
remove_const(:Parser) if defined?(::Bundler::URI::Parser)
|
31
|
+
const_set("Parser", parser.class)
|
32
|
+
|
33
|
+
remove_const(:REGEXP) if defined?(::Bundler::URI::REGEXP)
|
34
|
+
remove_const(:PATTERN) if defined?(::Bundler::URI::PATTERN)
|
35
|
+
if Parser == RFC2396_Parser
|
36
|
+
const_set("REGEXP", Bundler::URI::RFC2396_REGEXP)
|
37
|
+
const_set("PATTERN", Bundler::URI::RFC2396_REGEXP::PATTERN)
|
38
|
+
end
|
39
|
+
|
40
|
+
Parser.new.regexp.each_pair do |sym, str|
|
41
|
+
remove_const(sym) if const_defined?(sym, false)
|
42
|
+
const_set(sym, str)
|
28
43
|
end
|
29
44
|
end
|
30
|
-
|
31
|
-
|
45
|
+
self.parser = RFC3986_PARSER
|
46
|
+
|
47
|
+
def self.const_missing(const) # :nodoc:
|
48
|
+
if const == :REGEXP
|
49
|
+
warn "Bundler::URI::REGEXP is obsolete. Use Bundler::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
|
50
|
+
Bundler::URI::RFC2396_REGEXP
|
51
|
+
elsif value = RFC2396_PARSER.regexp[const]
|
52
|
+
warn "Bundler::URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
|
53
|
+
value
|
54
|
+
elsif value = RFC2396_Parser.const_get(const)
|
55
|
+
warn "Bundler::URI::#{const} is obsolete. Use RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
|
56
|
+
value
|
57
|
+
else
|
58
|
+
super
|
59
|
+
end
|
32
60
|
end
|
33
|
-
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
34
61
|
|
35
62
|
module Util # :nodoc:
|
36
63
|
def make_components_hash(klass, array_hash)
|
@@ -64,7 +91,7 @@ module Bundler::URI
|
|
64
91
|
module_function :make_components_hash
|
65
92
|
end
|
66
93
|
|
67
|
-
module Schemes
|
94
|
+
module Schemes # :nodoc:
|
68
95
|
end
|
69
96
|
private_constant :Schemes
|
70
97
|
|
@@ -168,7 +195,7 @@ module Bundler::URI
|
|
168
195
|
# ["fragment", "top"]]
|
169
196
|
#
|
170
197
|
def self.split(uri)
|
171
|
-
|
198
|
+
DEFAULT_PARSER.split(uri)
|
172
199
|
end
|
173
200
|
|
174
201
|
# Returns a new \Bundler::URI object constructed from the given string +uri+:
|
@@ -182,7 +209,7 @@ module Bundler::URI
|
|
182
209
|
# if it may contain invalid Bundler::URI characters.
|
183
210
|
#
|
184
211
|
def self.parse(uri)
|
185
|
-
|
212
|
+
DEFAULT_PARSER.parse(uri)
|
186
213
|
end
|
187
214
|
|
188
215
|
# Merges the given Bundler::URI strings +str+
|
@@ -209,7 +236,7 @@ module Bundler::URI
|
|
209
236
|
# # => #<Bundler::URI::HTTP http://example.com/foo/bar>
|
210
237
|
#
|
211
238
|
def self.join(*str)
|
212
|
-
|
239
|
+
DEFAULT_PARSER.join(*str)
|
213
240
|
end
|
214
241
|
|
215
242
|
#
|
@@ -282,7 +309,7 @@ module Bundler::URI
|
|
282
309
|
256.times do |i|
|
283
310
|
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
|
284
311
|
end
|
285
|
-
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
|
312
|
+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
|
286
313
|
TBLENCWWWCOMP_[' '] = '+'
|
287
314
|
TBLENCWWWCOMP_.freeze
|
288
315
|
TBLDECWWWCOMP_ = {} # :nodoc:
|
@@ -70,17 +70,17 @@ module Bundler::URI
|
|
70
70
|
|
71
71
|
# raise InvalidURIError
|
72
72
|
def check_userinfo(user)
|
73
|
-
raise Bundler::URI::InvalidURIError, "
|
73
|
+
raise Bundler::URI::InvalidURIError, "cannot set userinfo for file Bundler::URI"
|
74
74
|
end
|
75
75
|
|
76
76
|
# raise InvalidURIError
|
77
77
|
def check_user(user)
|
78
|
-
raise Bundler::URI::InvalidURIError, "
|
78
|
+
raise Bundler::URI::InvalidURIError, "cannot set user for file Bundler::URI"
|
79
79
|
end
|
80
80
|
|
81
81
|
# raise InvalidURIError
|
82
82
|
def check_password(user)
|
83
|
-
raise Bundler::URI::InvalidURIError, "
|
83
|
+
raise Bundler::URI::InvalidURIError, "cannot set password for file Bundler::URI"
|
84
84
|
end
|
85
85
|
|
86
86
|
# do nothing
|
@@ -17,7 +17,7 @@ module Bundler::URI
|
|
17
17
|
# This class will be redesigned because of difference of implementations;
|
18
18
|
# the structure of its path. draft-hoffman-ftp-uri-04 is a draft but it
|
19
19
|
# is a good summary about the de facto spec.
|
20
|
-
#
|
20
|
+
# https://datatracker.ietf.org/doc/html/draft-hoffman-ftp-uri-04
|
21
21
|
#
|
22
22
|
class FTP < Generic
|
23
23
|
# A Default port of 21 for Bundler::URI::FTP.
|