bundler 1.17.3 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3354 -1258
- data/LICENSE.md +18 -19
- data/README.md +10 -15
- data/bundler.gemspec +15 -33
- data/exe/bundle +8 -10
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +5 -13
- data/lib/bundler/capistrano.rb +5 -5
- data/lib/bundler/checksum.rb +254 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +29 -15
- data/lib/bundler/cli/binstubs.rb +13 -5
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +7 -5
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +50 -14
- data/lib/bundler/cli/config.rb +171 -86
- data/lib/bundler/cli/console.rb +3 -6
- data/lib/bundler/cli/doctor.rb +29 -12
- data/lib/bundler/cli/exec.rb +9 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +268 -53
- data/lib/bundler/cli/info.rb +51 -18
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +2 -2
- data/lib/bundler/cli/install.rb +55 -73
- data/lib/bundler/cli/issue.rb +9 -8
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +56 -26
- data/lib/bundler/cli/open.rb +10 -7
- data/lib/bundler/cli/outdated.rb +159 -128
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +23 -12
- data/lib/bundler/cli/pristine.rb +39 -26
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +7 -7
- data/lib/bundler/cli/update.rb +51 -19
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +399 -390
- data/lib/bundler/compact_index_client/cache.rb +55 -77
- data/lib/bundler/compact_index_client/cache_file.rb +148 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +32 -0
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client/updater.rb +72 -84
- data/lib/bundler/compact_index_client.rb +61 -73
- data/lib/bundler/constants.rb +9 -2
- data/lib/bundler/current_ruby.rb +20 -21
- data/lib/bundler/definition.rb +663 -505
- data/lib/bundler/dependency.rb +38 -71
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +171 -152
- data/lib/bundler/endpoint_specification.rb +43 -17
- data/lib/bundler/env.rb +11 -18
- data/lib/bundler/environment_preserver.rb +17 -8
- data/lib/bundler/errors.rb +115 -14
- data/lib/bundler/feature_flag.rb +15 -39
- data/lib/bundler/fetcher/base.rb +12 -12
- data/lib/bundler/fetcher/compact_index.rb +41 -47
- data/lib/bundler/fetcher/dependency.rb +4 -8
- data/lib/bundler/fetcher/downloader.rb +27 -20
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +6 -33
- data/lib/bundler/fetcher.rb +109 -90
- data/lib/bundler/force_platform.rb +16 -0
- data/lib/bundler/friendly_errors.rb +50 -55
- data/lib/bundler/gem_helper.rb +81 -46
- data/lib/bundler/gem_helpers.rb +78 -29
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +68 -109
- data/lib/bundler/graph.rb +11 -11
- data/lib/bundler/index.rb +74 -82
- data/lib/bundler/injector.rb +58 -26
- data/lib/bundler/inline.rb +59 -35
- data/lib/bundler/installer/gem_installer.rb +29 -29
- data/lib/bundler/installer/parallel_installer.rb +38 -68
- data/lib/bundler/installer/standalone.rb +76 -16
- data/lib/bundler/installer.rb +60 -135
- data/lib/bundler/lazy_specification.rb +161 -63
- data/lib/bundler/lockfile_generator.rb +14 -5
- data/lib/bundler/lockfile_parser.rb +150 -109
- data/lib/bundler/man/bundle-add.1 +76 -0
- data/lib/bundler/man/bundle-add.1.ronn +87 -0
- data/{man → lib/bundler/man}/bundle-binstubs.1 +15 -22
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +8 -7
- data/lib/bundler/man/bundle-cache.1 +68 -0
- data/lib/bundler/man/bundle-cache.1.ronn +108 -0
- data/{man → lib/bundler/man}/bundle-check.1 +7 -14
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +7 -2
- data/{man → lib/bundler/man}/bundle-clean.1 +4 -11
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +80 -260
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +104 -98
- data/lib/bundler/man/bundle-console.1 +33 -0
- data/lib/bundler/man/bundle-console.1.ronn +39 -0
- data/{man → lib/bundler/man}/bundle-doctor.1 +5 -19
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +1 -1
- data/lib/bundler/man/bundle-env.1 +9 -0
- data/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +20 -78
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +12 -10
- data/lib/bundler/man/bundle-fund.1 +22 -0
- data/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/lib/bundler/man/bundle-gem.1 +87 -0
- data/lib/bundler/man/bundle-gem.1.ronn +149 -0
- data/lib/bundler/man/bundle-help.1 +9 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +17 -0
- data/lib/bundler/man/bundle-info.1.ronn +21 -0
- data/{man → lib/bundler/man}/bundle-init.1 +8 -13
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +5 -2
- data/lib/bundler/man/bundle-inject.1 +31 -0
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +12 -2
- data/{man → lib/bundler/man}/bundle-install.1 +65 -155
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +66 -57
- data/lib/bundler/man/bundle-issue.1 +45 -0
- data/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/lib/bundler/man/bundle-licenses.1 +9 -0
- data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/{man → lib/bundler/man}/bundle-list.1 +9 -24
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +10 -7
- data/{man → lib/bundler/man}/bundle-lock.1 +25 -34
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +25 -4
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +10 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +23 -75
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +21 -22
- data/lib/bundler/man/bundle-platform.1 +49 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/lib/bundler/man/bundle-plugin.1 +58 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +5 -16
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +4 -14
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +7 -11
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +4 -0
- data/{man → lib/bundler/man}/bundle-update.1 +35 -148
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +21 -12
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +9 -18
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +9 -3
- data/{man → lib/bundler/man}/bundle.1 +19 -53
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +14 -9
- data/{man → lib/bundler/man}/gemfile.5 +139 -356
- data/{man → lib/bundler/man}/gemfile.5.ronn +134 -97
- data/{man → lib/bundler/man}/index.txt +9 -1
- data/lib/bundler/match_metadata.rb +17 -0
- data/lib/bundler/match_platform.rb +2 -3
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/materialization.rb +59 -0
- data/lib/bundler/mirror.rb +10 -12
- data/lib/bundler/plugin/api/source.rb +34 -18
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/events.rb +24 -0
- data/lib/bundler/plugin/index.rb +44 -9
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/path.rb +18 -0
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +63 -27
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +131 -45
- data/lib/bundler/process_lock.rb +10 -14
- data/lib/bundler/remote_specification.rb +22 -10
- data/lib/bundler/resolver/base.rb +118 -0
- data/lib/bundler/resolver/candidate.rb +82 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +90 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +60 -68
- data/lib/bundler/resolver.rb +454 -303
- data/lib/bundler/retry.rb +6 -6
- data/lib/bundler/ruby_dsl.rb +51 -7
- data/lib/bundler/ruby_version.rb +23 -38
- data/lib/bundler/rubygems_ext.rb +357 -98
- data/lib/bundler/rubygems_gem_installer.rb +131 -65
- data/lib/bundler/rubygems_integration.rb +149 -591
- data/lib/bundler/runtime.rb +51 -51
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +206 -0
- data/lib/bundler/settings.rb +271 -135
- data/lib/bundler/setup.rb +23 -12
- data/lib/bundler/shared_helpers.rb +127 -117
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +326 -127
- data/lib/bundler/source/git.rb +207 -88
- data/lib/bundler/source/metadata.rb +19 -18
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +39 -38
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +223 -255
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +33 -11
- data/lib/bundler/source_list.rb +131 -66
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +239 -94
- data/lib/bundler/stub_specification.rb +77 -39
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +23 -19
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +104 -46
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +19 -2
- data/lib/bundler/templates/newgem/README.md.tt +18 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +44 -6
- data/lib/bundler/templates/newgem/bin/console.tt +1 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +37 -40
- data/lib/bundler/templates/newgem/rubocop.yml.tt +8 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/rg_proxy.rb +2 -2
- data/lib/bundler/ui/shell.rb +64 -23
- data/lib/bundler/ui/silent.rb +33 -6
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +11 -5
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +175 -0
- data/lib/bundler/vendor/fileutils/.document +1 -0
- data/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1490 -432
- data/lib/bundler/vendor/net-http-persistent/.document +1 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +362 -484
- data/lib/bundler/vendor/pub_grub/.document +1 -0
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/lib/bundler/vendor/securerandom/.document +1 -0
- data/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/bundler/vendor/thor/.document +1 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +4 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +8 -18
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +27 -20
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +34 -13
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +47 -28
- data/lib/bundler/vendor/thor/lib/thor/base.rb +200 -54
- data/lib/bundler/vendor/thor/lib/thor/command.rb +34 -18
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +74 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +15 -4
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +17 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +35 -15
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +45 -13
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +86 -13
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +51 -40
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +99 -148
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -43
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -49
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +182 -17
- data/lib/bundler/vendor/tsort/.document +1 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/lib/bundler/vendor/uri/.document +1 -0
- data/lib/bundler/vendor/uri/COPYING +56 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +876 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1578 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +1 -42
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_securerandom.rb +12 -0
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_timeout.rb +12 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +21 -0
- data/lib/bundler/version.rb +5 -20
- data/lib/bundler/vlad.rb +3 -3
- data/lib/bundler/worker.rb +26 -15
- data/lib/bundler/yaml_serializer.rb +21 -13
- data/lib/bundler.rb +364 -230
- metadata +186 -218
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -3
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -7
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -81
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -136
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -223
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -101
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -837
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -12
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/lib/bundler/version_ranges.rb +0 -76
- data/man/bundle-add.1 +0 -58
- data/man/bundle-add.1.txt +0 -52
- data/man/bundle-add.ronn +0 -40
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -529
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1 +0 -80
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-gem.ronn +0 -78
- data/man/bundle-info.1 +0 -20
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-info.ronn +0 -17
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1 +0 -33
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -396
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1 +0 -32
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- data/man/bundle-package.ronn +0 -72
- data/man/bundle-platform.1 +0 -61
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -653
- /data/lib/bundler/{ssl_certs → man}/.document +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
# Vendored files do not need to be documented
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 John Hawthorn
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Bundler::PubGrub
|
2
|
+
class Assignment
|
3
|
+
attr_reader :term, :cause, :decision_level, :index
|
4
|
+
def initialize(term, cause, decision_level, index)
|
5
|
+
@term = term
|
6
|
+
@cause = cause
|
7
|
+
@decision_level = decision_level
|
8
|
+
@index = index
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.decision(package, version, decision_level, index)
|
12
|
+
term = Term.new(VersionConstraint.exact(package, version), true)
|
13
|
+
new(term, :decision, decision_level, index)
|
14
|
+
end
|
15
|
+
|
16
|
+
def decision?
|
17
|
+
cause == :decision
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,189 @@
|
|
1
|
+
require_relative 'version_constraint'
|
2
|
+
require_relative 'incompatibility'
|
3
|
+
|
4
|
+
module Bundler::PubGrub
|
5
|
+
# Types:
|
6
|
+
#
|
7
|
+
# Where possible, Bundler::PubGrub will accept user-defined types, so long as they quack.
|
8
|
+
#
|
9
|
+
# ## "Package":
|
10
|
+
#
|
11
|
+
# This class will be used to represent the various packages being solved for.
|
12
|
+
# .to_s will be called when displaying errors and debugging info, it should
|
13
|
+
# probably return the package's name.
|
14
|
+
# It must also have a reasonable definition of #== and #hash
|
15
|
+
#
|
16
|
+
# Example classes: String ("rails")
|
17
|
+
#
|
18
|
+
#
|
19
|
+
# ## "Version":
|
20
|
+
#
|
21
|
+
# This class will be used to represent a single version number.
|
22
|
+
#
|
23
|
+
# Versions don't need to store their associated package, however they will
|
24
|
+
# only be compared against other versions of the same package.
|
25
|
+
#
|
26
|
+
# It must be Comparible (and implement <=> reasonably)
|
27
|
+
#
|
28
|
+
# Example classes: Gem::Version, Integer
|
29
|
+
#
|
30
|
+
#
|
31
|
+
# ## "Dependency"
|
32
|
+
#
|
33
|
+
# This class represents the requirement one package has on another. It is
|
34
|
+
# returned by dependencies_for(package, version) and will be passed to
|
35
|
+
# parse_dependency to convert it to a format Bundler::PubGrub understands.
|
36
|
+
#
|
37
|
+
# It must also have a reasonable definition of #==
|
38
|
+
#
|
39
|
+
# Example classes: String ("~> 1.0"), Gem::Requirement
|
40
|
+
#
|
41
|
+
class BasicPackageSource
|
42
|
+
# Override me!
|
43
|
+
#
|
44
|
+
# This is called per package to find all possible versions of a package.
|
45
|
+
#
|
46
|
+
# It is called at most once per-package
|
47
|
+
#
|
48
|
+
# Returns: Array of versions for a package, in preferred order of selection
|
49
|
+
def all_versions_for(package)
|
50
|
+
raise NotImplementedError
|
51
|
+
end
|
52
|
+
|
53
|
+
# Override me!
|
54
|
+
#
|
55
|
+
# Returns: Hash in the form of { package => requirement, ... }
|
56
|
+
def dependencies_for(package, version)
|
57
|
+
raise NotImplementedError
|
58
|
+
end
|
59
|
+
|
60
|
+
# Override me!
|
61
|
+
#
|
62
|
+
# Convert a (user-defined) dependency into a format Bundler::PubGrub understands.
|
63
|
+
#
|
64
|
+
# Package is passed to this method but for many implementations is not
|
65
|
+
# needed.
|
66
|
+
#
|
67
|
+
# Returns: either a Bundler::PubGrub::VersionRange, Bundler::PubGrub::VersionUnion, or a
|
68
|
+
# Bundler::PubGrub::VersionConstraint
|
69
|
+
def parse_dependency(package, dependency)
|
70
|
+
raise NotImplementedError
|
71
|
+
end
|
72
|
+
|
73
|
+
# Override me!
|
74
|
+
#
|
75
|
+
# If not overridden, this will call dependencies_for with the root package.
|
76
|
+
#
|
77
|
+
# Returns: Hash in the form of { package => requirement, ... } (see dependencies_for)
|
78
|
+
def root_dependencies
|
79
|
+
dependencies_for(@root_package, @root_version)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Override me (maybe)
|
83
|
+
#
|
84
|
+
# If not overridden, the order returned by all_versions_for will be used
|
85
|
+
#
|
86
|
+
# Returns: Array of versions in preferred order
|
87
|
+
def sort_versions_by_preferred(package, sorted_versions)
|
88
|
+
indexes = @version_indexes[package]
|
89
|
+
sorted_versions.sort_by { |version| indexes[version] }
|
90
|
+
end
|
91
|
+
|
92
|
+
def initialize
|
93
|
+
@root_package = Package.root
|
94
|
+
@root_version = Package.root_version
|
95
|
+
|
96
|
+
@cached_versions = Hash.new do |h,k|
|
97
|
+
if k == @root_package
|
98
|
+
h[k] = [@root_version]
|
99
|
+
else
|
100
|
+
h[k] = all_versions_for(k)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
@sorted_versions = Hash.new { |h,k| h[k] = @cached_versions[k].sort }
|
104
|
+
@version_indexes = Hash.new { |h,k| h[k] = @cached_versions[k].each.with_index.to_h }
|
105
|
+
|
106
|
+
@cached_dependencies = Hash.new do |packages, package|
|
107
|
+
if package == @root_package
|
108
|
+
packages[package] = {
|
109
|
+
@root_version => root_dependencies
|
110
|
+
}
|
111
|
+
else
|
112
|
+
packages[package] = Hash.new do |versions, version|
|
113
|
+
versions[version] = dependencies_for(package, version)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def versions_for(package, range=VersionRange.any)
|
120
|
+
versions = range.select_versions(@sorted_versions[package])
|
121
|
+
|
122
|
+
# Conditional avoids (among other things) calling
|
123
|
+
# sort_versions_by_preferred with the root package
|
124
|
+
if versions.size > 1
|
125
|
+
sort_versions_by_preferred(package, versions)
|
126
|
+
else
|
127
|
+
versions
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def no_versions_incompatibility_for(_package, unsatisfied_term)
|
132
|
+
cause = Incompatibility::NoVersions.new(unsatisfied_term)
|
133
|
+
|
134
|
+
Incompatibility.new([unsatisfied_term], cause: cause)
|
135
|
+
end
|
136
|
+
|
137
|
+
def incompatibilities_for(package, version)
|
138
|
+
package_deps = @cached_dependencies[package]
|
139
|
+
sorted_versions = @sorted_versions[package]
|
140
|
+
package_deps[version].map do |dep_package, dep_constraint_name|
|
141
|
+
low = high = sorted_versions.index(version)
|
142
|
+
|
143
|
+
# find version low such that all >= low share the same dep
|
144
|
+
while low > 0 &&
|
145
|
+
package_deps[sorted_versions[low - 1]][dep_package] == dep_constraint_name
|
146
|
+
low -= 1
|
147
|
+
end
|
148
|
+
low =
|
149
|
+
if low == 0
|
150
|
+
nil
|
151
|
+
else
|
152
|
+
sorted_versions[low]
|
153
|
+
end
|
154
|
+
|
155
|
+
# find version high such that all < high share the same dep
|
156
|
+
while high < sorted_versions.length &&
|
157
|
+
package_deps[sorted_versions[high]][dep_package] == dep_constraint_name
|
158
|
+
high += 1
|
159
|
+
end
|
160
|
+
high =
|
161
|
+
if high == sorted_versions.length
|
162
|
+
nil
|
163
|
+
else
|
164
|
+
sorted_versions[high]
|
165
|
+
end
|
166
|
+
|
167
|
+
range = VersionRange.new(min: low, max: high, include_min: true)
|
168
|
+
|
169
|
+
self_constraint = VersionConstraint.new(package, range: range)
|
170
|
+
|
171
|
+
if !@packages.include?(dep_package)
|
172
|
+
# no such package -> this version is invalid
|
173
|
+
end
|
174
|
+
|
175
|
+
dep_constraint = parse_dependency(dep_package, dep_constraint_name)
|
176
|
+
if !dep_constraint
|
177
|
+
# falsey indicates this dependency was invalid
|
178
|
+
cause = Bundler::PubGrub::Incompatibility::InvalidDependency.new(dep_package, dep_constraint_name)
|
179
|
+
return [Incompatibility.new([Term.new(self_constraint, true)], cause: cause)]
|
180
|
+
elsif !dep_constraint.is_a?(VersionConstraint)
|
181
|
+
# Upgrade range/union to VersionConstraint
|
182
|
+
dep_constraint = VersionConstraint.new(dep_package, range: dep_constraint)
|
183
|
+
end
|
184
|
+
|
185
|
+
Incompatibility.new([Term.new(self_constraint, true), Term.new(dep_constraint, false)], cause: :dependency)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
module Bundler::PubGrub
|
2
|
+
class FailureWriter
|
3
|
+
def initialize(root)
|
4
|
+
@root = root
|
5
|
+
|
6
|
+
# { Incompatibility => Integer }
|
7
|
+
@derivations = {}
|
8
|
+
|
9
|
+
# [ [ String, Integer or nil ] ]
|
10
|
+
@lines = []
|
11
|
+
|
12
|
+
# { Incompatibility => Integer }
|
13
|
+
@line_numbers = {}
|
14
|
+
|
15
|
+
count_derivations(root)
|
16
|
+
end
|
17
|
+
|
18
|
+
def write
|
19
|
+
return @root.to_s unless @root.conflict?
|
20
|
+
|
21
|
+
visit(@root)
|
22
|
+
|
23
|
+
padding = @line_numbers.empty? ? 0 : "(#{@line_numbers.values.last}) ".length
|
24
|
+
|
25
|
+
@lines.map do |message, number|
|
26
|
+
next "" if message.empty?
|
27
|
+
|
28
|
+
lead = number ? "(#{number}) " : ""
|
29
|
+
lead = lead.ljust(padding)
|
30
|
+
message = message.gsub("\n", "\n" + " " * (padding + 2))
|
31
|
+
"#{lead}#{message}"
|
32
|
+
end.join("\n")
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def write_line(incompatibility, message, numbered:)
|
38
|
+
if numbered
|
39
|
+
number = @line_numbers.length + 1
|
40
|
+
@line_numbers[incompatibility] = number
|
41
|
+
end
|
42
|
+
|
43
|
+
@lines << [message, number]
|
44
|
+
end
|
45
|
+
|
46
|
+
def visit(incompatibility, conclusion: false)
|
47
|
+
raise unless incompatibility.conflict?
|
48
|
+
|
49
|
+
numbered = conclusion || @derivations[incompatibility] > 1;
|
50
|
+
conjunction = conclusion || incompatibility == @root ? "So," : "And"
|
51
|
+
|
52
|
+
cause = incompatibility.cause
|
53
|
+
|
54
|
+
if cause.conflict.conflict? && cause.other.conflict?
|
55
|
+
conflict_line = @line_numbers[cause.conflict]
|
56
|
+
other_line = @line_numbers[cause.other]
|
57
|
+
|
58
|
+
if conflict_line && other_line
|
59
|
+
write_line(
|
60
|
+
incompatibility,
|
61
|
+
"Because #{cause.conflict} (#{conflict_line})\nand #{cause.other} (#{other_line}),\n#{incompatibility}.",
|
62
|
+
numbered: numbered
|
63
|
+
)
|
64
|
+
elsif conflict_line || other_line
|
65
|
+
with_line = conflict_line ? cause.conflict : cause.other
|
66
|
+
without_line = conflict_line ? cause.other : cause.conflict
|
67
|
+
line = @line_numbers[with_line]
|
68
|
+
|
69
|
+
visit(without_line);
|
70
|
+
write_line(
|
71
|
+
incompatibility,
|
72
|
+
"#{conjunction} because #{with_line} (#{line}),\n#{incompatibility}.",
|
73
|
+
numbered: numbered
|
74
|
+
)
|
75
|
+
else
|
76
|
+
single_line_conflict = single_line?(cause.conflict.cause)
|
77
|
+
single_line_other = single_line?(cause.other.cause)
|
78
|
+
|
79
|
+
if single_line_conflict || single_line_other
|
80
|
+
first = single_line_other ? cause.conflict : cause.other
|
81
|
+
second = single_line_other ? cause.other : cause.conflict
|
82
|
+
visit(first)
|
83
|
+
visit(second)
|
84
|
+
write_line(
|
85
|
+
incompatibility,
|
86
|
+
"Thus, #{incompatibility}.",
|
87
|
+
numbered: numbered
|
88
|
+
)
|
89
|
+
else
|
90
|
+
visit(cause.conflict, conclusion: true)
|
91
|
+
@lines << ["", nil]
|
92
|
+
visit(cause.other)
|
93
|
+
|
94
|
+
write_line(
|
95
|
+
incompatibility,
|
96
|
+
"#{conjunction} because #{cause.conflict} (#{@line_numbers[cause.conflict]}),\n#{incompatibility}.",
|
97
|
+
numbered: numbered
|
98
|
+
)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
elsif cause.conflict.conflict? || cause.other.conflict?
|
102
|
+
derived = cause.conflict.conflict? ? cause.conflict : cause.other
|
103
|
+
ext = cause.conflict.conflict? ? cause.other : cause.conflict
|
104
|
+
|
105
|
+
derived_line = @line_numbers[derived]
|
106
|
+
if derived_line
|
107
|
+
write_line(
|
108
|
+
incompatibility,
|
109
|
+
"Because #{ext}\nand #{derived} (#{derived_line}),\n#{incompatibility}.",
|
110
|
+
numbered: numbered
|
111
|
+
)
|
112
|
+
elsif collapsible?(derived)
|
113
|
+
derived_cause = derived.cause
|
114
|
+
if derived_cause.conflict.conflict?
|
115
|
+
collapsed_derived = derived_cause.conflict
|
116
|
+
collapsed_ext = derived_cause.other
|
117
|
+
else
|
118
|
+
collapsed_derived = derived_cause.other
|
119
|
+
collapsed_ext = derived_cause.conflict
|
120
|
+
end
|
121
|
+
|
122
|
+
visit(collapsed_derived)
|
123
|
+
|
124
|
+
write_line(
|
125
|
+
incompatibility,
|
126
|
+
"#{conjunction} because #{collapsed_ext}\nand #{ext},\n#{incompatibility}.",
|
127
|
+
numbered: numbered
|
128
|
+
)
|
129
|
+
else
|
130
|
+
visit(derived)
|
131
|
+
write_line(
|
132
|
+
incompatibility,
|
133
|
+
"#{conjunction} because #{ext},\n#{incompatibility}.",
|
134
|
+
numbered: numbered
|
135
|
+
)
|
136
|
+
end
|
137
|
+
else
|
138
|
+
write_line(
|
139
|
+
incompatibility,
|
140
|
+
"Because #{cause.conflict}\nand #{cause.other},\n#{incompatibility}.",
|
141
|
+
numbered: numbered
|
142
|
+
)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def single_line?(cause)
|
147
|
+
!cause.conflict.conflict? && !cause.other.conflict?
|
148
|
+
end
|
149
|
+
|
150
|
+
def collapsible?(incompatibility)
|
151
|
+
return false if @derivations[incompatibility] > 1
|
152
|
+
|
153
|
+
cause = incompatibility.cause
|
154
|
+
# If incompatibility is derived from two derived incompatibilities,
|
155
|
+
# there are too many transitive causes to display concisely.
|
156
|
+
return false if cause.conflict.conflict? && cause.other.conflict?
|
157
|
+
|
158
|
+
# If incompatibility is derived from two external incompatibilities, it
|
159
|
+
# tends to be confusing to collapse it.
|
160
|
+
return false unless cause.conflict.conflict? || cause.other.conflict?
|
161
|
+
|
162
|
+
# If incompatibility's internal cause is numbered, collapsing it would
|
163
|
+
# get too noisy.
|
164
|
+
complex = cause.conflict.conflict? ? cause.conflict : cause.other
|
165
|
+
|
166
|
+
!@line_numbers.has_key?(complex)
|
167
|
+
end
|
168
|
+
|
169
|
+
def count_derivations(incompatibility)
|
170
|
+
if @derivations.has_key?(incompatibility)
|
171
|
+
@derivations[incompatibility] += 1
|
172
|
+
else
|
173
|
+
@derivations[incompatibility] = 1
|
174
|
+
if incompatibility.conflict?
|
175
|
+
cause = incompatibility.cause
|
176
|
+
count_derivations(cause.conflict)
|
177
|
+
count_derivations(cause.other)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
module Bundler::PubGrub
|
2
|
+
class Incompatibility
|
3
|
+
ConflictCause = Struct.new(:incompatibility, :satisfier) do
|
4
|
+
alias_method :conflict, :incompatibility
|
5
|
+
alias_method :other, :satisfier
|
6
|
+
end
|
7
|
+
|
8
|
+
InvalidDependency = Struct.new(:package, :constraint) do
|
9
|
+
end
|
10
|
+
|
11
|
+
NoVersions = Struct.new(:constraint) do
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_reader :terms, :cause
|
15
|
+
|
16
|
+
def initialize(terms, cause:, custom_explanation: nil)
|
17
|
+
@cause = cause
|
18
|
+
@terms = cleanup_terms(terms)
|
19
|
+
@custom_explanation = custom_explanation
|
20
|
+
|
21
|
+
if cause == :dependency && @terms.length != 2
|
22
|
+
raise ArgumentError, "a dependency Incompatibility must have exactly two terms. Got #{@terms.inspect}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def hash
|
27
|
+
cause.hash ^ terms.hash
|
28
|
+
end
|
29
|
+
|
30
|
+
def eql?(other)
|
31
|
+
cause.eql?(other.cause) &&
|
32
|
+
terms.eql?(other.terms)
|
33
|
+
end
|
34
|
+
|
35
|
+
def failure?
|
36
|
+
terms.empty? || (terms.length == 1 && Package.root?(terms[0].package) && terms[0].positive?)
|
37
|
+
end
|
38
|
+
|
39
|
+
def conflict?
|
40
|
+
ConflictCause === cause
|
41
|
+
end
|
42
|
+
|
43
|
+
# Returns all external incompatibilities in this incompatibility's
|
44
|
+
# derivation graph
|
45
|
+
def external_incompatibilities
|
46
|
+
if conflict?
|
47
|
+
[
|
48
|
+
cause.conflict,
|
49
|
+
cause.other
|
50
|
+
].flat_map(&:external_incompatibilities)
|
51
|
+
else
|
52
|
+
[this]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_s
|
57
|
+
return @custom_explanation if @custom_explanation
|
58
|
+
|
59
|
+
case cause
|
60
|
+
when :root
|
61
|
+
"(root dependency)"
|
62
|
+
when :dependency
|
63
|
+
"#{terms[0].to_s(allow_every: true)} depends on #{terms[1].invert}"
|
64
|
+
when Bundler::PubGrub::Incompatibility::InvalidDependency
|
65
|
+
"#{terms[0].to_s(allow_every: true)} depends on unknown package #{cause.package}"
|
66
|
+
when Bundler::PubGrub::Incompatibility::NoVersions
|
67
|
+
"no versions satisfy #{cause.constraint}"
|
68
|
+
when Bundler::PubGrub::Incompatibility::ConflictCause
|
69
|
+
if failure?
|
70
|
+
"version solving has failed"
|
71
|
+
elsif terms.length == 1
|
72
|
+
term = terms[0]
|
73
|
+
if term.positive?
|
74
|
+
if term.constraint.any?
|
75
|
+
"#{term.package} cannot be used"
|
76
|
+
else
|
77
|
+
"#{term.to_s(allow_every: true)} cannot be used"
|
78
|
+
end
|
79
|
+
else
|
80
|
+
"#{term.invert} is required"
|
81
|
+
end
|
82
|
+
else
|
83
|
+
if terms.all?(&:positive?)
|
84
|
+
if terms.length == 2
|
85
|
+
"#{terms[0].to_s(allow_every: true)} is incompatible with #{terms[1]}"
|
86
|
+
else
|
87
|
+
"one of #{terms.map(&:to_s).join(" or ")} must be false"
|
88
|
+
end
|
89
|
+
elsif terms.all?(&:negative?)
|
90
|
+
if terms.length == 2
|
91
|
+
"either #{terms[0].invert} or #{terms[1].invert}"
|
92
|
+
else
|
93
|
+
"one of #{terms.map(&:invert).join(" or ")} must be true";
|
94
|
+
end
|
95
|
+
else
|
96
|
+
positive = terms.select(&:positive?)
|
97
|
+
negative = terms.select(&:negative?).map(&:invert)
|
98
|
+
|
99
|
+
if positive.length == 1
|
100
|
+
"#{positive[0].to_s(allow_every: true)} requires #{negative.join(" or ")}"
|
101
|
+
else
|
102
|
+
"if #{positive.join(" and ")} then #{negative.join(" or ")}"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
else
|
107
|
+
raise "unhandled cause: #{cause.inspect}"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def inspect
|
112
|
+
"#<#{self.class} #{to_s}>"
|
113
|
+
end
|
114
|
+
|
115
|
+
def pretty_print(q)
|
116
|
+
q.group 2, "#<#{self.class}", ">" do
|
117
|
+
q.breakable
|
118
|
+
q.text to_s
|
119
|
+
|
120
|
+
q.breakable
|
121
|
+
q.text " caused by "
|
122
|
+
q.pp @cause
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
private
|
127
|
+
|
128
|
+
def cleanup_terms(terms)
|
129
|
+
terms.each do |term|
|
130
|
+
raise "#{term.inspect} must be a term" unless term.is_a?(Term)
|
131
|
+
end
|
132
|
+
|
133
|
+
if terms.length != 1 && ConflictCause === cause
|
134
|
+
terms = terms.reject do |term|
|
135
|
+
term.positive? && Package.root?(term.package)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Optimized simple cases
|
140
|
+
return terms if terms.length <= 1
|
141
|
+
return terms if terms.length == 2 && terms[0].package != terms[1].package
|
142
|
+
|
143
|
+
terms.group_by(&:package).map do |package, common_terms|
|
144
|
+
common_terms.inject do |acc, term|
|
145
|
+
acc.intersect(term)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler::PubGrub
|
4
|
+
class Package
|
5
|
+
|
6
|
+
attr_reader :name
|
7
|
+
|
8
|
+
def initialize(name)
|
9
|
+
@name = name
|
10
|
+
end
|
11
|
+
|
12
|
+
def inspect
|
13
|
+
"#<#{self.class} #{name.inspect}>"
|
14
|
+
end
|
15
|
+
|
16
|
+
def <=>(other)
|
17
|
+
name <=> other.name
|
18
|
+
end
|
19
|
+
|
20
|
+
ROOT = Package.new(:root)
|
21
|
+
ROOT_VERSION = 0
|
22
|
+
|
23
|
+
def self.root
|
24
|
+
ROOT
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.root_version
|
28
|
+
ROOT_VERSION
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.root?(package)
|
32
|
+
if package.respond_to?(:root?)
|
33
|
+
package.root?
|
34
|
+
else
|
35
|
+
package == root
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_s
|
40
|
+
name.to_s
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|