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
data/lib/bundler/spec_set.rb
CHANGED
@@ -1,70 +1,97 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "forwardable"
|
5
|
-
require "set"
|
3
|
+
require_relative "vendored_tsort"
|
6
4
|
|
7
5
|
module Bundler
|
8
6
|
class SpecSet
|
9
|
-
|
10
|
-
include TSort
|
11
|
-
|
12
|
-
def_delegators :@specs, :<<, :length, :add, :remove, :size, :empty?
|
13
|
-
def_delegators :sorted, :each
|
7
|
+
include Enumerable
|
8
|
+
include TSort
|
14
9
|
|
15
10
|
def initialize(specs)
|
16
11
|
@specs = specs
|
17
12
|
end
|
18
13
|
|
19
|
-
def for(dependencies,
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
14
|
+
def for(dependencies, platforms_or_legacy_check = [nil], legacy_platforms = [nil], skips: [])
|
15
|
+
platforms = if [true, false].include?(platforms_or_legacy_check)
|
16
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
17
|
+
"SpecSet#for received a `check` parameter, but that's no longer used and deprecated. " \
|
18
|
+
"SpecSet#for always implicitly performs validation. Please remove this parameter",
|
19
|
+
print_caller_location: true
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
if spec = spec_for_dependency(dep, match_current_platform)
|
30
|
-
specs << spec
|
31
|
-
|
32
|
-
spec.dependencies.each do |d|
|
33
|
-
next if d.type == :development
|
34
|
-
d = DepProxy.new(d, dep.__platform) unless match_current_platform
|
35
|
-
deps << d
|
36
|
-
end
|
37
|
-
elsif check
|
38
|
-
return false
|
39
|
-
elsif raise_on_missing
|
40
|
-
others = lookup[dep.name] if match_current_platform
|
41
|
-
message = "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?"
|
42
|
-
message += " Found #{others.join(", ")} that did not match the current platform." if others && !others.empty?
|
43
|
-
raise GemNotFound, message
|
44
|
-
end
|
21
|
+
legacy_platforms
|
22
|
+
else
|
23
|
+
platforms_or_legacy_check
|
45
24
|
end
|
46
25
|
|
47
|
-
|
48
|
-
|
26
|
+
materialize_dependencies(dependencies, platforms, skips: skips)
|
27
|
+
|
28
|
+
@materializations.flat_map(&:specs).uniq
|
29
|
+
end
|
30
|
+
|
31
|
+
def normalize_platforms!(deps, platforms)
|
32
|
+
complete_platforms = add_extra_platforms!(platforms)
|
33
|
+
|
34
|
+
complete_platforms.map do |platform|
|
35
|
+
next platform if platform == Gem::Platform::RUBY
|
36
|
+
|
37
|
+
begin
|
38
|
+
Integer(platform.version)
|
39
|
+
rescue ArgumentError, TypeError
|
40
|
+
next platform
|
41
|
+
end
|
42
|
+
|
43
|
+
less_specific_platform = Gem::Platform.new([platform.cpu, platform.os, nil])
|
44
|
+
next platform if incomplete_for_platform?(deps, less_specific_platform)
|
45
|
+
|
46
|
+
less_specific_platform
|
47
|
+
end.uniq
|
48
|
+
end
|
49
|
+
|
50
|
+
def add_extra_platforms!(platforms)
|
51
|
+
return platforms.concat([Gem::Platform::RUBY]).uniq if @specs.empty?
|
52
|
+
|
53
|
+
new_platforms = all_platforms.select do |platform|
|
54
|
+
next if platforms.include?(platform)
|
55
|
+
next unless GemHelpers.generic(platform) == Gem::Platform::RUBY
|
56
|
+
|
57
|
+
complete_platform(platform)
|
49
58
|
end
|
59
|
+
return platforms if new_platforms.empty?
|
60
|
+
|
61
|
+
platforms.concat(new_platforms)
|
62
|
+
|
63
|
+
less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
|
64
|
+
platforms.delete(Bundler.local_platform) if less_specific_platform
|
50
65
|
|
51
|
-
|
66
|
+
platforms
|
52
67
|
end
|
53
68
|
|
54
|
-
def
|
55
|
-
|
69
|
+
def validate_deps(s)
|
70
|
+
s.runtime_dependencies.each do |dep|
|
71
|
+
next if dep.name == "bundler"
|
72
|
+
|
73
|
+
return :missing unless names.include?(dep.name)
|
74
|
+
return :invalid if none? {|spec| dep.matches_spec?(spec) }
|
75
|
+
end
|
76
|
+
|
77
|
+
:valid
|
56
78
|
end
|
57
79
|
|
58
80
|
def [](key)
|
59
81
|
key = key.name if key.respond_to?(:name)
|
60
|
-
lookup[key]
|
82
|
+
lookup[key]&.reverse || []
|
61
83
|
end
|
62
84
|
|
63
85
|
def []=(key, value)
|
64
86
|
@specs << value
|
65
|
-
|
66
|
-
|
67
|
-
|
87
|
+
|
88
|
+
reset!
|
89
|
+
end
|
90
|
+
|
91
|
+
def delete(specs)
|
92
|
+
Array(specs).each {|spec| @specs.delete(spec) }
|
93
|
+
|
94
|
+
reset!
|
68
95
|
end
|
69
96
|
|
70
97
|
def sort!
|
@@ -79,60 +106,190 @@ module Bundler
|
|
79
106
|
lookup.dup
|
80
107
|
end
|
81
108
|
|
82
|
-
def materialize(deps
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
next s unless s.is_a?(LazySpecification)
|
87
|
-
s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
|
88
|
-
spec = s.__materialize__
|
89
|
-
unless spec
|
90
|
-
unless missing_specs
|
91
|
-
raise GemNotFound, "Could not find #{s.full_name} in any of the sources"
|
92
|
-
end
|
93
|
-
missing_specs << s
|
94
|
-
end
|
95
|
-
spec
|
96
|
-
end
|
97
|
-
SpecSet.new(missing_specs ? materialized.compact : materialized)
|
109
|
+
def materialize(deps)
|
110
|
+
materialize_dependencies(deps)
|
111
|
+
|
112
|
+
SpecSet.new(materialized_specs)
|
98
113
|
end
|
99
114
|
|
100
115
|
# Materialize for all the specs in the spec set, regardless of what platform they're for
|
101
|
-
# This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
|
102
116
|
# @return [Array<Gem::Specification>]
|
103
117
|
def materialized_for_all_platforms
|
104
|
-
names = @specs.map(&:name).uniq
|
105
118
|
@specs.map do |s|
|
106
119
|
next s unless s.is_a?(LazySpecification)
|
107
|
-
s.source.
|
108
|
-
spec = s.
|
120
|
+
s.source.remote!
|
121
|
+
spec = s.materialize_strictly
|
109
122
|
raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
|
110
123
|
spec
|
111
124
|
end
|
112
125
|
end
|
113
126
|
|
114
|
-
def
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
127
|
+
def incomplete_for_platform?(deps, platform)
|
128
|
+
return false if @specs.empty?
|
129
|
+
|
130
|
+
validation_set = self.class.new(@specs)
|
131
|
+
validation_set.for(deps, [platform])
|
132
|
+
|
133
|
+
validation_set.incomplete_specs.any?
|
134
|
+
end
|
135
|
+
|
136
|
+
def missing_specs_for(deps)
|
137
|
+
materialize_dependencies(deps)
|
138
|
+
|
139
|
+
missing_specs
|
140
|
+
end
|
141
|
+
|
142
|
+
def missing_specs
|
143
|
+
@materializations.flat_map(&:completely_missing_specs)
|
144
|
+
end
|
145
|
+
|
146
|
+
def partially_missing_specs
|
147
|
+
@materializations.flat_map(&:partially_missing_specs)
|
148
|
+
end
|
149
|
+
|
150
|
+
def incomplete_specs
|
151
|
+
@materializations.flat_map(&:incomplete_specs)
|
152
|
+
end
|
153
|
+
|
154
|
+
def insecurely_materialized_specs
|
155
|
+
materialized_specs.select(&:insecurely_materialized?)
|
156
|
+
end
|
157
|
+
|
158
|
+
def -(other)
|
159
|
+
SpecSet.new(to_a - other.to_a)
|
122
160
|
end
|
123
161
|
|
124
162
|
def find_by_name_and_platform(name, platform)
|
125
163
|
@specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
|
126
164
|
end
|
127
165
|
|
166
|
+
def specs_with_additional_variants_from(other)
|
167
|
+
sorted | additional_variants_from(other)
|
168
|
+
end
|
169
|
+
|
170
|
+
def delete_by_name(name)
|
171
|
+
@specs.reject! {|spec| spec.name == name }
|
172
|
+
|
173
|
+
reset!
|
174
|
+
end
|
175
|
+
|
176
|
+
def version_for(name)
|
177
|
+
self[name].first&.version
|
178
|
+
end
|
179
|
+
|
128
180
|
def what_required(spec)
|
129
|
-
unless req = find {|s| s.
|
181
|
+
unless req = find {|s| s.runtime_dependencies.any? {|d| d.name == spec.name } }
|
130
182
|
return [spec]
|
131
183
|
end
|
132
184
|
what_required(req) << spec
|
133
185
|
end
|
134
186
|
|
135
|
-
|
187
|
+
def <<(spec)
|
188
|
+
@specs << spec
|
189
|
+
end
|
190
|
+
|
191
|
+
def length
|
192
|
+
@specs.length
|
193
|
+
end
|
194
|
+
|
195
|
+
def size
|
196
|
+
@specs.size
|
197
|
+
end
|
198
|
+
|
199
|
+
def empty?
|
200
|
+
@specs.empty?
|
201
|
+
end
|
202
|
+
|
203
|
+
def each(&b)
|
204
|
+
sorted.each(&b)
|
205
|
+
end
|
206
|
+
|
207
|
+
def names
|
208
|
+
lookup.keys
|
209
|
+
end
|
210
|
+
|
211
|
+
def valid?(s)
|
212
|
+
s.matches_current_metadata? && valid_dependencies?(s)
|
213
|
+
end
|
214
|
+
|
215
|
+
private
|
216
|
+
|
217
|
+
def materialize_dependencies(dependencies, platforms = [nil], skips: [])
|
218
|
+
handled = ["bundler"].product(platforms).map {|k| [k, true] }.to_h
|
219
|
+
deps = dependencies.product(platforms)
|
220
|
+
@materializations = []
|
221
|
+
|
222
|
+
loop do
|
223
|
+
break unless dep = deps.shift
|
224
|
+
|
225
|
+
dependency = dep[0]
|
226
|
+
platform = dep[1]
|
227
|
+
name = dependency.name
|
228
|
+
|
229
|
+
key = [name, platform]
|
230
|
+
next if handled.key?(key)
|
231
|
+
|
232
|
+
handled[key] = true
|
233
|
+
|
234
|
+
materialization = Materialization.new(dependency, platform, candidates: lookup[name])
|
235
|
+
|
236
|
+
deps.concat(materialization.dependencies) if materialization.complete?
|
237
|
+
|
238
|
+
@materializations << materialization unless skips.include?(name)
|
239
|
+
end
|
240
|
+
|
241
|
+
@materializations
|
242
|
+
end
|
243
|
+
|
244
|
+
def materialized_specs
|
245
|
+
@materializations.filter_map(&:materialized_spec)
|
246
|
+
end
|
247
|
+
|
248
|
+
def reset!
|
249
|
+
@sorted = nil
|
250
|
+
@lookup = nil
|
251
|
+
end
|
252
|
+
|
253
|
+
def complete_platform(platform)
|
254
|
+
new_specs = []
|
255
|
+
|
256
|
+
valid_platform = lookup.all? do |_, specs|
|
257
|
+
spec = specs.first
|
258
|
+
matching_specs = spec.source.specs.search([spec.name, spec.version])
|
259
|
+
platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
|
260
|
+
valid?(s)
|
261
|
+
end
|
262
|
+
|
263
|
+
if platform_spec
|
264
|
+
new_specs << LazySpecification.from_spec(platform_spec) unless specs.include?(platform_spec)
|
265
|
+
true
|
266
|
+
else
|
267
|
+
false
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
if valid_platform && new_specs.any?
|
272
|
+
@specs.concat(new_specs)
|
273
|
+
|
274
|
+
reset!
|
275
|
+
end
|
276
|
+
|
277
|
+
valid_platform
|
278
|
+
end
|
279
|
+
|
280
|
+
def all_platforms
|
281
|
+
@specs.flat_map {|spec| spec.source.specs.search([spec.name, spec.version]).map(&:platform) }.uniq
|
282
|
+
end
|
283
|
+
|
284
|
+
def additional_variants_from(other)
|
285
|
+
other.select do |spec|
|
286
|
+
version_for(spec.name) == spec.version && valid_dependencies?(spec)
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
def valid_dependencies?(s)
|
291
|
+
validate_deps(s) == :valid
|
292
|
+
end
|
136
293
|
|
137
294
|
def sorted
|
138
295
|
rake = @specs.find {|s| s.name == "rake" }
|
@@ -142,22 +299,19 @@ module Bundler
|
|
142
299
|
cgems = extract_circular_gems(error)
|
143
300
|
raise CyclicDependencyError, "Your bundle requires gems that depend" \
|
144
301
|
" on each other, creating an infinite loop. Please remove either" \
|
145
|
-
" gem '#{cgems[
|
302
|
+
" gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again."
|
146
303
|
end
|
147
304
|
end
|
148
305
|
|
149
306
|
def extract_circular_gems(error)
|
150
|
-
|
151
|
-
error.message.scan(/(\w+) \([^)]/).flatten
|
152
|
-
else
|
153
|
-
error.message.scan(/@name="(.*?)"/).flatten
|
154
|
-
end
|
307
|
+
error.message.scan(/@name="(.*?)"/).flatten
|
155
308
|
end
|
156
309
|
|
157
310
|
def lookup
|
158
311
|
@lookup ||= begin
|
159
|
-
lookup =
|
160
|
-
|
312
|
+
lookup = {}
|
313
|
+
@specs.each do |s|
|
314
|
+
lookup[s.name] ||= []
|
161
315
|
lookup[s.name] << s
|
162
316
|
end
|
163
317
|
lookup
|
@@ -169,23 +323,14 @@ module Bundler
|
|
169
323
|
@specs.sort_by(&:name).each {|s| yield s }
|
170
324
|
end
|
171
325
|
|
172
|
-
def spec_for_dependency(dep, match_current_platform)
|
173
|
-
specs_for_platforms = lookup[dep.name]
|
174
|
-
if match_current_platform
|
175
|
-
Bundler.rubygems.platforms.reverse_each do |pl|
|
176
|
-
match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
|
177
|
-
return match if match
|
178
|
-
end
|
179
|
-
nil
|
180
|
-
else
|
181
|
-
GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
326
|
def tsort_each_child(s)
|
186
327
|
s.dependencies.sort_by(&:name).each do |d|
|
187
328
|
next if d.type == :development
|
188
|
-
|
329
|
+
|
330
|
+
specs_for_name = lookup[d.name]
|
331
|
+
next unless specs_for_name
|
332
|
+
|
333
|
+
specs_for_name.each {|s2| yield s2 }
|
189
334
|
end
|
190
335
|
end
|
191
336
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "bundler/remote_specification"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class StubSpecification < RemoteSpecification
|
7
5
|
def self.from_stub(stub)
|
@@ -11,19 +9,21 @@ module Bundler
|
|
11
9
|
spec
|
12
10
|
end
|
13
11
|
|
12
|
+
def insecurely_materialized?
|
13
|
+
false
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_reader :checksum
|
14
17
|
attr_accessor :stub, :ignored
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
path = File.join(stub.extensions_dir, source.extension_dir_name)
|
25
|
-
stub.extension_dir = File.expand_path(path)
|
26
|
-
end
|
19
|
+
def source=(source)
|
20
|
+
super
|
21
|
+
# Stub has no concept of source, which means that extension_dir may be wrong
|
22
|
+
# This is the case for git-based gems. So, instead manually assign the extension dir
|
23
|
+
return unless source.respond_to?(:extension_dir_name)
|
24
|
+
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
|
25
|
+
path = File.join(stub.extensions_dir, unique_extension_dir)
|
26
|
+
stub.extension_dir = File.expand_path(path)
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_yaml
|
@@ -32,58 +32,95 @@ module Bundler
|
|
32
32
|
|
33
33
|
# @!group Stub Delegates
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
def ignored?
|
36
|
+
return @ignored unless @ignored.nil?
|
37
|
+
|
38
|
+
@ignored = missing_extensions?
|
39
|
+
return false unless @ignored
|
40
|
+
|
41
|
+
warn "Source #{source} is ignoring #{self} because it is missing extensions"
|
42
|
+
|
43
|
+
true
|
40
44
|
end
|
41
45
|
|
42
|
-
def
|
43
|
-
|
46
|
+
def manually_installed?
|
47
|
+
# This is for manually installed gems which are gems that were fixed in place after a
|
48
|
+
# failed installation. Once the issue was resolved, the user then manually created
|
49
|
+
# the gem specification using the instructions provided by `gem help install`
|
50
|
+
installed_by_version == Gem::Version.new(0)
|
51
|
+
end
|
52
|
+
|
53
|
+
# This is defined directly to avoid having to loading the full spec
|
54
|
+
def missing_extensions?
|
55
|
+
return false if default_gem?
|
56
|
+
return false if extensions.empty?
|
57
|
+
return false if File.exist? gem_build_complete_path
|
58
|
+
return false if manually_installed?
|
59
|
+
|
60
|
+
true
|
61
|
+
end
|
62
|
+
|
63
|
+
def activated?
|
64
|
+
stub.activated?
|
44
65
|
end
|
45
66
|
|
46
67
|
def activated=(activated)
|
47
68
|
stub.instance_variable_set(:@activated, activated)
|
48
69
|
end
|
49
70
|
|
50
|
-
def
|
51
|
-
stub.
|
71
|
+
def extensions
|
72
|
+
stub.extensions
|
73
|
+
end
|
74
|
+
|
75
|
+
def gem_build_complete_path
|
76
|
+
stub.gem_build_complete_path
|
77
|
+
end
|
78
|
+
|
79
|
+
def default_gem?
|
80
|
+
stub.default_gem?
|
52
81
|
end
|
53
82
|
|
54
83
|
def full_gem_path
|
55
|
-
|
56
|
-
# expired path from the full spec
|
57
|
-
stub.full_gem_path || method_missing(:full_gem_path)
|
84
|
+
stub.full_gem_path
|
58
85
|
end
|
59
86
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
87
|
+
def full_gem_path=(path)
|
88
|
+
stub.full_gem_path = path
|
89
|
+
end
|
64
90
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
91
|
+
def full_require_paths
|
92
|
+
stub.full_require_paths
|
93
|
+
end
|
94
|
+
|
95
|
+
def require_paths
|
96
|
+
stub.require_paths
|
97
|
+
end
|
98
|
+
|
99
|
+
def base_dir=(path)
|
100
|
+
stub.base_dir = path
|
101
|
+
end
|
102
|
+
|
103
|
+
def load_paths
|
104
|
+
full_require_paths
|
70
105
|
end
|
71
106
|
|
72
107
|
def loaded_from
|
73
108
|
stub.loaded_from
|
74
109
|
end
|
75
110
|
|
76
|
-
|
77
|
-
|
78
|
-
stub.matches_for_glob(glob)
|
79
|
-
end
|
111
|
+
def matches_for_glob(glob)
|
112
|
+
stub.matches_for_glob(glob)
|
80
113
|
end
|
81
114
|
|
82
115
|
def raw_require_paths
|
83
116
|
stub.raw_require_paths
|
84
117
|
end
|
85
118
|
|
86
|
-
|
119
|
+
def inspect
|
120
|
+
"#<#{self.class} @name=\"#{name}\" (#{full_name.delete_prefix("#{name}-")})>"
|
121
|
+
end
|
122
|
+
|
123
|
+
private
|
87
124
|
|
88
125
|
def _remote_specification
|
89
126
|
@_remote_specification ||= begin
|
@@ -100,6 +137,7 @@ module Bundler
|
|
100
137
|
end
|
101
138
|
|
102
139
|
rs.source = source
|
140
|
+
rs.base_dir = stub.base_dir
|
103
141
|
|
104
142
|
rs
|
105
143
|
end
|
@@ -8,14 +8,12 @@
|
|
8
8
|
# this file is here to facilitate running it.
|
9
9
|
#
|
10
10
|
|
11
|
-
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
14
12
|
|
15
|
-
bundle_binstub = File.expand_path("
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
16
14
|
|
17
15
|
if File.file?(bundle_binstub)
|
18
|
-
if File.read(bundle_binstub, 300)
|
16
|
+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
19
17
|
load(bundle_binstub)
|
20
18
|
else
|
21
19
|
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
@@ -11,7 +11,7 @@
|
|
11
11
|
require "rubygems"
|
12
12
|
|
13
13
|
m = Module.new do
|
14
|
-
|
14
|
+
module_function
|
15
15
|
|
16
16
|
def invoked_as_script?
|
17
17
|
File.expand_path($0) == File.expand_path(__FILE__)
|
@@ -27,11 +27,11 @@ m = Module.new do
|
|
27
27
|
bundler_version = nil
|
28
28
|
update_index = nil
|
29
29
|
ARGV.each_with_index do |a, i|
|
30
|
-
if update_index && update_index.succ == i && a
|
30
|
+
if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
|
31
31
|
bundler_version = a
|
32
32
|
end
|
33
33
|
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
-
bundler_version = $1
|
34
|
+
bundler_version = $1
|
35
35
|
update_index = i
|
36
36
|
end
|
37
37
|
bundler_version
|
@@ -41,13 +41,13 @@ m = Module.new do
|
|
41
41
|
gemfile = ENV["BUNDLE_GEMFILE"]
|
42
42
|
return gemfile if gemfile && !gemfile.empty?
|
43
43
|
|
44
|
-
File.expand_path("
|
44
|
+
File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
45
45
|
end
|
46
46
|
|
47
47
|
def lockfile
|
48
48
|
lockfile =
|
49
49
|
case File.basename(gemfile)
|
50
|
-
when "gems.rb" then gemfile.sub(/\.rb$/,
|
50
|
+
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
|
51
51
|
else "#{gemfile}.lock"
|
52
52
|
end
|
53
53
|
File.expand_path(lockfile)
|
@@ -60,33 +60,37 @@ m = Module.new do
|
|
60
60
|
Regexp.last_match(1)
|
61
61
|
end
|
62
62
|
|
63
|
-
def
|
64
|
-
@
|
65
|
-
env_var_version ||
|
66
|
-
|
67
|
-
|
63
|
+
def bundler_requirement
|
64
|
+
@bundler_requirement ||=
|
65
|
+
env_var_version ||
|
66
|
+
cli_arg_version ||
|
67
|
+
bundler_requirement_for(lockfile_version)
|
68
|
+
end
|
69
|
+
|
70
|
+
def bundler_requirement_for(version)
|
71
|
+
return "#{Gem::Requirement.default}.a" unless version
|
72
|
+
|
73
|
+
bundler_gem_version = Gem::Version.new(version)
|
74
|
+
|
75
|
+
bundler_gem_version.approximate_recommendation
|
68
76
|
end
|
69
77
|
|
70
78
|
def load_bundler!
|
71
79
|
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
72
80
|
|
73
|
-
|
74
|
-
activate_bundler(bundler_version.dup)
|
81
|
+
activate_bundler
|
75
82
|
end
|
76
83
|
|
77
|
-
def activate_bundler
|
78
|
-
if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
|
79
|
-
bundler_version = "< 2"
|
80
|
-
end
|
84
|
+
def activate_bundler
|
81
85
|
gem_error = activation_error_handling do
|
82
|
-
gem "bundler",
|
86
|
+
gem "bundler", bundler_requirement
|
83
87
|
end
|
84
88
|
return if gem_error.nil?
|
85
89
|
require_error = activation_error_handling do
|
86
90
|
require "bundler/version"
|
87
91
|
end
|
88
|
-
return if require_error.nil? && Gem::Requirement.new(
|
89
|
-
warn "Activating bundler (#{
|
92
|
+
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
93
|
+
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
90
94
|
exit 42
|
91
95
|
end
|
92
96
|
|