bundler 1.15.2 → 2.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2861 -1117
- data/LICENSE.md +18 -19
- data/README.md +22 -17
- data/bundler.gemspec +23 -27
- data/exe/bundle +27 -12
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +45 -0
- data/lib/bundler/capistrano.rb +7 -2
- data/lib/bundler/cli/add.rb +33 -12
- data/lib/bundler/cli/binstubs.rb +25 -9
- data/lib/bundler/cli/cache.rb +25 -17
- data/lib/bundler/cli/check.rb +8 -8
- data/lib/bundler/cli/clean.rb +6 -7
- data/lib/bundler/cli/common.rb +52 -15
- data/lib/bundler/cli/config.rb +171 -86
- data/lib/bundler/cli/console.rb +5 -4
- data/lib/bundler/cli/doctor.rb +72 -8
- data/lib/bundler/cli/exec.rb +13 -29
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +266 -48
- data/lib/bundler/cli/info.rb +52 -9
- data/lib/bundler/cli/init.rb +22 -6
- data/lib/bundler/cli/inject.rb +2 -1
- data/lib/bundler/cli/install.rb +74 -99
- data/lib/bundler/cli/issue.rb +9 -8
- data/lib/bundler/cli/list.rb +66 -0
- data/lib/bundler/cli/lock.rb +11 -5
- data/lib/bundler/cli/open.rb +14 -9
- data/lib/bundler/cli/outdated.rb +165 -123
- data/lib/bundler/cli/platform.rb +3 -2
- data/lib/bundler/cli/plugin.rb +20 -2
- data/lib/bundler/cli/pristine.rb +25 -6
- data/lib/bundler/cli/remove.rb +17 -0
- data/lib/bundler/cli/show.rb +3 -4
- data/lib/bundler/cli/update.rb +71 -12
- data/lib/bundler/cli/viz.rb +2 -1
- data/lib/bundler/cli.rb +394 -152
- data/lib/bundler/compact_index_client/cache.rb +8 -26
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +62 -51
- data/lib/bundler/compact_index_client.rb +29 -18
- data/lib/bundler/constants.rb +2 -1
- data/lib/bundler/current_ruby.rb +36 -13
- data/lib/bundler/definition.rb +417 -434
- data/lib/bundler/dependency.rb +34 -76
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/deprecate.rb +15 -3
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +135 -116
- data/lib/bundler/endpoint_specification.rb +26 -15
- data/lib/bundler/env.rb +95 -39
- data/lib/bundler/environment_preserver.rb +56 -8
- data/lib/bundler/errors.rb +32 -14
- data/lib/bundler/feature_flag.rb +29 -7
- data/lib/bundler/fetcher/base.rb +8 -9
- data/lib/bundler/fetcher/compact_index.rb +47 -49
- data/lib/bundler/fetcher/dependency.rb +5 -8
- data/lib/bundler/fetcher/downloader.rb +26 -17
- data/lib/bundler/fetcher/index.rb +5 -30
- data/lib/bundler/fetcher.rb +51 -46
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +53 -53
- data/lib/bundler/gem_helper.rb +95 -50
- data/lib/bundler/gem_helpers.rb +45 -28
- data/lib/bundler/gem_tasks.rb +2 -1
- data/lib/bundler/gem_version_promoter.rb +60 -90
- data/lib/bundler/graph.rb +6 -5
- data/lib/bundler/index.rb +23 -61
- data/lib/bundler/injector.rb +228 -32
- data/lib/bundler/inline.rb +29 -32
- data/lib/bundler/installer/gem_installer.rb +24 -16
- data/lib/bundler/installer/parallel_installer.rb +94 -71
- data/lib/bundler/installer/standalone.rb +63 -12
- data/lib/bundler/installer.rb +128 -94
- data/lib/bundler/lazy_specification.rb +89 -52
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +40 -66
- data/lib/bundler/man/bundle-add.1 +82 -0
- data/lib/bundler/man/bundle-add.1.ronn +58 -0
- data/lib/bundler/man/bundle-binstubs.1 +42 -0
- data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/lib/bundler/man/bundle-cache.1 +61 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +26 -14
- data/{man → lib/bundler/man}/bundle-check.1 +4 -4
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +3 -3
- data/{man → lib/bundler/man}/bundle-clean.1 +2 -2
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +175 -57
- data/lib/bundler/man/bundle-config.1.ronn +408 -0
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +44 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +11 -8
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +16 -9
- data/lib/bundler/man/bundle-gem.1 +105 -0
- data/lib/bundler/man/bundle-gem.1.ronn +117 -0
- data/lib/bundler/man/bundle-help.1 +13 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +29 -0
- data/lib/bundler/man/bundle-init.1.ronn +31 -0
- data/{man → lib/bundler/man}/bundle-inject.1 +7 -4
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +5 -3
- data/{man → lib/bundler/man}/bundle-install.1 +63 -55
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +81 -68
- data/lib/bundler/man/bundle-list.1 +50 -0
- data/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +22 -2
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +9 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +8 -11
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +7 -12
- data/{man → lib/bundler/man}/bundle-platform.1 +16 -6
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/lib/bundler/man/bundle-plugin.1 +81 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/lib/bundler/man/bundle-pristine.1 +34 -0
- data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/lib/bundler/man/bundle-remove.1 +31 -0
- data/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/{man → lib/bundler/man}/bundle-show.1 +3 -3
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +3 -2
- data/{man → lib/bundler/man}/bundle-update.1 +17 -13
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +27 -22
- data/lib/bundler/man/bundle-version.1 +35 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +10 -7
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +8 -6
- data/{man → lib/bundler/man}/bundle.1 +44 -31
- data/lib/bundler/man/bundle.1.ronn +116 -0
- data/{man → lib/bundler/man}/gemfile.5 +153 -83
- data/{man → lib/bundler/man}/gemfile.5.ronn +156 -93
- data/lib/bundler/man/index.txt +29 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +2 -2
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +16 -15
- data/lib/bundler/plugin/api/source.rb +35 -14
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +38 -10
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +35 -18
- data/lib/bundler/plugin/source_list.rb +11 -8
- data/lib/bundler/plugin.rb +115 -47
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/remote_specification.rb +12 -8
- data/lib/bundler/resolver/base.rb +107 -0
- data/lib/bundler/resolver/candidate.rb +94 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +72 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +82 -0
- data/lib/bundler/resolver.rb +327 -324
- data/lib/bundler/retry.rb +5 -4
- data/lib/bundler/ruby_dsl.rb +2 -1
- data/lib/bundler/ruby_version.rb +11 -38
- data/lib/bundler/rubygems_ext.rb +236 -90
- data/lib/bundler/rubygems_gem_installer.rb +104 -8
- data/lib/bundler/rubygems_integration.rb +204 -501
- data/lib/bundler/runtime.rb +35 -48
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/settings.rb +309 -142
- data/lib/bundler/setup.rb +15 -12
- data/lib/bundler/shared_helpers.rb +147 -83
- data/lib/bundler/similarity_detector.rb +4 -3
- data/lib/bundler/source/gemspec.rb +1 -0
- data/lib/bundler/source/git/git_proxy.rb +281 -125
- data/lib/bundler/source/git.rb +102 -73
- data/lib/bundler/source/metadata.rb +62 -0
- data/lib/bundler/source/path/installer.rb +13 -32
- data/lib/bundler/source/path.rb +36 -25
- data/lib/bundler/source/rubygems/remote.rb +9 -4
- data/lib/bundler/source/rubygems.rb +273 -226
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +65 -9
- data/lib/bundler/source_list.rb +138 -33
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +101 -72
- data/lib/bundler/stub_specification.rb +45 -36
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +13 -3
- data/lib/bundler/templates/Executable.bundler +109 -0
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +1 -2
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +22 -2
- data/lib/bundler/templates/newgem/README.md.tt +14 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +43 -5
- 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 -1
- 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 +5 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +39 -35
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
- 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 -1
- data/lib/bundler/ui/shell.rb +49 -17
- data/lib/bundler/ui/silent.rb +22 -5
- data/lib/bundler/ui.rb +4 -3
- data/lib/bundler/uri_credentials_filter.rb +11 -4
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.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 +128 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +2706 -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 +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -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 +302 -462
- 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 +60 -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 +243 -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/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +9 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +64 -16
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +27 -11
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +38 -16
- data/lib/bundler/vendor/thor/lib/thor/base.rb +84 -41
- data/lib/bundler/vendor/thor/lib/thor/command.rb +30 -21
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +18 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +83 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- 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/arguments.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +22 -9
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +45 -10
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +17 -14
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +97 -21
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +39 -15
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +729 -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 +1587 -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 +539 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +119 -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 +4 -0
- data/lib/bundler/vendored_persistent.rb +6 -8
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +2 -1
- data/lib/bundler/vendored_thor.rb +3 -2
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +8 -19
- data/lib/bundler/vlad.rb +6 -1
- data/lib/bundler/worker.rb +26 -14
- data/lib/bundler/yaml_serializer.rb +6 -7
- data/lib/bundler.rb +336 -199
- metadata +174 -236
- data/.codeclimate.yml +0 -25
- data/.gitignore +0 -18
- data/.rspec +0 -3
- data/.rubocop.yml +0 -131
- data/.rubocop_todo.yml +0 -418
- data/.travis.yml +0 -122
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -17
- data/Rakefile +0 -338
- data/bin/rake +0 -19
- data/bin/rspec +0 -15
- data/bin/rubocop +0 -17
- data/bin/with_rubygems +0 -39
- data/doc/README.md +0 -30
- data/doc/TROUBLESHOOTING.md +0 -64
- data/doc/contributing/BUG_TRIAGE.md +0 -36
- data/doc/contributing/COMMUNITY.md +0 -13
- data/doc/contributing/GETTING_HELP.md +0 -11
- data/doc/contributing/HOW_YOU_CAN_HELP.md +0 -27
- data/doc/contributing/ISSUES.md +0 -51
- data/doc/contributing/README.md +0 -38
- data/doc/development/NEW_FEATURES.md +0 -10
- data/doc/development/PULL_REQUESTS.md +0 -40
- data/doc/development/README.md +0 -19
- data/doc/development/RELEASING.md +0 -9
- data/doc/development/SETUP.md +0 -27
- data/doc/documentation/README.md +0 -29
- data/doc/documentation/VISION.md +0 -26
- data/doc/documentation/WRITING.md +0 -54
- data/exe/bundle_ruby +0 -59
- data/lib/bundler/cli/package.rb +0 -46
- data/lib/bundler/dep_proxy.rb +0 -46
- data/lib/bundler/gem_remote_fetcher.rb +0 -42
- data/lib/bundler/gemdeps.rb +0 -28
- data/lib/bundler/psyched_yaml.rb +0 -27
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -65
- 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/newgem/.travis.yml.tt +0 -5
- 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/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -50
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -80
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -35
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -65
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -60
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -125
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -45
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -35
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -125
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -222
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -75
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -100
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -65
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -494
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -45
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -54
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -10
- 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 -75
- data/man/bundle-add.1 +0 -43
- data/man/bundle-add.1.txt +0 -40
- data/man/bundle-add.ronn +0 -29
- data/man/bundle-binstubs.1 +0 -30
- data/man/bundle-binstubs.1.txt +0 -33
- data/man/bundle-binstubs.ronn +0 -29
- data/man/bundle-check.1.txt +0 -32
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -418
- data/man/bundle-config.ronn +0 -318
- data/man/bundle-exec.1.txt +0 -171
- data/man/bundle-gem.1 +0 -80
- data/man/bundle-gem.1.txt +0 -90
- data/man/bundle-gem.ronn +0 -77
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1 +0 -20
- data/man/bundle-init.1.txt +0 -24
- data/man/bundle-init.ronn +0 -18
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -385
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -127
- data/man/bundle-package.1 +0 -52
- data/man/bundle-package.1.txt +0 -74
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1 +0 -16
- data/man/bundle-pristine.1.txt +0 -21
- data/man/bundle-pristine.ronn +0 -13
- data/man/bundle-show.1.txt +0 -25
- data/man/bundle-update.1.txt +0 -388
- data/man/bundle-viz.1.txt +0 -37
- data/man/bundle.1.txt +0 -110
- data/man/bundle.ronn +0 -105
- data/man/gemfile.5.txt +0 -600
- data/man/index.txt +0 -15
- data/task/release.rake +0 -116
- /data/lib/bundler/{ssl_certs → man}/.document +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
require_relative "../worker"
|
4
|
+
require_relative "gem_installer"
|
4
5
|
|
5
6
|
module Bundler
|
6
7
|
class ParallelInstaller
|
7
8
|
class SpecInstallation
|
8
|
-
attr_accessor :spec, :name, :post_install_message, :state, :error
|
9
|
+
attr_accessor :spec, :name, :full_name, :post_install_message, :state, :error
|
9
10
|
def initialize(spec)
|
10
11
|
@spec = spec
|
11
12
|
@name = spec.name
|
13
|
+
@full_name = spec.full_name
|
12
14
|
@state = :none
|
13
15
|
@post_install_message = ""
|
14
16
|
@error = nil
|
@@ -26,13 +28,8 @@ module Bundler
|
|
26
28
|
state == :failed
|
27
29
|
end
|
28
30
|
|
29
|
-
def installation_attempted?
|
30
|
-
installed? || failed?
|
31
|
-
end
|
32
|
-
|
33
|
-
# Only true when spec in neither installed nor already enqueued
|
34
31
|
def ready_to_enqueue?
|
35
|
-
|
32
|
+
state == :none
|
36
33
|
end
|
37
34
|
|
38
35
|
def has_post_install_message?
|
@@ -53,14 +50,7 @@ module Bundler
|
|
53
50
|
# Represents only the non-development dependencies, the ones that are
|
54
51
|
# itself and are in the total list.
|
55
52
|
def dependencies
|
56
|
-
@dependencies ||=
|
57
|
-
all_dependencies.reject {|dep| ignorable_dependency? dep }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def missing_lockfile_dependencies(all_spec_names)
|
62
|
-
deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
|
63
|
-
deps.reject {|dep| all_spec_names.include? dep.name }
|
53
|
+
@dependencies ||= all_dependencies.reject {|dep| ignorable_dependency? dep }
|
64
54
|
end
|
65
55
|
|
66
56
|
# Represents all dependencies
|
@@ -69,7 +59,7 @@ module Bundler
|
|
69
59
|
end
|
70
60
|
|
71
61
|
def to_s
|
72
|
-
"#<#{self.class} #{
|
62
|
+
"#<#{self.class} #{full_name} (#{state})>"
|
73
63
|
end
|
74
64
|
end
|
75
65
|
|
@@ -77,11 +67,6 @@ module Bundler
|
|
77
67
|
new(*args).call
|
78
68
|
end
|
79
69
|
|
80
|
-
# Returns max number of threads machine can handle with a min of 1
|
81
|
-
def self.max_threads
|
82
|
-
[Bundler.settings[:jobs].to_i - 1, 1].max
|
83
|
-
end
|
84
|
-
|
85
70
|
attr_reader :size
|
86
71
|
|
87
72
|
def initialize(installer, all_specs, size, standalone, force)
|
@@ -91,80 +76,118 @@ module Bundler
|
|
91
76
|
@force = force
|
92
77
|
@specs = all_specs.map {|s| SpecInstallation.new(s) }
|
93
78
|
@spec_set = all_specs
|
79
|
+
@rake = @specs.find {|s| s.name == "rake" }
|
94
80
|
end
|
95
81
|
|
96
82
|
def call
|
97
|
-
|
98
|
-
|
99
|
-
|
83
|
+
if @rake
|
84
|
+
do_install(@rake, 0)
|
85
|
+
Gem::Specification.reset
|
86
|
+
end
|
100
87
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
88
|
+
if @size > 1
|
89
|
+
install_with_worker
|
90
|
+
else
|
91
|
+
install_serially
|
92
|
+
end
|
93
|
+
|
94
|
+
check_for_unmet_dependencies
|
95
|
+
|
96
|
+
handle_error if failed_specs.any?
|
105
97
|
@specs
|
106
98
|
ensure
|
107
99
|
worker_pool && worker_pool.stop
|
108
100
|
end
|
109
101
|
|
110
|
-
def
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
102
|
+
def check_for_unmet_dependencies
|
103
|
+
unmet_dependencies = @specs.map do |s|
|
104
|
+
[
|
105
|
+
s,
|
106
|
+
s.dependencies.reject {|dep| @specs.any? {|spec| dep.matches_spec?(spec.spec) } },
|
107
|
+
]
|
108
|
+
end.reject {|a| a.last.empty? }
|
109
|
+
return if unmet_dependencies.empty?
|
110
|
+
|
111
|
+
warning = []
|
112
|
+
warning << "Your lockfile doesn't include a valid resolution."
|
113
|
+
warning << "You can fix this by regenerating your lockfile or manually editing the bad locked gems to a version that satisfies all dependencies."
|
114
|
+
warning << "The unmet dependencies are:"
|
115
|
+
|
116
|
+
unmet_dependencies.each do |spec, unmet_spec_dependencies|
|
117
|
+
unmet_spec_dependencies.each do |unmet_spec_dependency|
|
118
|
+
found = @specs.find {|s| s.name == unmet_spec_dependency.name && !unmet_spec_dependency.matches_spec?(s.spec) }
|
119
|
+
warning << "* #{unmet_spec_dependency}, dependency of #{spec.full_name}, unsatisfied by #{found.full_name}"
|
121
120
|
end
|
122
|
-
|
121
|
+
end
|
122
|
+
|
123
|
+
Bundler.ui.warn(warning.join("\n"))
|
124
|
+
end
|
125
|
+
|
126
|
+
private
|
127
|
+
|
128
|
+
def failed_specs
|
129
|
+
@specs.select(&:failed?)
|
130
|
+
end
|
131
|
+
|
132
|
+
def install_with_worker
|
133
|
+
enqueue_specs
|
134
|
+
process_specs until finished_installing?
|
135
|
+
end
|
136
|
+
|
137
|
+
def install_serially
|
138
|
+
until finished_installing?
|
139
|
+
raise "failed to find a spec to enqueue while installing serially" unless spec_install = @specs.find(&:ready_to_enqueue?)
|
140
|
+
spec_install.state = :enqueued
|
141
|
+
do_install(spec_install, 0)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def worker_pool
|
146
|
+
@worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda {|spec_install, worker_num|
|
147
|
+
do_install(spec_install, worker_num)
|
123
148
|
}
|
124
149
|
end
|
125
150
|
|
151
|
+
def do_install(spec_install, worker_num)
|
152
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL, spec_install)
|
153
|
+
gem_installer = Bundler::GemInstaller.new(
|
154
|
+
spec_install.spec, @installer, @standalone, worker_num, @force
|
155
|
+
)
|
156
|
+
success, message = gem_installer.install_from_spec
|
157
|
+
if success
|
158
|
+
spec_install.state = :installed
|
159
|
+
spec_install.post_install_message = message unless message.nil?
|
160
|
+
else
|
161
|
+
spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
|
162
|
+
spec_install.state = :failed
|
163
|
+
end
|
164
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_INSTALL, spec_install)
|
165
|
+
spec_install
|
166
|
+
end
|
167
|
+
|
126
168
|
# Dequeue a spec and save its post-install message and then enqueue the
|
127
169
|
# remaining specs.
|
128
170
|
# Some specs might've had to wait til this spec was installed to be
|
129
171
|
# processed so the call to `enqueue_specs` is important after every
|
130
172
|
# dequeue.
|
131
173
|
def process_specs
|
132
|
-
|
133
|
-
spec.state = :installed unless spec.failed?
|
174
|
+
worker_pool.deq
|
134
175
|
enqueue_specs
|
135
176
|
end
|
136
177
|
|
137
|
-
def
|
138
|
-
|
139
|
-
|
140
|
-
|
178
|
+
def finished_installing?
|
179
|
+
@specs.all? do |spec|
|
180
|
+
return true if spec.failed?
|
181
|
+
spec.installed?
|
141
182
|
end
|
142
|
-
raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
|
143
183
|
end
|
144
184
|
|
145
|
-
def
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
s.missing_lockfile_dependencies(@specs.map(&:name)),
|
150
|
-
]
|
151
|
-
end.reject { |a| a.last.empty? }
|
152
|
-
return if missing_dependencies.empty?
|
153
|
-
|
154
|
-
warning = []
|
155
|
-
warning << "Your lockfile was created by an old Bundler that left some things out."
|
156
|
-
if @size != 1
|
157
|
-
warning << "Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing #{@size} at a time."
|
158
|
-
@size = 1
|
159
|
-
end
|
160
|
-
warning << "You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile."
|
161
|
-
warning << "The missing gems are:"
|
162
|
-
|
163
|
-
missing_dependencies.each do |spec, missing|
|
164
|
-
warning << "* #{missing.map(&:name).join(", ")} depended upon by #{spec.name}"
|
185
|
+
def handle_error
|
186
|
+
errors = failed_specs.map(&:error)
|
187
|
+
if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
|
188
|
+
raise exception
|
165
189
|
end
|
166
|
-
|
167
|
-
Bundler.ui.warn(warning.join("\n"))
|
190
|
+
raise Bundler::InstallError, errors.join("\n\n")
|
168
191
|
end
|
169
192
|
|
170
193
|
def require_tree_for_spec(spec)
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class Standalone
|
4
5
|
def initialize(groups, definition)
|
5
|
-
@specs =
|
6
|
+
@specs = definition.specs_for(groups)
|
6
7
|
end
|
7
8
|
|
8
9
|
def generate
|
@@ -11,42 +12,92 @@ module Bundler
|
|
11
12
|
end
|
12
13
|
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
|
13
14
|
file.puts "require 'rbconfig'"
|
14
|
-
file.puts
|
15
|
-
file.puts
|
16
|
-
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
17
|
-
file.puts "path = File.expand_path('..', __FILE__)"
|
15
|
+
file.puts define_path_helpers
|
16
|
+
file.puts reverse_rubygems_kernel_mixin
|
18
17
|
paths.each do |path|
|
19
|
-
|
18
|
+
if Pathname.new(path).absolute?
|
19
|
+
file.puts %($:.unshift "#{path}")
|
20
|
+
else
|
21
|
+
file.puts %($:.unshift File.expand_path("\#{__dir__}/#{path}"))
|
22
|
+
end
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
24
|
-
|
27
|
+
private
|
25
28
|
|
26
29
|
def paths
|
27
30
|
@specs.map do |spec|
|
28
31
|
next if spec.name == "bundler"
|
29
32
|
Array(spec.require_paths).map do |path|
|
30
|
-
gem_path(path, spec).
|
33
|
+
gem_path(path, spec).
|
34
|
+
sub(version_dir, '#{RUBY_ENGINE}/#{Gem.ruby_api_version}').
|
35
|
+
sub(extensions_dir, 'extensions/\k<platform>/#{Gem.extension_api_version}')
|
31
36
|
# This is a static string intentionally. It's interpolated at a later time.
|
32
37
|
end
|
33
|
-
end.flatten
|
38
|
+
end.flatten.compact
|
34
39
|
end
|
35
40
|
|
36
41
|
def version_dir
|
37
|
-
"#{
|
42
|
+
"#{RUBY_ENGINE}/#{Gem.ruby_api_version}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def extensions_dir
|
46
|
+
%r{extensions/(?<platform>[^/]+)/#{Regexp.escape(Gem.extension_api_version)}}
|
38
47
|
end
|
39
48
|
|
40
49
|
def bundler_path
|
41
|
-
Bundler.root.join(Bundler.settings[:path], "bundler")
|
50
|
+
Bundler.root.join(Bundler.settings[:path].to_s, "bundler")
|
42
51
|
end
|
43
52
|
|
44
53
|
def gem_path(path, spec)
|
45
54
|
full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
|
46
|
-
|
55
|
+
if spec.source.instance_of?(Source::Path) && spec.source.path.absolute?
|
56
|
+
full_path
|
57
|
+
else
|
58
|
+
Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
|
59
|
+
end
|
47
60
|
rescue TypeError
|
48
61
|
error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
|
49
62
|
raise Gem::InvalidSpecificationException.new(error_message)
|
50
63
|
end
|
64
|
+
|
65
|
+
def define_path_helpers
|
66
|
+
<<~'END'
|
67
|
+
unless defined?(Gem)
|
68
|
+
module Gem
|
69
|
+
def self.ruby_api_version
|
70
|
+
RbConfig::CONFIG["ruby_version"]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.extension_api_version
|
74
|
+
if 'no' == RbConfig::CONFIG['ENABLE_SHARED']
|
75
|
+
"#{ruby_api_version}-static"
|
76
|
+
else
|
77
|
+
ruby_api_version
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
END
|
83
|
+
end
|
84
|
+
|
85
|
+
def reverse_rubygems_kernel_mixin
|
86
|
+
<<~END
|
87
|
+
if Gem.respond_to?(:discover_gems_on_require=)
|
88
|
+
Gem.discover_gems_on_require = false
|
89
|
+
else
|
90
|
+
kernel = (class << ::Kernel; self; end)
|
91
|
+
[kernel, ::Kernel].each do |k|
|
92
|
+
if k.private_method_defined?(:gem_original_require)
|
93
|
+
private_require = k.private_method_defined?(:require)
|
94
|
+
k.send(:remove_method, :require)
|
95
|
+
k.send(:define_method, :require, k.instance_method(:gem_original_require))
|
96
|
+
k.send(:private, :require) if private_require
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
END
|
101
|
+
end
|
51
102
|
end
|
52
103
|
end
|
data/lib/bundler/installer.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
require "bundler/installer/gem_installer"
|
2
|
+
|
3
|
+
require_relative "worker"
|
4
|
+
require_relative "installer/parallel_installer"
|
5
|
+
require_relative "installer/standalone"
|
6
|
+
require_relative "installer/gem_installer"
|
8
7
|
|
9
8
|
module Bundler
|
10
9
|
class Installer
|
@@ -14,14 +13,15 @@ module Bundler
|
|
14
13
|
Installer.ambiguous_gems = []
|
15
14
|
end
|
16
15
|
|
17
|
-
attr_reader :post_install_messages
|
16
|
+
attr_reader :post_install_messages, :definition
|
18
17
|
|
19
18
|
# Begins the installation process for Bundler.
|
20
19
|
# For more information see the #run method on this class.
|
21
20
|
def self.install(root, definition, options = {})
|
22
21
|
installer = new(root, definition)
|
23
|
-
Plugin.hook(
|
22
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL_ALL, definition.dependencies)
|
24
23
|
installer.run(options)
|
24
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_INSTALL_ALL, definition.dependencies)
|
25
25
|
installer
|
26
26
|
end
|
27
27
|
|
@@ -33,25 +33,26 @@ module Bundler
|
|
33
33
|
|
34
34
|
# Runs the install procedures for a specific Gemfile.
|
35
35
|
#
|
36
|
-
# Firstly, this method will check to see if Bundler.bundle_path exists
|
37
|
-
# and if not then will create
|
38
|
-
#
|
36
|
+
# Firstly, this method will check to see if `Bundler.bundle_path` exists
|
37
|
+
# and if not then Bundler will create the directory. This is usually the same
|
38
|
+
# location as RubyGems which typically is the `~/.gem` directory
|
39
|
+
# unless other specified.
|
39
40
|
#
|
40
|
-
# Secondly, it checks if Bundler has been configured to be "frozen"
|
41
|
+
# Secondly, it checks if Bundler has been configured to be "frozen".
|
41
42
|
# Frozen ensures that the Gemfile and the Gemfile.lock file are matching.
|
42
43
|
# This stops a situation where a developer may update the Gemfile but may not run
|
43
44
|
# `bundle install`, which leads to the Gemfile.lock file not being correctly updated.
|
44
45
|
# If this file is not correctly updated then any other developer running
|
45
46
|
# `bundle install` will potentially not install the correct gems.
|
46
47
|
#
|
47
|
-
# Thirdly, Bundler checks if there are any dependencies specified in the Gemfile
|
48
|
-
#
|
49
|
-
#
|
48
|
+
# Thirdly, Bundler checks if there are any dependencies specified in the Gemfile.
|
49
|
+
# If there are no dependencies specified then Bundler returns a warning message stating
|
50
|
+
# so and this method returns.
|
50
51
|
#
|
51
|
-
# Fourthly, Bundler checks if the
|
52
|
-
# then proceeds to set up a definition based on the
|
53
|
-
#
|
54
|
-
#
|
52
|
+
# Fourthly, Bundler checks if the Gemfile.lock exists, and if so
|
53
|
+
# then proceeds to set up a definition based on the Gemfile and the Gemfile.lock.
|
54
|
+
# During this step Bundler will also download information about any new gems
|
55
|
+
# that are not in the Gemfile.lock and resolve any dependencies if needed.
|
55
56
|
#
|
56
57
|
# Fifthly, Bundler resolves the dependencies either through a cache of gems or by remote.
|
57
58
|
# This then leads into the gems being installed, along with stubs for their executables,
|
@@ -61,26 +62,37 @@ module Bundler
|
|
61
62
|
# Sixthly, a new Gemfile.lock is created from the installed gems to ensure that the next time
|
62
63
|
# that a user runs `bundle install` they will receive any updates from this process.
|
63
64
|
#
|
64
|
-
# Finally
|
65
|
+
# Finally, if the user has specified the standalone flag, Bundler will generate the needed
|
66
|
+
# require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
|
67
|
+
# information.
|
65
68
|
def run(options)
|
66
|
-
create_bundle_path
|
69
|
+
Bundler.create_bundle_path
|
67
70
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
+
ProcessLock.lock do
|
72
|
+
if Bundler.frozen_bundle?
|
73
|
+
@definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
|
74
|
+
end
|
71
75
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
76
|
+
if @definition.dependencies.empty?
|
77
|
+
Bundler.ui.warn "The Gemfile specifies no dependencies"
|
78
|
+
lock
|
79
|
+
return
|
80
|
+
end
|
81
|
+
|
82
|
+
if resolve_if_needed(options)
|
83
|
+
ensure_specs_are_compatible!
|
84
|
+
load_plugins
|
85
|
+
options.delete(:jobs)
|
86
|
+
else
|
87
|
+
options[:jobs] = 1 # to avoid the overhead of Bundler::Worker
|
88
|
+
end
|
89
|
+
install(options)
|
77
90
|
|
78
|
-
|
79
|
-
ensure_specs_are_compatible!
|
80
|
-
install(options)
|
91
|
+
Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
|
81
92
|
|
82
|
-
|
83
|
-
|
93
|
+
lock unless Bundler.frozen_bundle?
|
94
|
+
Standalone.new(options[:standalone], @definition).generate if options[:standalone]
|
95
|
+
end
|
84
96
|
end
|
85
97
|
|
86
98
|
def generate_bundler_executable_stubs(spec, options = {})
|
@@ -101,23 +113,35 @@ module Bundler
|
|
101
113
|
end
|
102
114
|
|
103
115
|
# double-assignment to avoid warnings about variables that will be used by ERB
|
104
|
-
bin_path =
|
105
|
-
|
106
|
-
relative_gemfile_path =
|
107
|
-
|
116
|
+
bin_path = Bundler.bin_path
|
117
|
+
bin_path = bin_path
|
118
|
+
relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
|
119
|
+
relative_gemfile_path = relative_gemfile_path
|
120
|
+
ruby_command = Thor::Util.ruby_command
|
121
|
+
ruby_command = ruby_command
|
122
|
+
template_path = File.expand_path("templates/Executable", __dir__)
|
123
|
+
if spec.name == "bundler"
|
124
|
+
template_path += ".bundler"
|
125
|
+
spec.executables = %(bundle)
|
126
|
+
end
|
127
|
+
template = File.read(template_path)
|
108
128
|
|
109
129
|
exists = []
|
110
130
|
spec.executables.each do |executable|
|
111
|
-
next if executable == "bundle"
|
112
|
-
|
113
131
|
binstub_path = "#{bin_path}/#{executable}"
|
114
132
|
if File.exist?(binstub_path) && !options[:force]
|
115
133
|
exists << executable
|
116
134
|
next
|
117
135
|
end
|
118
136
|
|
119
|
-
|
120
|
-
|
137
|
+
mode = Gem.win_platform? ? "wb:UTF-8" : "w"
|
138
|
+
require "erb"
|
139
|
+
content = ERB.new(template, :trim_mode => "-").result(binding)
|
140
|
+
|
141
|
+
File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
|
142
|
+
if Gem.win_platform? || options[:all_platforms]
|
143
|
+
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
144
|
+
File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
|
121
145
|
end
|
122
146
|
end
|
123
147
|
|
@@ -136,65 +160,86 @@ module Bundler
|
|
136
160
|
end
|
137
161
|
end
|
138
162
|
|
139
|
-
def generate_standalone_bundler_executable_stubs(spec)
|
163
|
+
def generate_standalone_bundler_executable_stubs(spec, options = {})
|
140
164
|
# double-assignment to avoid warnings about variables that will be used by ERB
|
141
165
|
bin_path = Bundler.bin_path
|
142
|
-
|
143
|
-
|
144
|
-
|
166
|
+
unless path = Bundler.settings[:path]
|
167
|
+
raise "Can't standalone without an explicit path set"
|
168
|
+
end
|
169
|
+
standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
|
170
|
+
standalone_path = standalone_path
|
171
|
+
template = File.read(File.expand_path("templates/Executable.standalone", __dir__))
|
172
|
+
ruby_command = Thor::Util.ruby_command
|
173
|
+
ruby_command = ruby_command
|
145
174
|
|
146
175
|
spec.executables.each do |executable|
|
147
176
|
next if executable == "bundle"
|
148
|
-
executable_path =
|
149
|
-
|
150
|
-
|
177
|
+
executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
|
178
|
+
executable_path = executable_path
|
179
|
+
|
180
|
+
mode = Gem.win_platform? ? "wb:UTF-8" : "w"
|
181
|
+
require "erb"
|
182
|
+
content = ERB.new(template, :trim_mode => "-").result(binding)
|
183
|
+
|
184
|
+
File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
|
185
|
+
if Gem.win_platform? || options[:all_platforms]
|
186
|
+
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
187
|
+
File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
|
151
188
|
end
|
152
189
|
end
|
153
190
|
end
|
154
191
|
|
155
|
-
|
192
|
+
private
|
156
193
|
|
157
194
|
# the order that the resolver provides is significant, since
|
158
195
|
# dependencies might affect the installation of a gem.
|
159
196
|
# that said, it's a rare situation (other than rake), and parallel
|
160
197
|
# installation is SO MUCH FASTER. so we let people opt in.
|
161
198
|
def install(options)
|
162
|
-
Bundler.rubygems.load_plugins
|
163
199
|
force = options["force"]
|
164
|
-
jobs =
|
165
|
-
jobs = [Bundler.settings[:jobs].to_i - 1, 1].max if can_install_in_parallel?
|
200
|
+
jobs = installation_parallelization(options)
|
166
201
|
install_in_parallel jobs, options[:standalone], force
|
167
202
|
end
|
168
203
|
|
204
|
+
def installation_parallelization(options)
|
205
|
+
if jobs = options.delete(:jobs)
|
206
|
+
return jobs
|
207
|
+
end
|
208
|
+
|
209
|
+
if jobs = Bundler.settings[:jobs]
|
210
|
+
return jobs
|
211
|
+
end
|
212
|
+
|
213
|
+
Bundler.settings.processor_count
|
214
|
+
end
|
215
|
+
|
216
|
+
def load_plugins
|
217
|
+
Bundler.rubygems.load_plugins
|
218
|
+
|
219
|
+
requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
|
220
|
+
path_plugin_files = requested_path_gems.map do |spec|
|
221
|
+
Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
|
222
|
+
rescue TypeError
|
223
|
+
error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
|
224
|
+
raise Gem::InvalidSpecificationException, error_message
|
225
|
+
end.flatten
|
226
|
+
Bundler.rubygems.load_plugin_files(path_plugin_files)
|
227
|
+
Bundler.rubygems.load_env_plugins
|
228
|
+
end
|
229
|
+
|
169
230
|
def ensure_specs_are_compatible!
|
170
|
-
system_ruby = Bundler::RubyVersion.system
|
171
|
-
rubygems_version = Gem::Version.create(Gem::VERSION)
|
172
231
|
@definition.specs.each do |spec|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
"which is incompatible with the current version, #{system_ruby}"
|
177
|
-
end
|
232
|
+
unless spec.matches_current_ruby?
|
233
|
+
raise InstallError, "#{spec.full_name} requires ruby version #{spec.required_ruby_version}, " \
|
234
|
+
"which is incompatible with the current version, #{Gem.ruby_version}"
|
178
235
|
end
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
"which is incompatible with the current version, #{rubygems_version}"
|
236
|
+
unless spec.matches_current_rubygems?
|
237
|
+
raise InstallError, "#{spec.full_name} requires rubygems version #{spec.required_rubygems_version}, " \
|
238
|
+
"which is incompatible with the current version, #{Gem.rubygems_version}"
|
183
239
|
end
|
184
240
|
end
|
185
241
|
end
|
186
242
|
|
187
|
-
def can_install_in_parallel?
|
188
|
-
if Bundler.rubygems.provides?(">= 2.1.0")
|
189
|
-
true
|
190
|
-
else
|
191
|
-
Bundler.ui.warn "Rubygems #{Gem::VERSION} is not threadsafe, so your "\
|
192
|
-
"gems will be installed one at a time. Upgrade to Rubygems 2.1.0 " \
|
193
|
-
"or higher to enable parallel gem installation."
|
194
|
-
false
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
243
|
def install_in_parallel(size, standalone, force = false)
|
199
244
|
spec_installations = ParallelInstaller.call(self, @definition.specs, size, standalone, force)
|
200
245
|
spec_installations.each do |installation|
|
@@ -202,28 +247,17 @@ module Bundler
|
|
202
247
|
end
|
203
248
|
end
|
204
249
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
end unless Bundler.bundle_path.exist?
|
209
|
-
rescue Errno::EEXIST
|
210
|
-
raise PathError, "Could not install to path `#{Bundler.settings[:path]}` " \
|
211
|
-
"because a file already exists at that path. Either remove or rename the file so the directory can be created."
|
212
|
-
end
|
250
|
+
# returns whether or not a re-resolve was needed
|
251
|
+
def resolve_if_needed(options)
|
252
|
+
@definition.resolution_mode = options
|
213
253
|
|
214
|
-
|
215
|
-
|
216
|
-
local = Bundler.ui.silence do
|
217
|
-
begin
|
218
|
-
tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
|
219
|
-
true unless tmpdef.new_platform? || tmpdef.missing_dependencies.any?
|
220
|
-
rescue BundlerError
|
221
|
-
end
|
222
|
-
end
|
254
|
+
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
255
|
+
return false if @definition.nothing_changed? && !@definition.missing_specs?
|
223
256
|
end
|
224
257
|
|
225
|
-
|
226
|
-
|
258
|
+
@definition.setup_sources_for_resolve
|
259
|
+
|
260
|
+
true
|
227
261
|
end
|
228
262
|
|
229
263
|
def lock(opts = {})
|