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,52 +1,60 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rubygems"
|
4
|
-
require "rubygems/config_file"
|
2
|
+
|
3
|
+
require "rubygems" unless defined?(Gem)
|
5
4
|
|
6
5
|
module Bundler
|
7
6
|
class RubygemsIntegration
|
8
7
|
if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
|
9
8
|
EXT_LOCK = Gem::Ext::Builder::CHDIR_MONITOR
|
10
9
|
else
|
11
|
-
|
12
|
-
end
|
10
|
+
require "monitor"
|
13
11
|
|
14
|
-
|
15
|
-
@version ||= Gem::Version.new(Gem::VERSION)
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.provides?(req_str)
|
19
|
-
Gem::Requirement.new(req_str).satisfied_by?(version)
|
12
|
+
EXT_LOCK = Monitor.new
|
20
13
|
end
|
21
14
|
|
22
15
|
def initialize
|
23
16
|
@replaced_methods = {}
|
17
|
+
backport_ext_builder_monitor
|
24
18
|
end
|
25
19
|
|
26
20
|
def version
|
27
|
-
|
21
|
+
@version ||= Gem.rubygems_version
|
28
22
|
end
|
29
23
|
|
30
24
|
def provides?(req_str)
|
31
|
-
|
25
|
+
Gem::Requirement.new(req_str).satisfied_by?(version)
|
26
|
+
end
|
27
|
+
|
28
|
+
def supports_bundler_trampolining?
|
29
|
+
provides?(">= 3.3.0.a")
|
32
30
|
end
|
33
31
|
|
34
32
|
def build_args
|
33
|
+
require "rubygems/command"
|
35
34
|
Gem::Command.build_args
|
36
35
|
end
|
37
36
|
|
38
37
|
def build_args=(args)
|
38
|
+
require "rubygems/command"
|
39
39
|
Gem::Command.build_args = args
|
40
40
|
end
|
41
41
|
|
42
|
-
def load_path_insert_index
|
43
|
-
Gem.load_path_insert_index
|
44
|
-
end
|
45
|
-
|
46
42
|
def loaded_specs(name)
|
47
43
|
Gem.loaded_specs[name]
|
48
44
|
end
|
49
45
|
|
46
|
+
def add_to_load_path(paths)
|
47
|
+
return Gem.add_to_load_path(*paths) if Gem.respond_to?(:add_to_load_path)
|
48
|
+
|
49
|
+
if insert_index = Gem.load_path_insert_index
|
50
|
+
# Gem directories must come after -I and ENV['RUBYLIB']
|
51
|
+
$LOAD_PATH.insert(insert_index, *paths)
|
52
|
+
else
|
53
|
+
# We are probably testing in core, -I and RUBYLIB don't apply
|
54
|
+
$LOAD_PATH.unshift(*paths)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
def mark_loaded(spec)
|
51
59
|
if spec.respond_to?(:activated=)
|
52
60
|
current = Gem.loaded_specs[spec.name]
|
@@ -74,14 +82,18 @@ module Bundler
|
|
74
82
|
def spec_missing_extensions?(spec, default = true)
|
75
83
|
return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
|
76
84
|
|
77
|
-
return false if
|
85
|
+
return false if spec.default_gem?
|
78
86
|
return false if spec.extensions.empty?
|
79
87
|
|
80
88
|
default
|
81
89
|
end
|
82
90
|
|
83
|
-
def
|
84
|
-
spec.
|
91
|
+
def spec_matches_for_glob(spec, glob)
|
92
|
+
return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
|
93
|
+
|
94
|
+
spec.load_paths.map do |lp|
|
95
|
+
Dir["#{lp}/#{glob}#{suffix_pattern}"]
|
96
|
+
end.flatten(1)
|
85
97
|
end
|
86
98
|
|
87
99
|
def stub_set_spec(stub, spec)
|
@@ -92,23 +104,6 @@ module Bundler
|
|
92
104
|
obj.to_s
|
93
105
|
end
|
94
106
|
|
95
|
-
def platforms
|
96
|
-
return [Gem::Platform::RUBY] if Bundler.settings[:force_ruby_platform]
|
97
|
-
Gem.platforms
|
98
|
-
end
|
99
|
-
|
100
|
-
def configuration
|
101
|
-
require "bundler/psyched_yaml"
|
102
|
-
Gem.configuration
|
103
|
-
rescue Gem::SystemExitException, LoadError => e
|
104
|
-
Bundler.ui.error "#{e.class}: #{e.message}"
|
105
|
-
Bundler.ui.trace e
|
106
|
-
raise
|
107
|
-
rescue YamlLibrarySyntaxError => e
|
108
|
-
raise YamlSyntaxError.new(e, "Your RubyGems configuration, which is " \
|
109
|
-
"usually located in ~/.gemrc, contains invalid YAML syntax.")
|
110
|
-
end
|
111
|
-
|
112
107
|
def ruby_engine
|
113
108
|
Gem.ruby_engine
|
114
109
|
end
|
@@ -118,20 +113,17 @@ module Bundler
|
|
118
113
|
end
|
119
114
|
|
120
115
|
def inflate(obj)
|
121
|
-
Gem.inflate(obj)
|
122
|
-
end
|
123
|
-
|
124
|
-
def sources=(val)
|
125
|
-
# Gem.configuration creates a new Gem::ConfigFile, which by default will read ~/.gemrc
|
126
|
-
# If that file exists, its settings (including sources) will overwrite the values we
|
127
|
-
# are about to set here. In order to avoid that, we force memoizing the config file now.
|
128
|
-
configuration
|
129
|
-
|
130
|
-
Gem.sources = val
|
116
|
+
Gem::Util.inflate(obj)
|
131
117
|
end
|
132
118
|
|
133
|
-
def
|
134
|
-
Gem.
|
119
|
+
def correct_for_windows_path(path)
|
120
|
+
if Gem::Util.respond_to?(:correct_for_windows_path)
|
121
|
+
Gem::Util.correct_for_windows_path(path)
|
122
|
+
elsif path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":"
|
123
|
+
path[1..-1]
|
124
|
+
else
|
125
|
+
path
|
126
|
+
end
|
135
127
|
end
|
136
128
|
|
137
129
|
def gem_dir
|
@@ -158,6 +150,10 @@ module Bundler
|
|
158
150
|
Gem.post_reset_hooks
|
159
151
|
end
|
160
152
|
|
153
|
+
def suffix_pattern
|
154
|
+
Gem.suffix_pattern
|
155
|
+
end
|
156
|
+
|
161
157
|
def gem_cache
|
162
158
|
gem_path.map {|p| File.expand_path("cache", p) }
|
163
159
|
end
|
@@ -165,7 +161,7 @@ module Bundler
|
|
165
161
|
def spec_cache_dirs
|
166
162
|
@spec_cache_dirs ||= begin
|
167
163
|
dirs = gem_path.map {|dir| File.join(dir, "specifications") }
|
168
|
-
dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in
|
164
|
+
dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in RubyGems 2.0.3 or earlier
|
169
165
|
dirs.uniq.select {|dir| File.directory? dir }
|
170
166
|
end
|
171
167
|
end
|
@@ -174,14 +170,6 @@ module Bundler
|
|
174
170
|
Gem::MARSHAL_SPEC_DIR
|
175
171
|
end
|
176
172
|
|
177
|
-
def config_map
|
178
|
-
Gem::ConfigMap
|
179
|
-
end
|
180
|
-
|
181
|
-
def repository_subdirectories
|
182
|
-
%w(cache doc gems specifications)
|
183
|
-
end
|
184
|
-
|
185
173
|
def clear_paths
|
186
174
|
Gem.clear_paths
|
187
175
|
end
|
@@ -190,123 +178,42 @@ module Bundler
|
|
190
178
|
Gem.bin_path(gem, bin, ver)
|
191
179
|
end
|
192
180
|
|
193
|
-
def preserve_paths
|
194
|
-
# this is a no-op outside of Rubygems 1.8
|
195
|
-
yield
|
196
|
-
end
|
197
|
-
|
198
181
|
def loaded_gem_paths
|
199
|
-
|
200
|
-
|
201
|
-
if Gem::Specification.method_defined? :full_require_paths
|
202
|
-
loaded_gem_paths = Gem.loaded_specs.map {|_, s| s.full_require_paths }
|
203
|
-
loaded_gem_paths.flatten
|
204
|
-
else
|
205
|
-
$LOAD_PATH.select do |p|
|
206
|
-
Bundler.rubygems.gem_path.any? {|gp| p =~ /^#{Regexp.escape(gp)}/ }
|
207
|
-
end
|
208
|
-
end
|
182
|
+
loaded_gem_paths = Gem.loaded_specs.map {|_, s| s.full_require_paths }
|
183
|
+
loaded_gem_paths.flatten
|
209
184
|
end
|
210
185
|
|
211
186
|
def load_plugins
|
212
187
|
Gem.load_plugins if Gem.respond_to?(:load_plugins)
|
213
188
|
end
|
214
189
|
|
215
|
-
def
|
216
|
-
Gem
|
217
|
-
end
|
218
|
-
|
219
|
-
def ext_lock
|
220
|
-
EXT_LOCK
|
221
|
-
end
|
222
|
-
|
223
|
-
def fetch_specs(all, pre, &blk)
|
224
|
-
require "rubygems/spec_fetcher"
|
225
|
-
specs = Gem::SpecFetcher.new.list(all, pre)
|
226
|
-
specs.each { yield } if block_given?
|
227
|
-
specs
|
228
|
-
end
|
229
|
-
|
230
|
-
def fetch_prerelease_specs
|
231
|
-
fetch_specs(false, true)
|
232
|
-
rescue Gem::RemoteFetcher::FetchError
|
233
|
-
{} # if we can't download them, there aren't any
|
234
|
-
end
|
235
|
-
|
236
|
-
# TODO: This is for older versions of Rubygems... should we support the
|
237
|
-
# X-Gemfile-Source header on these old versions?
|
238
|
-
# Maybe the newer implementation will work on older Rubygems?
|
239
|
-
# It seems difficult to keep this implementation and still send the header.
|
240
|
-
def fetch_all_remote_specs(remote)
|
241
|
-
old_sources = Bundler.rubygems.sources
|
242
|
-
Bundler.rubygems.sources = [remote.uri.to_s]
|
243
|
-
# Fetch all specs, minus prerelease specs
|
244
|
-
spec_list = fetch_specs(true, false)
|
245
|
-
# Then fetch the prerelease specs
|
246
|
-
fetch_prerelease_specs.each {|k, v| spec_list[k].concat(v) }
|
247
|
-
|
248
|
-
spec_list.values.first
|
249
|
-
ensure
|
250
|
-
Bundler.rubygems.sources = old_sources
|
251
|
-
end
|
252
|
-
|
253
|
-
def with_build_args(args)
|
254
|
-
ext_lock.synchronize do
|
255
|
-
old_args = build_args
|
256
|
-
begin
|
257
|
-
self.build_args = args
|
258
|
-
yield
|
259
|
-
ensure
|
260
|
-
self.build_args = old_args
|
261
|
-
end
|
262
|
-
end
|
190
|
+
def load_plugin_files(files)
|
191
|
+
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
|
263
192
|
end
|
264
193
|
|
265
|
-
def
|
266
|
-
|
194
|
+
def load_env_plugins
|
195
|
+
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
|
267
196
|
end
|
268
197
|
|
269
|
-
def
|
270
|
-
|
271
|
-
Gem::Format.from_file_by_path(path, policy)
|
198
|
+
def ui=(obj)
|
199
|
+
Gem::DefaultUserInteraction.ui = obj
|
272
200
|
end
|
273
201
|
|
274
|
-
def
|
275
|
-
|
276
|
-
gem_from_path(path, security_policies[policy]).spec
|
277
|
-
rescue Gem::Package::FormatError
|
278
|
-
raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
|
279
|
-
rescue Exception, Gem::Exception, Gem::Security::Exception => e
|
280
|
-
if e.is_a?(Gem::Security::Exception) ||
|
281
|
-
e.message =~ /unknown trust policy|unsigned gem/i ||
|
282
|
-
e.message =~ /couldn't verify (meta)?data signature/i
|
283
|
-
raise SecurityError,
|
284
|
-
"The gem #{File.basename(path, ".gem")} can't be installed because " \
|
285
|
-
"the security policy didn't allow it, with the message: #{e.message}"
|
286
|
-
else
|
287
|
-
raise e
|
288
|
-
end
|
202
|
+
def ext_lock
|
203
|
+
EXT_LOCK
|
289
204
|
end
|
290
205
|
|
291
|
-
def
|
292
|
-
require "rubygems/
|
293
|
-
Gem::
|
206
|
+
def spec_from_gem(path)
|
207
|
+
require "rubygems/package"
|
208
|
+
Gem::Package.new(path).spec
|
294
209
|
end
|
295
210
|
|
296
211
|
def build_gem(gem_dir, spec)
|
297
212
|
build(spec)
|
298
213
|
end
|
299
214
|
|
300
|
-
def download_gem(spec, uri, path)
|
301
|
-
uri = Bundler.settings.mirror_for(uri)
|
302
|
-
fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy])
|
303
|
-
Bundler::Retry.new("download gem #{uri}", Gem::RemoteFetcher::FetchError).attempts do
|
304
|
-
fetcher.download(spec, uri, path)
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
215
|
def security_policy_keys
|
309
|
-
%w
|
216
|
+
%w[High Medium Low AlmostNo No].map {|level| "#{level}Security" }
|
310
217
|
end
|
311
218
|
|
312
219
|
def security_policies
|
@@ -320,22 +227,18 @@ module Bundler
|
|
320
227
|
|
321
228
|
def reverse_rubygems_kernel_mixin
|
322
229
|
# Disable rubygems' gem activation system
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
230
|
+
if Gem.respond_to?(:discover_gems_on_require=)
|
231
|
+
Gem.discover_gems_on_require = false
|
232
|
+
else
|
233
|
+
kernel = (class << ::Kernel; self; end)
|
234
|
+
[kernel, ::Kernel].each do |k|
|
235
|
+
if k.private_method_defined?(:gem_original_require)
|
236
|
+
redefine_method(k, :require, k.instance_method(:gem_original_require))
|
237
|
+
end
|
327
238
|
end
|
328
239
|
end
|
329
240
|
end
|
330
241
|
|
331
|
-
def binstubs_call_gem?
|
332
|
-
true
|
333
|
-
end
|
334
|
-
|
335
|
-
def stubs_provide_full_functionality?
|
336
|
-
false
|
337
|
-
end
|
338
|
-
|
339
242
|
def replace_gem(specs, specs_by_name)
|
340
243
|
reverse_rubygems_kernel_mixin
|
341
244
|
|
@@ -344,7 +247,6 @@ module Bundler
|
|
344
247
|
kernel = (class << ::Kernel; self; end)
|
345
248
|
[kernel, ::Kernel].each do |kernel_class|
|
346
249
|
redefine_method(kernel_class, :gem) do |dep, *reqs|
|
347
|
-
executables ||= specs.map(&:executables).flatten if ::Bundler.rubygems.binstubs_call_gem?
|
348
250
|
if executables && executables.include?(File.basename(caller.first.split(":").first))
|
349
251
|
break
|
350
252
|
end
|
@@ -360,8 +262,13 @@ module Bundler
|
|
360
262
|
end
|
361
263
|
|
362
264
|
message = if spec.nil?
|
265
|
+
target_file = begin
|
266
|
+
Bundler.default_gemfile.basename
|
267
|
+
rescue GemfileNotFound
|
268
|
+
"inline Gemfile"
|
269
|
+
end
|
363
270
|
"#{dep.name} is not part of the bundle." \
|
364
|
-
" Add it to your #{
|
271
|
+
" Add it to your #{target_file}."
|
365
272
|
else
|
366
273
|
"can't activate #{dep}, already activated #{spec.full_name}. " \
|
367
274
|
"Make sure all dependencies are added to Gemfile."
|
@@ -369,77 +276,54 @@ module Bundler
|
|
369
276
|
|
370
277
|
e = Gem::LoadError.new(message)
|
371
278
|
e.name = dep.name
|
372
|
-
|
373
|
-
e.requirement = dep.requirement
|
374
|
-
elsif e.respond_to?(:version_requirement=)
|
375
|
-
e.version_requirement = dep.requirement
|
376
|
-
end
|
279
|
+
e.requirement = dep.requirement
|
377
280
|
raise e
|
378
281
|
end
|
379
282
|
|
380
|
-
#
|
381
|
-
|
382
|
-
kernel_class.send(:public, :gem)
|
383
|
-
end
|
384
|
-
end
|
385
|
-
|
386
|
-
def stub_source_index(specs)
|
387
|
-
Gem::SourceIndex.send(:alias_method, :old_initialize, :initialize)
|
388
|
-
redefine_method(Gem::SourceIndex, :initialize) do |*args|
|
389
|
-
@gems = {}
|
390
|
-
# You're looking at this thinking: Oh! This is how I make those
|
391
|
-
# rubygems deprecations go away!
|
392
|
-
#
|
393
|
-
# You'd be correct BUT using of this method in production code
|
394
|
-
# must be approved by the rubygems team itself!
|
395
|
-
#
|
396
|
-
# This is your warning. If you use this and don't have approval
|
397
|
-
# we can't protect you.
|
398
|
-
#
|
399
|
-
Deprecate.skip_during do
|
400
|
-
self.spec_dirs = *args
|
401
|
-
add_specs(*specs)
|
402
|
-
end
|
283
|
+
# backwards compatibility shim, see https://github.com/rubygems/bundler/issues/5102
|
284
|
+
kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
|
403
285
|
end
|
404
286
|
end
|
405
287
|
|
406
288
|
# Used to make bin stubs that are not created by bundler work
|
407
289
|
# under bundler. The new Gem.bin_path only considers gems in
|
408
290
|
# +specs+
|
409
|
-
def replace_bin_path(
|
291
|
+
def replace_bin_path(specs_by_name)
|
410
292
|
gem_class = (class << Gem; self; end)
|
411
293
|
|
412
294
|
redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
|
413
295
|
exec_name = args.first
|
296
|
+
raise ArgumentError, "you must supply exec_name" unless exec_name
|
414
297
|
|
415
298
|
spec_with_name = specs_by_name[gem_name]
|
416
|
-
|
417
|
-
|
418
|
-
spec_with_name
|
419
|
-
else
|
420
|
-
specs.find {|s| s.executables.include?(exec_name) }
|
421
|
-
end
|
422
|
-
else
|
423
|
-
spec_with_name
|
424
|
-
end
|
299
|
+
matching_specs_by_exec_name = specs_by_name.values.select {|s| s.executables.include?(exec_name) }
|
300
|
+
spec = matching_specs_by_exec_name.delete(spec_with_name)
|
425
301
|
|
426
|
-
unless spec
|
302
|
+
unless spec || !matching_specs_by_exec_name.empty?
|
427
303
|
message = "can't find executable #{exec_name} for gem #{gem_name}"
|
428
|
-
if
|
304
|
+
if spec_with_name.nil?
|
429
305
|
message += ". #{gem_name} is not currently included in the bundle, " \
|
430
306
|
"perhaps you meant to add it to your #{Bundler.default_gemfile.basename}?"
|
431
307
|
end
|
432
308
|
raise Gem::Exception, message
|
433
309
|
end
|
434
310
|
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
"Bundler is using a binstub that was created for a different gem.\n" \
|
311
|
+
unless spec
|
312
|
+
spec = matching_specs_by_exec_name.shift
|
313
|
+
warn \
|
314
|
+
"Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
|
440
315
|
"You should run `bundle binstub #{gem_name}` " \
|
441
316
|
"to work around a system/bundle conflict."
|
442
317
|
end
|
318
|
+
|
319
|
+
unless matching_specs_by_exec_name.empty?
|
320
|
+
conflicting_names = matching_specs_by_exec_name.map(&:name).join(", ")
|
321
|
+
warn \
|
322
|
+
"The `#{exec_name}` executable in the `#{spec.name}` gem is being loaded, but it's also present in other gems (#{conflicting_names}).\n" \
|
323
|
+
"If you meant to run the executable for another gem, make sure you use a project specific binstub (`bundle binstub <gem_name>`).\n" \
|
324
|
+
"If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names."
|
325
|
+
end
|
326
|
+
|
443
327
|
spec
|
444
328
|
end
|
445
329
|
|
@@ -469,83 +353,45 @@ module Bundler
|
|
469
353
|
end
|
470
354
|
end
|
471
355
|
|
472
|
-
#
|
473
|
-
# we don't #refresh, so stub it out.
|
474
|
-
def replace_refresh
|
475
|
-
gem_class = (class << Gem; self; end)
|
476
|
-
redefine_method(gem_class, :refresh) {}
|
477
|
-
end
|
478
|
-
|
479
|
-
# Replace or hook into Rubygems to provide a bundlerized view
|
356
|
+
# Replace or hook into RubyGems to provide a bundlerized view
|
480
357
|
# of the world.
|
481
358
|
def replace_entrypoints(specs)
|
482
|
-
specs_by_name = specs
|
483
|
-
h[s.name] = s
|
484
|
-
h
|
485
|
-
end
|
359
|
+
specs_by_name = add_default_gems_to(specs)
|
486
360
|
|
487
361
|
replace_gem(specs, specs_by_name)
|
488
362
|
stub_rubygems(specs)
|
489
|
-
replace_bin_path(
|
490
|
-
replace_refresh
|
363
|
+
replace_bin_path(specs_by_name)
|
491
364
|
|
492
365
|
Gem.clear_paths
|
493
366
|
end
|
494
367
|
|
495
|
-
#
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
/^\d+$/ =~ s ? s.to_i : s
|
501
|
-
end
|
502
|
-
end
|
503
|
-
end
|
504
|
-
|
505
|
-
# This backport fixes the marshaling of @segments.
|
506
|
-
def backport_yaml_initialize
|
507
|
-
redefine_method(Gem::Version, :yaml_initialize) do |_, map|
|
508
|
-
@version = map["version"]
|
509
|
-
@segments = nil
|
510
|
-
@hash = nil
|
511
|
-
end
|
512
|
-
end
|
513
|
-
|
514
|
-
# This backports base_dir which replaces installation path
|
515
|
-
# Rubygems 1.8+
|
516
|
-
def backport_base_dir
|
517
|
-
redefine_method(Gem::Specification, :base_dir) do
|
518
|
-
return Gem.dir unless loaded_from
|
519
|
-
File.dirname File.dirname loaded_from
|
520
|
-
end
|
521
|
-
end
|
522
|
-
|
523
|
-
def backport_cache_file
|
524
|
-
redefine_method(Gem::Specification, :cache_dir) do
|
525
|
-
@cache_dir ||= File.join base_dir, "cache"
|
368
|
+
# Add default gems not already present in specs, and return them as a hash.
|
369
|
+
def add_default_gems_to(specs)
|
370
|
+
specs_by_name = specs.reduce({}) do |h, s|
|
371
|
+
h[s.name] = s
|
372
|
+
h
|
526
373
|
end
|
527
374
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
375
|
+
Bundler.rubygems.default_stubs.each do |stub|
|
376
|
+
default_spec = stub.to_spec
|
377
|
+
default_spec_name = default_spec.name
|
378
|
+
next if specs_by_name.key?(default_spec_name)
|
532
379
|
|
533
|
-
|
534
|
-
|
535
|
-
@spec_dir ||= File.join base_dir, "specifications"
|
380
|
+
specs << default_spec
|
381
|
+
specs_by_name[default_spec_name] = default_spec
|
536
382
|
end
|
537
383
|
|
538
|
-
|
539
|
-
@spec_file ||= File.join spec_dir, "#{full_name}.gemspec"
|
540
|
-
end
|
384
|
+
specs_by_name
|
541
385
|
end
|
542
386
|
|
543
387
|
def undo_replacements
|
544
388
|
@replaced_methods.each do |(sym, klass), method|
|
545
389
|
redefine_method(klass, sym, method)
|
546
390
|
end
|
547
|
-
|
548
|
-
proc.binding.
|
391
|
+
if Binding.public_method_defined?(:source_location)
|
392
|
+
post_reset_hooks.reject! {|proc| proc.binding.source_location[0] == __FILE__ }
|
393
|
+
else
|
394
|
+
post_reset_hooks.reject! {|proc| proc.binding.eval("__FILE__") == __FILE__ }
|
549
395
|
end
|
550
396
|
@replaced_methods.clear
|
551
397
|
end
|
@@ -581,279 +427,136 @@ module Bundler
|
|
581
427
|
end
|
582
428
|
end
|
583
429
|
|
584
|
-
|
585
|
-
|
586
|
-
def initialize
|
587
|
-
super
|
588
|
-
backport_base_dir
|
589
|
-
backport_cache_file
|
590
|
-
backport_spec_file
|
591
|
-
backport_yaml_initialize
|
592
|
-
end
|
593
|
-
|
594
|
-
def stub_rubygems(specs)
|
595
|
-
# Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
|
596
|
-
source_index_class = (class << Gem::SourceIndex; self; end)
|
597
|
-
redefine_method(source_index_class, :from_gems_in) do |*args|
|
598
|
-
Gem::SourceIndex.new.tap do |source_index|
|
599
|
-
source_index.spec_dirs = *args
|
600
|
-
source_index.add_specs(*specs)
|
601
|
-
end
|
602
|
-
end
|
603
|
-
end
|
604
|
-
|
605
|
-
def all_specs
|
606
|
-
Gem.source_index.gems.values
|
607
|
-
end
|
608
|
-
|
609
|
-
def find_name(name)
|
610
|
-
Gem.source_index.find_name(name)
|
611
|
-
end
|
430
|
+
def stub_rubygems(specs)
|
431
|
+
Gem::Specification.all = specs
|
612
432
|
|
613
|
-
|
614
|
-
|
615
|
-
# which is too strict for the kinds of checks we care about. As a
|
616
|
-
# result, validation is disabled on versions of RubyGems below 1.7.
|
433
|
+
Gem.post_reset do
|
434
|
+
Gem::Specification.all = specs
|
617
435
|
end
|
618
436
|
|
619
|
-
|
437
|
+
redefine_method((class << Gem; self; end), :finish_resolve) do |*|
|
620
438
|
[]
|
621
439
|
end
|
622
|
-
|
623
|
-
def reset
|
624
|
-
end
|
625
440
|
end
|
626
441
|
|
627
|
-
|
628
|
-
|
629
|
-
def initialize
|
630
|
-
super
|
631
|
-
backport_segment_generation
|
632
|
-
end
|
442
|
+
def plain_specs
|
443
|
+
Gem::Specification._all
|
633
444
|
end
|
634
445
|
|
635
|
-
|
636
|
-
|
637
|
-
def stub_rubygems(specs)
|
638
|
-
stub_source_index(specs)
|
639
|
-
end
|
640
|
-
|
641
|
-
def validate(spec)
|
642
|
-
# Missing summary is downgraded to a warning in later versions,
|
643
|
-
# so we set it to an empty string to prevent an exception here.
|
644
|
-
spec.summary ||= ""
|
645
|
-
RubygemsIntegration.instance_method(:validate).bind(self).call(spec)
|
646
|
-
end
|
446
|
+
def plain_specs=(specs)
|
447
|
+
Gem::Specification.all = specs
|
647
448
|
end
|
648
449
|
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
end
|
660
|
-
|
661
|
-
def all_specs
|
662
|
-
Gem::Specification.to_a
|
663
|
-
end
|
664
|
-
|
665
|
-
def find_name(name)
|
666
|
-
Gem::Specification.find_all_by_name name
|
667
|
-
end
|
450
|
+
def fetch_specs(remote, name)
|
451
|
+
require "rubygems/remote_fetcher"
|
452
|
+
path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
|
453
|
+
fetcher = gem_remote_fetcher
|
454
|
+
fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
|
455
|
+
string = fetcher.fetch_path(path)
|
456
|
+
Bundler.safe_load_marshal(string)
|
457
|
+
rescue Gem::RemoteFetcher::FetchError
|
458
|
+
# it's okay for prerelease to fail
|
459
|
+
raise unless name == "prerelease_specs"
|
668
460
|
end
|
669
461
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
# you call Gem::Installer#install with an :install_dir set. We have to
|
674
|
-
# change it back for our sudo mode to work.
|
675
|
-
def preserve_paths
|
676
|
-
old_dir = gem_dir
|
677
|
-
old_path = gem_path
|
678
|
-
yield
|
679
|
-
Gem.use_paths(old_dir, old_path)
|
680
|
-
end
|
681
|
-
end
|
462
|
+
def fetch_all_remote_specs(remote)
|
463
|
+
specs = fetch_specs(remote, "specs")
|
464
|
+
pres = fetch_specs(remote, "prerelease_specs") || []
|
682
465
|
|
683
|
-
|
684
|
-
class MoreModern < Modern
|
685
|
-
# Rubygems 1.8.20 and adds the skip_validation parameter, so that's
|
686
|
-
# when we start passing it through.
|
687
|
-
def build(spec, skip_validation = false)
|
688
|
-
require "rubygems/builder"
|
689
|
-
Gem::Builder.new(spec).build(skip_validation)
|
690
|
-
end
|
466
|
+
specs.concat(pres)
|
691
467
|
end
|
692
468
|
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
redefine_method((class << Gem; self; end), :finish_resolve) do |*|
|
703
|
-
[]
|
704
|
-
end
|
705
|
-
end
|
706
|
-
|
707
|
-
def all_specs
|
708
|
-
Gem::Specification.to_a
|
709
|
-
end
|
710
|
-
|
711
|
-
def find_name(name)
|
712
|
-
Gem::Specification.find_all_by_name name
|
713
|
-
end
|
714
|
-
|
715
|
-
def fetch_specs(source, remote, name)
|
716
|
-
path = source + "#{name}.#{Gem.marshal_version}.gz"
|
717
|
-
fetcher = gem_remote_fetcher
|
718
|
-
fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
|
719
|
-
string = fetcher.fetch_path(path)
|
720
|
-
Bundler.load_marshal(string)
|
721
|
-
rescue Gem::RemoteFetcher::FetchError => e
|
722
|
-
# it's okay for prerelease to fail
|
723
|
-
raise e unless name == "prerelease_specs"
|
724
|
-
end
|
725
|
-
|
726
|
-
def fetch_all_remote_specs(remote)
|
727
|
-
source = remote.uri.is_a?(URI) ? remote.uri : URI.parse(source.to_s)
|
728
|
-
|
729
|
-
specs = fetch_specs(source, remote, "specs")
|
730
|
-
pres = fetch_specs(source, remote, "prerelease_specs") || []
|
469
|
+
def download_gem(spec, uri, cache_dir)
|
470
|
+
require "rubygems/remote_fetcher"
|
471
|
+
uri = Bundler.settings.mirror_for(uri)
|
472
|
+
fetcher = gem_remote_fetcher
|
473
|
+
fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
|
474
|
+
Bundler::Retry.new("download gem from #{uri}").attempts do
|
475
|
+
gem_file_name = spec.file_name
|
476
|
+
local_gem_path = File.join cache_dir, gem_file_name
|
477
|
+
return if File.exist? local_gem_path
|
731
478
|
|
732
|
-
|
733
|
-
|
479
|
+
begin
|
480
|
+
remote_gem_path = uri + "gems/#{gem_file_name}"
|
481
|
+
remote_gem_path = remote_gem_path.to_s if provides?("< 3.2.0.rc.1")
|
734
482
|
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
end
|
483
|
+
SharedHelpers.filesystem_access(local_gem_path) do
|
484
|
+
fetcher.cache_update_path remote_gem_path, local_gem_path
|
485
|
+
end
|
486
|
+
rescue Gem::RemoteFetcher::FetchError
|
487
|
+
raise if spec.original_platform == spec.platform
|
741
488
|
|
742
|
-
|
743
|
-
|
744
|
-
proxy = configuration[:http_proxy]
|
745
|
-
dns = Resolv::DNS.new
|
746
|
-
Bundler::GemRemoteFetcher.new(proxy, dns)
|
747
|
-
end
|
489
|
+
original_gem_file_name = "#{spec.original_name}.gem"
|
490
|
+
raise if gem_file_name == original_gem_file_name
|
748
491
|
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
p.security_policy = policy if policy
|
753
|
-
p
|
492
|
+
gem_file_name = original_gem_file_name
|
493
|
+
retry
|
494
|
+
end
|
754
495
|
end
|
496
|
+
rescue Gem::RemoteFetcher::FetchError => e
|
497
|
+
raise Bundler::HTTPError, "Could not download gem from #{uri} due to underlying error <#{e.message}>"
|
498
|
+
end
|
755
499
|
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
500
|
+
def gem_remote_fetcher
|
501
|
+
require "rubygems/remote_fetcher"
|
502
|
+
proxy = Gem.configuration[:http_proxy]
|
503
|
+
Gem::RemoteFetcher.new(proxy)
|
504
|
+
end
|
760
505
|
|
761
|
-
|
762
|
-
|
763
|
-
|
506
|
+
def build(spec, skip_validation = false)
|
507
|
+
require "rubygems/package"
|
508
|
+
Gem::Package.build(spec, skip_validation)
|
509
|
+
end
|
764
510
|
|
765
|
-
|
766
|
-
|
767
|
-
end
|
511
|
+
def path_separator
|
512
|
+
Gem.path_separator
|
768
513
|
end
|
769
514
|
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
super
|
774
|
-
backport_ext_builder_monitor
|
515
|
+
def all_specs
|
516
|
+
Gem::Specification.stubs.map do |stub|
|
517
|
+
StubSpecification.from_stub(stub)
|
775
518
|
end
|
519
|
+
end
|
776
520
|
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
521
|
+
def backport_ext_builder_monitor
|
522
|
+
# So we can avoid requiring "rubygems/ext" in its entirety
|
523
|
+
Gem.module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
524
|
+
module Ext
|
781
525
|
end
|
782
|
-
|
526
|
+
RUBY
|
783
527
|
|
784
|
-
|
785
|
-
# So we can avoid requiring "rubygems/ext" in its entirety
|
786
|
-
Gem.module_eval <<-RB, __FILE__, __LINE__ + 1
|
787
|
-
module Ext
|
788
|
-
end
|
789
|
-
RB
|
790
|
-
|
791
|
-
require "rubygems/ext/builder"
|
792
|
-
|
793
|
-
Gem::Ext::Builder.class_eval do
|
794
|
-
unless const_defined?(:CHDIR_MONITOR)
|
795
|
-
const_set(:CHDIR_MONITOR, EXT_LOCK)
|
796
|
-
end
|
528
|
+
require "rubygems/ext/builder"
|
797
529
|
|
798
|
-
|
799
|
-
|
530
|
+
Gem::Ext::Builder.class_eval do
|
531
|
+
unless const_defined?(:CHDIR_MONITOR)
|
532
|
+
const_set(:CHDIR_MONITOR, EXT_LOCK)
|
800
533
|
end
|
801
|
-
end
|
802
534
|
|
803
|
-
|
804
|
-
|
805
|
-
Gem::Specification.stubs_for(name).map(&:to_spec)
|
806
|
-
end
|
807
|
-
else
|
808
|
-
def find_name(name)
|
809
|
-
Gem::Specification.stubs.find_all do |spec|
|
810
|
-
spec.name == name
|
811
|
-
end.map(&:to_spec)
|
812
|
-
end
|
535
|
+
remove_const(:CHDIR_MUTEX) if const_defined?(:CHDIR_MUTEX)
|
536
|
+
const_set(:CHDIR_MUTEX, const_get(:CHDIR_MONITOR))
|
813
537
|
end
|
538
|
+
end
|
814
539
|
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
Bundler.ui = nil
|
819
|
-
activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
|
820
|
-
[Gemdeps.new(runtime), activated_spec_names]
|
821
|
-
end
|
540
|
+
def find_bundler(version)
|
541
|
+
find_name("bundler").find {|s| s.version.to_s == version }
|
542
|
+
end
|
822
543
|
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
false
|
827
|
-
end
|
544
|
+
def find_name(name)
|
545
|
+
Gem::Specification.stubs_for(name).map(&:to_spec)
|
546
|
+
end
|
828
547
|
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
548
|
+
if Gem::Specification.respond_to?(:default_stubs)
|
549
|
+
def default_stubs
|
550
|
+
Gem::Specification.default_stubs("*.gemspec")
|
551
|
+
end
|
552
|
+
else
|
553
|
+
def default_stubs
|
554
|
+
Gem::Specification.send(:default_stubs, "*.gemspec")
|
836
555
|
end
|
837
556
|
end
|
838
557
|
end
|
839
558
|
|
840
559
|
def self.rubygems
|
841
|
-
@rubygems ||=
|
842
|
-
RubygemsIntegration::MoreFuture.new
|
843
|
-
elsif RubygemsIntegration.provides?(">= 1.99.99")
|
844
|
-
RubygemsIntegration::Future.new
|
845
|
-
elsif RubygemsIntegration.provides?(">= 1.8.20")
|
846
|
-
RubygemsIntegration::MoreModern.new
|
847
|
-
elsif RubygemsIntegration.provides?(">= 1.8.5")
|
848
|
-
RubygemsIntegration::Modern.new
|
849
|
-
elsif RubygemsIntegration.provides?(">= 1.8.0")
|
850
|
-
RubygemsIntegration::AlmostModern.new
|
851
|
-
elsif RubygemsIntegration.provides?(">= 1.7.0")
|
852
|
-
RubygemsIntegration::Transitional.new
|
853
|
-
elsif RubygemsIntegration.provides?(">= 1.4.0")
|
854
|
-
RubygemsIntegration::Legacy.new
|
855
|
-
else # Rubygems 1.3.6 and 1.3.7
|
856
|
-
RubygemsIntegration::Ancient.new
|
857
|
-
end
|
560
|
+
@rubygems ||= RubygemsIntegration.new
|
858
561
|
end
|
859
562
|
end
|