rubygems-update 2.6.3 → 2.7.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.travis.yml +17 -34
- data/CODE_OF_CONDUCT.md +36 -33
- data/CONTRIBUTING.rdoc +56 -55
- data/History.txt +467 -10
- data/Manifest.txt +276 -4
- data/POLICIES.rdoc +4 -4
- data/README.md +72 -0
- data/Rakefile +77 -10
- data/appveyor.yml +61 -31
- data/bin/gem +1 -1
- data/bin/update_rubygems +2 -2
- data/bundler/CHANGELOG.md +2910 -0
- data/bundler/CODE_OF_CONDUCT.md +42 -0
- data/bundler/CONTRIBUTING.md +17 -0
- data/bundler/LICENSE.md +23 -0
- data/bundler/README.md +63 -0
- data/bundler/bundler.gemspec +57 -0
- data/bundler/exe/bundle +31 -0
- data/bundler/exe/bundle_ruby +60 -0
- data/bundler/exe/bundler +4 -0
- data/bundler/lib/bundler/build_metadata.rb +36 -0
- data/bundler/lib/bundler/capistrano.rb +22 -0
- data/bundler/lib/bundler/cli/add.rb +25 -0
- data/bundler/lib/bundler/cli/binstubs.rb +43 -0
- data/bundler/lib/bundler/cli/cache.rb +36 -0
- data/bundler/lib/bundler/cli/check.rb +38 -0
- data/bundler/lib/bundler/cli/clean.rb +25 -0
- data/bundler/lib/bundler/cli/common.rb +102 -0
- data/bundler/lib/bundler/cli/config.rb +119 -0
- data/bundler/lib/bundler/cli/console.rb +43 -0
- data/bundler/lib/bundler/cli/doctor.rb +94 -0
- data/bundler/lib/bundler/cli/exec.rb +104 -0
- data/bundler/lib/bundler/cli/gem.rb +252 -0
- data/bundler/lib/bundler/cli/info.rb +50 -0
- data/bundler/lib/bundler/cli/init.rb +47 -0
- data/bundler/lib/bundler/cli/inject.rb +60 -0
- data/bundler/lib/bundler/cli/install.rb +214 -0
- data/bundler/lib/bundler/cli/issue.rb +40 -0
- data/bundler/lib/bundler/cli/list.rb +22 -0
- data/bundler/lib/bundler/cli/lock.rb +63 -0
- data/bundler/lib/bundler/cli/open.rb +26 -0
- data/bundler/lib/bundler/cli/outdated.rb +260 -0
- data/bundler/lib/bundler/cli/package.rb +49 -0
- data/bundler/lib/bundler/cli/platform.rb +46 -0
- data/bundler/lib/bundler/cli/plugin.rb +24 -0
- data/bundler/lib/bundler/cli/pristine.rb +43 -0
- data/bundler/lib/bundler/cli/show.rb +75 -0
- data/bundler/lib/bundler/cli/update.rb +91 -0
- data/bundler/lib/bundler/cli/viz.rb +31 -0
- data/bundler/lib/bundler/cli.rb +748 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +118 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +116 -0
- data/bundler/lib/bundler/compact_index_client.rb +109 -0
- data/bundler/lib/bundler/compatibility_guard.rb +14 -0
- data/bundler/lib/bundler/constants.rb +7 -0
- data/bundler/lib/bundler/current_ruby.rb +86 -0
- data/bundler/lib/bundler/definition.rb +989 -0
- data/bundler/lib/bundler/dep_proxy.rb +48 -0
- data/bundler/lib/bundler/dependency.rb +138 -0
- data/bundler/lib/bundler/deployment.rb +69 -0
- data/bundler/lib/bundler/deprecate.rb +43 -0
- data/bundler/lib/bundler/dsl.rb +599 -0
- data/bundler/lib/bundler/endpoint_specification.rb +141 -0
- data/bundler/lib/bundler/env.rb +153 -0
- data/bundler/lib/bundler/environment_preserver.rb +59 -0
- data/bundler/lib/bundler/errors.rb +158 -0
- data/bundler/lib/bundler/feature_flag.rb +67 -0
- data/bundler/lib/bundler/fetcher/base.rb +52 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +126 -0
- data/bundler/lib/bundler/fetcher/dependency.rb +82 -0
- data/bundler/lib/bundler/fetcher/downloader.rb +79 -0
- data/bundler/lib/bundler/fetcher/index.rb +52 -0
- data/bundler/lib/bundler/fetcher.rb +312 -0
- data/bundler/lib/bundler/friendly_errors.rb +131 -0
- data/bundler/lib/bundler/gem_helper.rb +202 -0
- data/bundler/lib/bundler/gem_helpers.rb +101 -0
- data/bundler/lib/bundler/gem_remote_fetcher.rb +43 -0
- data/bundler/lib/bundler/gem_tasks.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +176 -0
- data/bundler/lib/bundler/gemdeps.rb +29 -0
- data/bundler/lib/bundler/graph.rb +152 -0
- data/bundler/lib/bundler/index.rb +213 -0
- data/bundler/lib/bundler/injector.rb +94 -0
- data/bundler/lib/bundler/inline.rb +74 -0
- data/bundler/lib/bundler/installer/gem_installer.rb +83 -0
- data/bundler/lib/bundler/installer/parallel_installer.rb +228 -0
- data/bundler/lib/bundler/installer/standalone.rb +53 -0
- data/bundler/lib/bundler/installer.rb +295 -0
- data/bundler/lib/bundler/lazy_specification.rb +123 -0
- data/bundler/lib/bundler/lockfile_generator.rb +95 -0
- data/bundler/lib/bundler/lockfile_parser.rb +256 -0
- data/bundler/lib/bundler/match_platform.rb +24 -0
- data/bundler/lib/bundler/mirror.rb +223 -0
- data/bundler/lib/bundler/plugin/api/source.rb +306 -0
- data/bundler/lib/bundler/plugin/api.rb +81 -0
- data/bundler/lib/bundler/plugin/dsl.rb +53 -0
- data/bundler/lib/bundler/plugin/index.rb +162 -0
- data/bundler/lib/bundler/plugin/installer/git.rb +38 -0
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/bundler/lib/bundler/plugin/installer.rb +96 -0
- data/bundler/lib/bundler/plugin/source_list.rb +27 -0
- data/bundler/lib/bundler/plugin.rb +285 -0
- data/bundler/lib/bundler/process_lock.rb +24 -0
- data/bundler/lib/bundler/psyched_yaml.rb +37 -0
- data/bundler/lib/bundler/remote_specification.rb +114 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +110 -0
- data/bundler/lib/bundler/resolver.rb +372 -0
- data/bundler/lib/bundler/retry.rb +66 -0
- data/bundler/lib/bundler/ruby_dsl.rb +18 -0
- data/bundler/lib/bundler/ruby_version.rb +152 -0
- data/bundler/lib/bundler/rubygems_ext.rb +210 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +99 -0
- data/bundler/lib/bundler/rubygems_integration.rb +898 -0
- data/bundler/lib/bundler/runtime.rb +316 -0
- data/bundler/lib/bundler/settings/validator.rb +79 -0
- data/bundler/lib/bundler/settings.rb +442 -0
- data/bundler/lib/bundler/setup.rb +28 -0
- data/bundler/lib/bundler/shared_helpers.rb +356 -0
- data/bundler/lib/bundler/similarity_detector.rb +63 -0
- data/bundler/lib/bundler/source/gemspec.rb +18 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +262 -0
- data/bundler/lib/bundler/source/git.rb +329 -0
- data/bundler/lib/bundler/source/metadata.rb +63 -0
- data/bundler/lib/bundler/source/path/installer.rb +74 -0
- data/bundler/lib/bundler/source/path.rb +249 -0
- data/bundler/lib/bundler/source/rubygems/remote.rb +66 -0
- data/bundler/lib/bundler/source/rubygems.rb +535 -0
- data/bundler/lib/bundler/source.rb +94 -0
- data/bundler/lib/bundler/source_list.rb +186 -0
- data/bundler/lib/bundler/spec_set.rb +192 -0
- data/bundler/lib/bundler/ssl_certs/.document +1 -0
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +66 -0
- data/bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/bundler/lib/bundler/stub_specification.rb +108 -0
- data/bundler/lib/bundler/templates/.document +1 -0
- data/bundler/lib/bundler/templates/Executable +29 -0
- data/bundler/lib/bundler/templates/Executable.bundler +105 -0
- data/bundler/lib/bundler/templates/Executable.standalone +14 -0
- data/bundler/lib/bundler/templates/Gemfile +7 -0
- data/bundler/lib/bundler/templates/gems.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +74 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +47 -0
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +29 -0
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +20 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +51 -0
- data/bundler/lib/bundler/templates/newgem/rspec.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +5 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
- data/bundler/lib/bundler/ui/shell.rb +146 -0
- data/bundler/lib/bundler/ui/silent.rb +69 -0
- data/bundler/lib/bundler/ui.rb +9 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +37 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +126 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +223 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +138 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +101 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +67 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +837 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +46 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +58 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +12 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +27 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +129 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1233 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +104 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +60 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +364 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +109 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +321 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +679 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +135 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +97 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +12 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +129 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +177 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +70 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +146 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +221 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +324 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +437 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +268 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +509 -0
- data/bundler/lib/bundler/vendored_fileutils.rb +9 -0
- data/bundler/lib/bundler/vendored_molinillo.rb +4 -0
- data/bundler/lib/bundler/vendored_persistent.rb +52 -0
- data/bundler/lib/bundler/vendored_thor.rb +8 -0
- data/bundler/lib/bundler/version.rb +28 -0
- data/bundler/lib/bundler/version_ranges.rb +76 -0
- data/bundler/lib/bundler/vlad.rb +17 -0
- data/bundler/lib/bundler/worker.rb +106 -0
- data/bundler/lib/bundler/yaml_serializer.rb +90 -0
- data/bundler/lib/bundler.rb +545 -0
- data/bundler/man/bundle-add.ronn +29 -0
- data/bundler/man/bundle-binstubs.ronn +43 -0
- data/bundler/man/bundle-check.ronn +26 -0
- data/bundler/man/bundle-clean.ronn +18 -0
- data/bundler/man/bundle-config.ronn +376 -0
- data/bundler/man/bundle-doctor.ronn +33 -0
- data/bundler/man/bundle-exec.ronn +152 -0
- data/bundler/man/bundle-gem.ronn +78 -0
- data/bundler/man/bundle-info.ronn +17 -0
- data/bundler/man/bundle-init.ronn +29 -0
- data/bundler/man/bundle-inject.ronn +22 -0
- data/bundler/man/bundle-install.ronn +369 -0
- data/bundler/man/bundle-list.ronn +15 -0
- data/bundler/man/bundle-lock.ronn +94 -0
- data/bundler/man/bundle-open.ronn +19 -0
- data/bundler/man/bundle-outdated.ronn +107 -0
- data/bundler/man/bundle-package.ronn +72 -0
- data/bundler/man/bundle-platform.ronn +42 -0
- data/bundler/man/bundle-pristine.ronn +34 -0
- data/bundler/man/bundle-show.ronn +20 -0
- data/bundler/man/bundle-update.ronn +346 -0
- data/bundler/man/bundle-viz.ronn +30 -0
- data/bundler/man/bundle.ronn +108 -0
- data/bundler/man/gemfile.5.ronn +506 -0
- data/lib/rubygems/basic_specification.rb +8 -4
- data/lib/rubygems/bundler_version_finder.rb +116 -0
- data/lib/rubygems/command.rb +10 -2
- data/lib/rubygems/command_manager.rb +3 -1
- data/lib/rubygems/commands/cert_command.rb +31 -6
- data/lib/rubygems/commands/cleanup_command.rb +10 -3
- data/lib/rubygems/commands/generate_index_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +4 -2
- data/lib/rubygems/commands/pristine_command.rb +11 -8
- data/lib/rubygems/commands/push_command.rb +3 -2
- data/lib/rubygems/commands/query_command.rb +17 -17
- data/lib/rubygems/commands/setup_command.rb +175 -70
- data/lib/rubygems/commands/signin_command.rb +33 -0
- data/lib/rubygems/commands/signout_command.rb +33 -0
- data/lib/rubygems/commands/sources_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +4 -3
- data/lib/rubygems/commands/unpack_command.rb +19 -7
- data/lib/rubygems/commands/update_command.rb +2 -2
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +4 -11
- data/lib/rubygems/config_file.rb +21 -28
- data/lib/rubygems/core_ext/kernel_require.rb +10 -9
- data/lib/rubygems/defaults.rb +18 -0
- data/lib/rubygems/dependency.rb +10 -4
- data/lib/rubygems/dependency_installer.rb +8 -2
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/errors.rb +4 -0
- data/lib/rubygems/exceptions.rb +11 -1
- data/lib/rubygems/ext/builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +7 -7
- data/lib/rubygems/ext/rake_builder.rb +2 -2
- data/lib/rubygems/gem_runner.rb +5 -1
- data/lib/rubygems/indexer.rb +6 -5
- data/lib/rubygems/install_update_options.rb +5 -28
- data/lib/rubygems/installer.rb +53 -22
- data/lib/rubygems/installer_test_case.rb +6 -3
- data/lib/rubygems/package/file_source.rb +2 -2
- data/lib/rubygems/package/old.rb +3 -3
- data/lib/rubygems/package/tar_header.rb +14 -9
- data/lib/rubygems/package/tar_writer.rb +12 -16
- data/lib/rubygems/package.rb +48 -9
- data/lib/rubygems/platform.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +13 -18
- data/lib/rubygems/request.rb +47 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +1 -1
- data/lib/rubygems/request_set.rb +22 -3
- data/lib/rubygems/requirement.rb +5 -1
- data/lib/rubygems/resolver/installer_set.rb +4 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +65 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +60 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +125 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +125 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +78 -147
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +110 -75
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +4 -2
- data/lib/rubygems/resolver/set.rb +1 -1
- data/lib/rubygems/resolver.rb +61 -5
- data/lib/rubygems/safe_yaml.rb +51 -0
- data/lib/rubygems/security/signer.rb +2 -0
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/security.rb +12 -5
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/server.rb +49 -40
- data/lib/rubygems/source/git.rb +2 -1
- data/lib/rubygems/source/local.rb +38 -35
- data/lib/rubygems/source/lock.rb +4 -1
- data/lib/rubygems/source.rb +9 -6
- data/lib/rubygems/source_local.rb +3 -1
- data/lib/rubygems/source_specific_file.rb +3 -2
- data/lib/rubygems/spec_fetcher.rb +7 -3
- data/lib/rubygems/specification.rb +317 -251
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/stub_specification.rb +10 -4
- data/lib/rubygems/test_case.rb +51 -11
- data/lib/rubygems/test_utilities.rb +2 -2
- data/lib/rubygems/text.rb +14 -1
- data/lib/rubygems/user_interaction.rb +22 -20
- data/lib/rubygems/util/licenses.rb +37 -0
- data/lib/rubygems/util.rb +6 -16
- data/lib/rubygems/validator.rb +3 -3
- data/lib/rubygems/version.rb +24 -5
- data/lib/rubygems/version_option.rb +6 -1
- data/lib/rubygems.rb +147 -45
- data/lib/ubygems.rb +3 -0
- data/setup.rb +1 -1
- data/test/rubygems/alternate_cert.pem +10 -9
- data/test/rubygems/alternate_cert_32.pem +10 -9
- data/test/rubygems/child_cert.pem +11 -9
- data/test/rubygems/child_cert_32.pem +11 -9
- data/test/rubygems/encrypted_private_key.pem +26 -26
- data/test/rubygems/expired_cert.pem +9 -8
- data/test/rubygems/future_cert.pem +9 -8
- data/test/rubygems/future_cert_32.pem +9 -8
- data/test/rubygems/grandchild_cert.pem +11 -9
- data/test/rubygems/grandchild_cert_32.pem +11 -9
- data/test/rubygems/invalid_issuer_cert.pem +11 -9
- data/test/rubygems/invalid_issuer_cert_32.pem +11 -9
- data/test/rubygems/invalid_signer_cert.pem +10 -9
- data/test/rubygems/invalid_signer_cert_32.pem +10 -9
- data/test/rubygems/invalidchild_cert.pem +11 -9
- data/test/rubygems/invalidchild_cert_32.pem +11 -9
- data/test/rubygems/private3072_key.pem +40 -0
- data/test/rubygems/public3072_cert.pem +25 -0
- data/test/rubygems/public_cert.pem +11 -9
- data/test/rubygems/public_cert_32.pem +10 -9
- data/test/rubygems/rubygems_plugin.rb +4 -0
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +1 -1
- data/test/rubygems/test_gem.rb +168 -55
- data/test/rubygems/test_gem_bundler_version_finder.rb +125 -0
- data/test/rubygems/test_gem_command.rb +7 -1
- data/test/rubygems/test_gem_commands_build_command.rb +27 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
- data/test/rubygems/test_gem_commands_cleanup_command.rb +44 -1
- data/test/rubygems/test_gem_commands_install_command.rb +36 -2
- data/test/rubygems/test_gem_commands_open_command.rb +2 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +25 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
- data/test/rubygems/test_gem_commands_push_command.rb +5 -5
- data/test/rubygems/test_gem_commands_query_command.rb +154 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +140 -10
- data/test/rubygems/test_gem_commands_signin_command.rb +98 -0
- data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +52 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +14 -2
- data/test/rubygems/test_gem_commands_update_command.rb +1 -7
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_config_file.rb +1 -2
- data/test/rubygems/test_gem_dependency.rb +28 -0
- data/test/rubygems/test_gem_dependency_installer.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +8 -8
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +23 -0
- data/test/rubygems/test_gem_ext_rake_builder.rb +33 -16
- data/test/rubygems/test_gem_gemcutter_utilities.rb +4 -4
- data/test/rubygems/test_gem_indexer.rb +1 -2
- data/test/rubygems/test_gem_install_update_options.rb +4 -1
- data/test/rubygems/test_gem_installer.rb +230 -32
- data/test/rubygems/test_gem_package.rb +156 -29
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +21 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +24 -0
- data/test/rubygems/test_gem_rdoc.rb +2 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +38 -19
- data/test/rubygems/test_gem_request.rb +132 -0
- data/test/rubygems/test_gem_request_connection_pools.rb +6 -7
- data/test/rubygems/test_gem_request_set.rb +7 -7
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +6 -0
- data/test/rubygems/test_gem_resolver.rb +29 -3
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
- data/test/rubygems/test_gem_security.rb +5 -0
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +14 -6
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_server.rb +210 -12
- data/test/rubygems/test_gem_source.rb +12 -3
- data/test/rubygems/test_gem_source_fetch_problem.rb +8 -0
- data/test/rubygems/test_gem_source_git.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
- data/test/rubygems/test_gem_specification.rb +163 -32
- data/test/rubygems/test_gem_stream_ui.rb +6 -6
- data/test/rubygems/test_gem_stub_specification.rb +85 -6
- data/test/rubygems/test_gem_text.rb +11 -0
- data/test/rubygems/test_gem_util.rb +26 -0
- data/test/rubygems/test_gem_version.rb +46 -7
- data/test/rubygems/test_gem_version_option.rb +15 -0
- data/test/rubygems/test_kernel.rb +30 -0
- data/test/rubygems/test_remote_fetch_error.rb +21 -0
- data/test/rubygems/test_require.rb +95 -21
- data/test/rubygems/wrong_key_cert.pem +10 -9
- data/test/rubygems/wrong_key_cert_32.pem +10 -9
- data/util/ci +74 -0
- data/util/create_certs.rb +64 -49
- data/util/generate_spdx_license_list.rb +2 -1
- data/util/patch_with_prs.rb +77 -0
- data/util/update_bundled_ca_certificates.rb +23 -2
- data/util/update_changelog.rb +67 -0
- metadata +301 -48
- data/README.rdoc +0 -54
- data/lib/gauntlet_rubygems.rb +0 -51
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
- /data/{lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem → bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem} +0 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler::Molinillo
|
4
|
+
class DependencyGraph
|
5
|
+
# A vertex in a {DependencyGraph} that encapsulates a {#name} and a
|
6
|
+
# {#payload}
|
7
|
+
class Vertex
|
8
|
+
# @return [String] the name of the vertex
|
9
|
+
attr_accessor :name
|
10
|
+
|
11
|
+
# @return [Object] the payload the vertex holds
|
12
|
+
attr_accessor :payload
|
13
|
+
|
14
|
+
# @return [Array<Object>] the explicit requirements that required
|
15
|
+
# this vertex
|
16
|
+
attr_reader :explicit_requirements
|
17
|
+
|
18
|
+
# @return [Boolean] whether the vertex is considered a root vertex
|
19
|
+
attr_accessor :root
|
20
|
+
alias root? root
|
21
|
+
|
22
|
+
# Initializes a vertex with the given name and payload.
|
23
|
+
# @param [String] name see {#name}
|
24
|
+
# @param [Object] payload see {#payload}
|
25
|
+
def initialize(name, payload)
|
26
|
+
@name = name.frozen? ? name : name.dup.freeze
|
27
|
+
@payload = payload
|
28
|
+
@explicit_requirements = []
|
29
|
+
@outgoing_edges = []
|
30
|
+
@incoming_edges = []
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [Array<Object>] all of the requirements that required
|
34
|
+
# this vertex
|
35
|
+
def requirements
|
36
|
+
(incoming_edges.map(&:requirement) + explicit_requirements).uniq
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [Array<Edge>] the edges of {#graph} that have `self` as their
|
40
|
+
# {Edge#origin}
|
41
|
+
attr_accessor :outgoing_edges
|
42
|
+
|
43
|
+
# @return [Array<Edge>] the edges of {#graph} that have `self` as their
|
44
|
+
# {Edge#destination}
|
45
|
+
attr_accessor :incoming_edges
|
46
|
+
|
47
|
+
# @return [Array<Vertex>] the vertices of {#graph} that have an edge with
|
48
|
+
# `self` as their {Edge#destination}
|
49
|
+
def predecessors
|
50
|
+
incoming_edges.map(&:origin)
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [Array<Vertex>] the vertices of {#graph} where `self` is a
|
54
|
+
# {#descendent?}
|
55
|
+
def recursive_predecessors
|
56
|
+
vertices = predecessors
|
57
|
+
vertices += Compatibility.flat_map(vertices, &:recursive_predecessors)
|
58
|
+
vertices.uniq!
|
59
|
+
vertices
|
60
|
+
end
|
61
|
+
|
62
|
+
# @return [Array<Vertex>] the vertices of {#graph} that have an edge with
|
63
|
+
# `self` as their {Edge#origin}
|
64
|
+
def successors
|
65
|
+
outgoing_edges.map(&:destination)
|
66
|
+
end
|
67
|
+
|
68
|
+
# @return [Array<Vertex>] the vertices of {#graph} where `self` is an
|
69
|
+
# {#ancestor?}
|
70
|
+
def recursive_successors
|
71
|
+
vertices = successors
|
72
|
+
vertices += Compatibility.flat_map(vertices, &:recursive_successors)
|
73
|
+
vertices.uniq!
|
74
|
+
vertices
|
75
|
+
end
|
76
|
+
|
77
|
+
# @return [String] a string suitable for debugging
|
78
|
+
def inspect
|
79
|
+
"#{self.class}:#{name}(#{payload.inspect})"
|
80
|
+
end
|
81
|
+
|
82
|
+
# @return [Boolean] whether the two vertices are equal, determined
|
83
|
+
# by a recursive traversal of each {Vertex#successors}
|
84
|
+
def ==(other)
|
85
|
+
return true if equal?(other)
|
86
|
+
shallow_eql?(other) &&
|
87
|
+
successors.to_set == other.successors.to_set
|
88
|
+
end
|
89
|
+
|
90
|
+
# @param [Vertex] other the other vertex to compare to
|
91
|
+
# @return [Boolean] whether the two vertices are equal, determined
|
92
|
+
# solely by {#name} and {#payload} equality
|
93
|
+
def shallow_eql?(other)
|
94
|
+
return true if equal?(other)
|
95
|
+
other &&
|
96
|
+
name == other.name &&
|
97
|
+
payload == other.payload
|
98
|
+
end
|
99
|
+
|
100
|
+
alias eql? ==
|
101
|
+
|
102
|
+
# @return [Fixnum] a hash for the vertex based upon its {#name}
|
103
|
+
def hash
|
104
|
+
name.hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Is there a path from `self` to `other` following edges in the
|
108
|
+
# dependency graph?
|
109
|
+
# @return true iff there is a path following edges within this {#graph}
|
110
|
+
def path_to?(other)
|
111
|
+
equal?(other) || successors.any? { |v| v.path_to?(other) }
|
112
|
+
end
|
113
|
+
|
114
|
+
alias descendent? path_to?
|
115
|
+
|
116
|
+
# Is there a path from `other` to `self` following edges in the
|
117
|
+
# dependency graph?
|
118
|
+
# @return true iff there is a path following edges within this {#graph}
|
119
|
+
def ancestor?(other)
|
120
|
+
other.path_to?(self)
|
121
|
+
end
|
122
|
+
|
123
|
+
alias is_reachable_from? ancestor?
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'set'
|
4
|
+
require 'tsort'
|
5
|
+
|
6
|
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/log'
|
7
|
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex'
|
8
|
+
|
9
|
+
module Bundler::Molinillo
|
10
|
+
# A directed acyclic graph that is tuned to hold named dependencies
|
11
|
+
class DependencyGraph
|
12
|
+
include Enumerable
|
13
|
+
|
14
|
+
# Enumerates through the vertices of the graph.
|
15
|
+
# @return [Array<Vertex>] The graph's vertices.
|
16
|
+
def each
|
17
|
+
return vertices.values.each unless block_given?
|
18
|
+
vertices.values.each { |v| yield v }
|
19
|
+
end
|
20
|
+
|
21
|
+
include TSort
|
22
|
+
|
23
|
+
# @!visibility private
|
24
|
+
alias tsort_each_node each
|
25
|
+
|
26
|
+
# @!visibility private
|
27
|
+
def tsort_each_child(vertex, &block)
|
28
|
+
vertex.successors.each(&block)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Topologically sorts the given vertices.
|
32
|
+
# @param [Enumerable<Vertex>] vertices the vertices to be sorted, which must
|
33
|
+
# all belong to the same graph.
|
34
|
+
# @return [Array<Vertex>] The sorted vertices.
|
35
|
+
def self.tsort(vertices)
|
36
|
+
TSort.tsort(
|
37
|
+
lambda { |b| vertices.each(&b) },
|
38
|
+
lambda { |v, &b| (v.successors & vertices).each(&b) }
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
# A directed edge of a {DependencyGraph}
|
43
|
+
# @attr [Vertex] origin The origin of the directed edge
|
44
|
+
# @attr [Vertex] destination The destination of the directed edge
|
45
|
+
# @attr [Object] requirement The requirement the directed edge represents
|
46
|
+
Edge = Struct.new(:origin, :destination, :requirement)
|
47
|
+
|
48
|
+
# @return [{String => Vertex}] the vertices of the dependency graph, keyed
|
49
|
+
# by {Vertex#name}
|
50
|
+
attr_reader :vertices
|
51
|
+
|
52
|
+
# @return [Log] the op log for this graph
|
53
|
+
attr_reader :log
|
54
|
+
|
55
|
+
# Initializes an empty dependency graph
|
56
|
+
def initialize
|
57
|
+
@vertices = {}
|
58
|
+
@log = Log.new
|
59
|
+
end
|
60
|
+
|
61
|
+
# Tags the current state of the dependency as the given tag
|
62
|
+
# @param [Object] tag an opaque tag for the current state of the graph
|
63
|
+
# @return [Void]
|
64
|
+
def tag(tag)
|
65
|
+
log.tag(self, tag)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Rewinds the graph to the state tagged as `tag`
|
69
|
+
# @param [Object] tag the tag to rewind to
|
70
|
+
# @return [Void]
|
71
|
+
def rewind_to(tag)
|
72
|
+
log.rewind_to(self, tag)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Initializes a copy of a {DependencyGraph}, ensuring that all {#vertices}
|
76
|
+
# are properly copied.
|
77
|
+
# @param [DependencyGraph] other the graph to copy.
|
78
|
+
def initialize_copy(other)
|
79
|
+
super
|
80
|
+
@vertices = {}
|
81
|
+
@log = other.log.dup
|
82
|
+
traverse = lambda do |new_v, old_v|
|
83
|
+
return if new_v.outgoing_edges.size == old_v.outgoing_edges.size
|
84
|
+
old_v.outgoing_edges.each do |edge|
|
85
|
+
destination = add_vertex(edge.destination.name, edge.destination.payload)
|
86
|
+
add_edge_no_circular(new_v, destination, edge.requirement)
|
87
|
+
traverse.call(destination, edge.destination)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
other.vertices.each do |name, vertex|
|
91
|
+
new_vertex = add_vertex(name, vertex.payload, vertex.root?)
|
92
|
+
new_vertex.explicit_requirements.replace(vertex.explicit_requirements)
|
93
|
+
traverse.call(new_vertex, vertex)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# @return [String] a string suitable for debugging
|
98
|
+
def inspect
|
99
|
+
"#{self.class}:#{vertices.values.inspect}"
|
100
|
+
end
|
101
|
+
|
102
|
+
# @param [Hash] options options for dot output.
|
103
|
+
# @return [String] Returns a dot format representation of the graph
|
104
|
+
def to_dot(options = {})
|
105
|
+
edge_label = options.delete(:edge_label)
|
106
|
+
raise ArgumentError, "Unknown options: #{options.keys}" unless options.empty?
|
107
|
+
|
108
|
+
dot_vertices = []
|
109
|
+
dot_edges = []
|
110
|
+
vertices.each do |n, v|
|
111
|
+
dot_vertices << " #{n} [label=\"{#{n}|#{v.payload}}\"]"
|
112
|
+
v.outgoing_edges.each do |e|
|
113
|
+
label = edge_label ? edge_label.call(e) : e.requirement
|
114
|
+
dot_edges << " #{e.origin.name} -> #{e.destination.name} [label=#{label.to_s.dump}]"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
dot_vertices.uniq!
|
119
|
+
dot_vertices.sort!
|
120
|
+
dot_edges.uniq!
|
121
|
+
dot_edges.sort!
|
122
|
+
|
123
|
+
dot = dot_vertices.unshift('digraph G {').push('') + dot_edges.push('}')
|
124
|
+
dot.join("\n")
|
125
|
+
end
|
126
|
+
|
127
|
+
# @return [Boolean] whether the two dependency graphs are equal, determined
|
128
|
+
# by a recursive traversal of each {#root_vertices} and its
|
129
|
+
# {Vertex#successors}
|
130
|
+
def ==(other)
|
131
|
+
return false unless other
|
132
|
+
return true if equal?(other)
|
133
|
+
vertices.each do |name, vertex|
|
134
|
+
other_vertex = other.vertex_named(name)
|
135
|
+
return false unless other_vertex
|
136
|
+
return false unless vertex.payload == other_vertex.payload
|
137
|
+
return false unless other_vertex.successors.to_set == vertex.successors.to_set
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# @param [String] name
|
142
|
+
# @param [Object] payload
|
143
|
+
# @param [Array<String>] parent_names
|
144
|
+
# @param [Object] requirement the requirement that is requiring the child
|
145
|
+
# @return [void]
|
146
|
+
def add_child_vertex(name, payload, parent_names, requirement)
|
147
|
+
root = !parent_names.delete(nil) { true }
|
148
|
+
vertex = add_vertex(name, payload, root)
|
149
|
+
vertex.explicit_requirements << requirement if root
|
150
|
+
parent_names.each do |parent_name|
|
151
|
+
parent_vertex = vertex_named(parent_name)
|
152
|
+
add_edge(parent_vertex, vertex, requirement)
|
153
|
+
end
|
154
|
+
vertex
|
155
|
+
end
|
156
|
+
|
157
|
+
# Adds a vertex with the given name, or updates the existing one.
|
158
|
+
# @param [String] name
|
159
|
+
# @param [Object] payload
|
160
|
+
# @return [Vertex] the vertex that was added to `self`
|
161
|
+
def add_vertex(name, payload, root = false)
|
162
|
+
log.add_vertex(self, name, payload, root)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Detaches the {#vertex_named} `name` {Vertex} from the graph, recursively
|
166
|
+
# removing any non-root vertices that were orphaned in the process
|
167
|
+
# @param [String] name
|
168
|
+
# @return [Array<Vertex>] the vertices which have been detached
|
169
|
+
def detach_vertex_named(name)
|
170
|
+
log.detach_vertex_named(self, name)
|
171
|
+
end
|
172
|
+
|
173
|
+
# @param [String] name
|
174
|
+
# @return [Vertex,nil] the vertex with the given name
|
175
|
+
def vertex_named(name)
|
176
|
+
vertices[name]
|
177
|
+
end
|
178
|
+
|
179
|
+
# @param [String] name
|
180
|
+
# @return [Vertex,nil] the root vertex with the given name
|
181
|
+
def root_vertex_named(name)
|
182
|
+
vertex = vertex_named(name)
|
183
|
+
vertex if vertex && vertex.root?
|
184
|
+
end
|
185
|
+
|
186
|
+
# Adds a new {Edge} to the dependency graph
|
187
|
+
# @param [Vertex] origin
|
188
|
+
# @param [Vertex] destination
|
189
|
+
# @param [Object] requirement the requirement that this edge represents
|
190
|
+
# @return [Edge] the added edge
|
191
|
+
def add_edge(origin, destination, requirement)
|
192
|
+
if destination.path_to?(origin)
|
193
|
+
raise CircularDependencyError.new([origin, destination])
|
194
|
+
end
|
195
|
+
add_edge_no_circular(origin, destination, requirement)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Deletes an {Edge} from the dependency graph
|
199
|
+
# @param [Edge] edge
|
200
|
+
# @return [Void]
|
201
|
+
def delete_edge(edge)
|
202
|
+
log.delete_edge(self, edge.origin.name, edge.destination.name, edge.requirement)
|
203
|
+
end
|
204
|
+
|
205
|
+
# Sets the payload of the vertex with the given name
|
206
|
+
# @param [String] name the name of the vertex
|
207
|
+
# @param [Object] payload the payload
|
208
|
+
# @return [Void]
|
209
|
+
def set_payload(name, payload)
|
210
|
+
log.set_payload(self, name, payload)
|
211
|
+
end
|
212
|
+
|
213
|
+
private
|
214
|
+
|
215
|
+
# Adds a new {Edge} to the dependency graph without checking for
|
216
|
+
# circularity.
|
217
|
+
# @param (see #add_edge)
|
218
|
+
# @return (see #add_edge)
|
219
|
+
def add_edge_no_circular(origin, destination, requirement)
|
220
|
+
log.add_edge_no_circular(self, origin.name, destination.name, requirement)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler::Molinillo
|
4
|
+
# An error that occurred during the resolution process
|
5
|
+
class ResolverError < StandardError; end
|
6
|
+
|
7
|
+
# An error caused by searching for a dependency that is completely unknown,
|
8
|
+
# i.e. has no versions available whatsoever.
|
9
|
+
class NoSuchDependencyError < ResolverError
|
10
|
+
# @return [Object] the dependency that could not be found
|
11
|
+
attr_accessor :dependency
|
12
|
+
|
13
|
+
# @return [Array<Object>] the specifications that depended upon {#dependency}
|
14
|
+
attr_accessor :required_by
|
15
|
+
|
16
|
+
# Initializes a new error with the given missing dependency.
|
17
|
+
# @param [Object] dependency @see {#dependency}
|
18
|
+
# @param [Array<Object>] required_by @see {#required_by}
|
19
|
+
def initialize(dependency, required_by = [])
|
20
|
+
@dependency = dependency
|
21
|
+
@required_by = required_by
|
22
|
+
super()
|
23
|
+
end
|
24
|
+
|
25
|
+
# The error message for the missing dependency, including the specifications
|
26
|
+
# that had this dependency.
|
27
|
+
def message
|
28
|
+
sources = required_by.map { |r| "`#{r}`" }.join(' and ')
|
29
|
+
message = "Unable to find a specification for `#{dependency}`"
|
30
|
+
message += " depended upon by #{sources}" unless sources.empty?
|
31
|
+
message
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# An error caused by attempting to fulfil a dependency that was circular
|
36
|
+
#
|
37
|
+
# @note This exception will be thrown iff a {Vertex} is added to a
|
38
|
+
# {DependencyGraph} that has a {DependencyGraph::Vertex#path_to?} an
|
39
|
+
# existing {DependencyGraph::Vertex}
|
40
|
+
class CircularDependencyError < ResolverError
|
41
|
+
# [Set<Object>] the dependencies responsible for causing the error
|
42
|
+
attr_reader :dependencies
|
43
|
+
|
44
|
+
# Initializes a new error with the given circular vertices.
|
45
|
+
# @param [Array<DependencyGraph::Vertex>] vertices the vertices in the dependency
|
46
|
+
# that caused the error
|
47
|
+
def initialize(vertices)
|
48
|
+
super "There is a circular dependency between #{vertices.map(&:name).join(' and ')}"
|
49
|
+
@dependencies = vertices.map { |vertex| vertex.payload.possibilities.last }.to_set
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# An error caused by conflicts in version
|
54
|
+
class VersionConflict < ResolverError
|
55
|
+
# @return [{String => Resolution::Conflict}] the conflicts that caused
|
56
|
+
# resolution to fail
|
57
|
+
attr_reader :conflicts
|
58
|
+
|
59
|
+
# @return [SpecificationProvider] the specification provider used during
|
60
|
+
# resolution
|
61
|
+
attr_reader :specification_provider
|
62
|
+
|
63
|
+
# Initializes a new error with the given version conflicts.
|
64
|
+
# @param [{String => Resolution::Conflict}] conflicts see {#conflicts}
|
65
|
+
# @param [SpecificationProvider] specification_provider see {#specification_provider}
|
66
|
+
def initialize(conflicts, specification_provider)
|
67
|
+
pairs = []
|
68
|
+
Compatibility.flat_map(conflicts.values.flatten, &:requirements).each do |conflicting|
|
69
|
+
conflicting.each do |source, conflict_requirements|
|
70
|
+
conflict_requirements.each do |c|
|
71
|
+
pairs << [c, source]
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
super "Unable to satisfy the following requirements:\n\n" \
|
77
|
+
"#{pairs.map { |r, d| "- `#{r}` required by `#{d}`" }.join("\n")}"
|
78
|
+
|
79
|
+
@conflicts = conflicts
|
80
|
+
@specification_provider = specification_provider
|
81
|
+
end
|
82
|
+
|
83
|
+
require 'bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider'
|
84
|
+
include Delegates::SpecificationProvider
|
85
|
+
|
86
|
+
# @return [String] An error message that includes requirement trees,
|
87
|
+
# which is much more detailed & customizable than the default message
|
88
|
+
# @param [Hash] opts the options to create a message with.
|
89
|
+
# @option opts [String] :solver_name The user-facing name of the solver
|
90
|
+
# @option opts [String] :possibility_type The generic name of a possibility
|
91
|
+
# @option opts [Proc] :reduce_trees A proc that reduced the list of requirement trees
|
92
|
+
# @option opts [Proc] :printable_requirement A proc that pretty-prints requirements
|
93
|
+
# @option opts [Proc] :additional_message_for_conflict A proc that appends additional
|
94
|
+
# messages for each conflict
|
95
|
+
# @option opts [Proc] :version_for_spec A proc that returns the version number for a
|
96
|
+
# possibility
|
97
|
+
def message_with_trees(opts = {})
|
98
|
+
solver_name = opts.delete(:solver_name) { self.class.name.split('::').first }
|
99
|
+
possibility_type = opts.delete(:possibility_type) { 'possibility named' }
|
100
|
+
reduce_trees = opts.delete(:reduce_trees) { proc { |trees| trees.uniq.sort_by(&:to_s) } }
|
101
|
+
printable_requirement = opts.delete(:printable_requirement) { proc { |req| req.to_s } }
|
102
|
+
additional_message_for_conflict = opts.delete(:additional_message_for_conflict) { proc {} }
|
103
|
+
version_for_spec = opts.delete(:version_for_spec) { proc(&:to_s) }
|
104
|
+
|
105
|
+
conflicts.sort.reduce(''.dup) do |o, (name, conflict)|
|
106
|
+
o << %(\n#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":\n)
|
107
|
+
if conflict.locked_requirement
|
108
|
+
o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
|
109
|
+
o << %( #{printable_requirement.call(conflict.locked_requirement)}\n)
|
110
|
+
o << %(\n)
|
111
|
+
end
|
112
|
+
o << %( In #{name_for_explicit_dependency_source}:\n)
|
113
|
+
trees = reduce_trees.call(conflict.requirement_trees)
|
114
|
+
|
115
|
+
o << trees.map do |tree|
|
116
|
+
t = ''.dup
|
117
|
+
depth = 2
|
118
|
+
tree.each do |req|
|
119
|
+
t << ' ' * depth << req.to_s
|
120
|
+
unless tree.last == req
|
121
|
+
if spec = conflict.activated_by_name[name_for(req)]
|
122
|
+
t << %( was resolved to #{version_for_spec.call(spec)}, which)
|
123
|
+
end
|
124
|
+
t << %( depends on)
|
125
|
+
end
|
126
|
+
t << %(\n)
|
127
|
+
depth += 1
|
128
|
+
end
|
129
|
+
t
|
130
|
+
end.join("\n")
|
131
|
+
|
132
|
+
additional_message_for_conflict.call(o, name, conflict)
|
133
|
+
|
134
|
+
o
|
135
|
+
end.strip
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler::Molinillo
|
4
|
+
# Provides information about specifcations and dependencies to the resolver,
|
5
|
+
# allowing the {Resolver} class to remain generic while still providing power
|
6
|
+
# and flexibility.
|
7
|
+
#
|
8
|
+
# This module contains the methods that users of Bundler::Molinillo must to implement,
|
9
|
+
# using knowledge of their own model classes.
|
10
|
+
module SpecificationProvider
|
11
|
+
# Search for the specifications that match the given dependency.
|
12
|
+
# The specifications in the returned array will be considered in reverse
|
13
|
+
# order, so the latest version ought to be last.
|
14
|
+
# @note This method should be 'pure', i.e. the return value should depend
|
15
|
+
# only on the `dependency` parameter.
|
16
|
+
#
|
17
|
+
# @param [Object] dependency
|
18
|
+
# @return [Array<Object>] the specifications that satisfy the given
|
19
|
+
# `dependency`.
|
20
|
+
def search_for(dependency)
|
21
|
+
[]
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns the dependencies of `specification`.
|
25
|
+
# @note This method should be 'pure', i.e. the return value should depend
|
26
|
+
# only on the `specification` parameter.
|
27
|
+
#
|
28
|
+
# @param [Object] specification
|
29
|
+
# @return [Array<Object>] the dependencies that are required by the given
|
30
|
+
# `specification`.
|
31
|
+
def dependencies_for(specification)
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
# Determines whether the given `requirement` is satisfied by the given
|
36
|
+
# `spec`, in the context of the current `activated` dependency graph.
|
37
|
+
#
|
38
|
+
# @param [Object] requirement
|
39
|
+
# @param [DependencyGraph] activated the current dependency graph in the
|
40
|
+
# resolution process.
|
41
|
+
# @param [Object] spec
|
42
|
+
# @return [Boolean] whether `requirement` is satisfied by `spec` in the
|
43
|
+
# context of the current `activated` dependency graph.
|
44
|
+
def requirement_satisfied_by?(requirement, activated, spec)
|
45
|
+
true
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns the name for the given `dependency`.
|
49
|
+
# @note This method should be 'pure', i.e. the return value should depend
|
50
|
+
# only on the `dependency` parameter.
|
51
|
+
#
|
52
|
+
# @param [Object] dependency
|
53
|
+
# @return [String] the name for the given `dependency`.
|
54
|
+
def name_for(dependency)
|
55
|
+
dependency.to_s
|
56
|
+
end
|
57
|
+
|
58
|
+
# @return [String] the name of the source of explicit dependencies, i.e.
|
59
|
+
# those passed to {Resolver#resolve} directly.
|
60
|
+
def name_for_explicit_dependency_source
|
61
|
+
'user-specified dependency'
|
62
|
+
end
|
63
|
+
|
64
|
+
# @return [String] the name of the source of 'locked' dependencies, i.e.
|
65
|
+
# those passed to {Resolver#resolve} directly as the `base`
|
66
|
+
def name_for_locking_dependency_source
|
67
|
+
'Lockfile'
|
68
|
+
end
|
69
|
+
|
70
|
+
# Sort dependencies so that the ones that are easiest to resolve are first.
|
71
|
+
# Easiest to resolve is (usually) defined by:
|
72
|
+
# 1) Is this dependency already activated?
|
73
|
+
# 2) How relaxed are the requirements?
|
74
|
+
# 3) Are there any conflicts for this dependency?
|
75
|
+
# 4) How many possibilities are there to satisfy this dependency?
|
76
|
+
#
|
77
|
+
# @param [Array<Object>] dependencies
|
78
|
+
# @param [DependencyGraph] activated the current dependency graph in the
|
79
|
+
# resolution process.
|
80
|
+
# @param [{String => Array<Conflict>}] conflicts
|
81
|
+
# @return [Array<Object>] a sorted copy of `dependencies`.
|
82
|
+
def sort_dependencies(dependencies, activated, conflicts)
|
83
|
+
dependencies.sort_by do |dependency|
|
84
|
+
name = name_for(dependency)
|
85
|
+
[
|
86
|
+
activated.vertex_named(name).payload ? 0 : 1,
|
87
|
+
conflicts[name] ? 0 : 1,
|
88
|
+
]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Returns whether this dependency, which has no possible matching
|
93
|
+
# specifications, can safely be ignored.
|
94
|
+
#
|
95
|
+
# @param [Object] dependency
|
96
|
+
# @return [Boolean] whether this dependency can safely be skipped.
|
97
|
+
def allow_missing?(dependency)
|
98
|
+
false
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler::Molinillo
|
4
|
+
# Conveys information about the resolution process to a user.
|
5
|
+
module UI
|
6
|
+
# The {IO} object that should be used to print output. `STDOUT`, by default.
|
7
|
+
#
|
8
|
+
# @return [IO]
|
9
|
+
def output
|
10
|
+
STDOUT
|
11
|
+
end
|
12
|
+
|
13
|
+
# Called roughly every {#progress_rate}, this method should convey progress
|
14
|
+
# to the user.
|
15
|
+
#
|
16
|
+
# @return [void]
|
17
|
+
def indicate_progress
|
18
|
+
output.print '.' unless debug?
|
19
|
+
end
|
20
|
+
|
21
|
+
# How often progress should be conveyed to the user via
|
22
|
+
# {#indicate_progress}, in seconds. A third of a second, by default.
|
23
|
+
#
|
24
|
+
# @return [Float]
|
25
|
+
def progress_rate
|
26
|
+
0.33
|
27
|
+
end
|
28
|
+
|
29
|
+
# Called before resolution begins.
|
30
|
+
#
|
31
|
+
# @return [void]
|
32
|
+
def before_resolution
|
33
|
+
output.print 'Resolving dependencies...'
|
34
|
+
end
|
35
|
+
|
36
|
+
# Called after resolution ends (either successfully or with an error).
|
37
|
+
# By default, prints a newline.
|
38
|
+
#
|
39
|
+
# @return [void]
|
40
|
+
def after_resolution
|
41
|
+
output.puts
|
42
|
+
end
|
43
|
+
|
44
|
+
# Conveys debug information to the user.
|
45
|
+
#
|
46
|
+
# @param [Integer] depth the current depth of the resolution process.
|
47
|
+
# @return [void]
|
48
|
+
def debug(depth = 0)
|
49
|
+
if debug?
|
50
|
+
debug_info = yield
|
51
|
+
debug_info = debug_info.inspect unless debug_info.is_a?(String)
|
52
|
+
debug_info = debug_info.split("\n").map { |s| ":#{depth.to_s.rjust 4}: #{s}" }
|
53
|
+
output.puts debug_info
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Whether or not debug messages should be printed.
|
58
|
+
# By default, whether or not the `MOLINILLO_DEBUG` environment variable is
|
59
|
+
# set.
|
60
|
+
#
|
61
|
+
# @return [Boolean]
|
62
|
+
def debug?
|
63
|
+
return @debug_mode if defined?(@debug_mode)
|
64
|
+
@debug_mode = ENV['MOLINILLO_DEBUG']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|