bundler-clone 4.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5670 -0
- data/LICENSE.md +22 -0
- data/README.md +58 -0
- data/bundler.gemspec +46 -0
- data/exe/bundle +29 -0
- data/exe/bundler +4 -0
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +44 -0
- data/lib/bundler/capistrano.rb +4 -0
- data/lib/bundler/checksum.rb +270 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +62 -0
- data/lib/bundler/cli/binstubs.rb +57 -0
- data/lib/bundler/cli/cache.rb +32 -0
- data/lib/bundler/cli/check.rb +40 -0
- data/lib/bundler/cli/clean.rb +25 -0
- data/lib/bundler/cli/common.rb +161 -0
- data/lib/bundler/cli/config.rb +208 -0
- data/lib/bundler/cli/console.rb +47 -0
- data/lib/bundler/cli/doctor/diagnose.rb +167 -0
- data/lib/bundler/cli/doctor/ssl.rb +249 -0
- data/lib/bundler/cli/doctor.rb +33 -0
- data/lib/bundler/cli/exec.rb +114 -0
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +493 -0
- data/lib/bundler/cli/info.rb +83 -0
- data/lib/bundler/cli/init.rb +51 -0
- data/lib/bundler/cli/install.rb +127 -0
- data/lib/bundler/cli/issue.rb +41 -0
- data/lib/bundler/cli/list.rb +97 -0
- data/lib/bundler/cli/lock.rb +94 -0
- data/lib/bundler/cli/open.rb +29 -0
- data/lib/bundler/cli/outdated.rb +337 -0
- data/lib/bundler/cli/platform.rb +48 -0
- data/lib/bundler/cli/plugin.rb +39 -0
- data/lib/bundler/cli/pristine.rb +64 -0
- data/lib/bundler/cli/remove.rb +17 -0
- data/lib/bundler/cli/show.rb +71 -0
- data/lib/bundler/cli/update.rb +125 -0
- data/lib/bundler/cli.rb +829 -0
- data/lib/bundler/compact_index_client/cache.rb +96 -0
- data/lib/bundler/compact_index_client/cache_file.rb +148 -0
- data/lib/bundler/compact_index_client/parser.rb +87 -0
- data/lib/bundler/compact_index_client/updater.rb +105 -0
- data/lib/bundler/compact_index_client.rb +92 -0
- data/lib/bundler/constants.rb +14 -0
- data/lib/bundler/current_ruby.rb +94 -0
- data/lib/bundler/definition.rb +1304 -0
- data/lib/bundler/dependency.rb +151 -0
- data/lib/bundler/deployment.rb +6 -0
- data/lib/bundler/deprecate.rb +44 -0
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +642 -0
- data/lib/bundler/endpoint_specification.rb +184 -0
- data/lib/bundler/env.rb +148 -0
- data/lib/bundler/environment_preserver.rb +69 -0
- data/lib/bundler/errors.rb +277 -0
- data/lib/bundler/feature_flag.rb +20 -0
- data/lib/bundler/fetcher/base.rb +55 -0
- data/lib/bundler/fetcher/compact_index.rb +133 -0
- data/lib/bundler/fetcher/dependency.rb +85 -0
- data/lib/bundler/fetcher/downloader.rb +116 -0
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +24 -0
- data/lib/bundler/fetcher/index.rb +25 -0
- data/lib/bundler/fetcher.rb +365 -0
- data/lib/bundler/force_platform.rb +16 -0
- data/lib/bundler/friendly_errors.rb +127 -0
- data/lib/bundler/gem_helper.rb +237 -0
- data/lib/bundler/gem_tasks.rb +7 -0
- data/lib/bundler/gem_version_promoter.rb +147 -0
- data/lib/bundler/index.rb +203 -0
- data/lib/bundler/injector.rb +284 -0
- data/lib/bundler/inline.rb +106 -0
- data/lib/bundler/installer/gem_installer.rb +88 -0
- data/lib/bundler/installer/parallel_installer.rb +280 -0
- data/lib/bundler/installer/standalone.rb +113 -0
- data/lib/bundler/installer.rb +241 -0
- data/lib/bundler/lazy_specification.rb +270 -0
- data/lib/bundler/lockfile_generator.rb +119 -0
- data/lib/bundler/lockfile_parser.rb +328 -0
- data/lib/bundler/man/.document +1 -0
- data/lib/bundler/man/bundle-add.1 +79 -0
- data/lib/bundler/man/bundle-add.1.ronn +92 -0
- data/lib/bundler/man/bundle-binstubs.1 +30 -0
- data/lib/bundler/man/bundle-binstubs.1.ronn +42 -0
- data/lib/bundler/man/bundle-cache.1 +56 -0
- data/lib/bundler/man/bundle-cache.1.ronn +95 -0
- data/lib/bundler/man/bundle-check.1 +21 -0
- data/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/lib/bundler/man/bundle-clean.1 +17 -0
- data/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/lib/bundler/man/bundle-config.1 +339 -0
- data/lib/bundler/man/bundle-config.1.ronn +455 -0
- data/lib/bundler/man/bundle-console.1 +33 -0
- data/lib/bundler/man/bundle-console.1.ronn +39 -0
- data/lib/bundler/man/bundle-doctor.1 +69 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +77 -0
- data/lib/bundler/man/bundle-env.1 +9 -0
- data/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/lib/bundler/man/bundle-exec.1 +104 -0
- data/lib/bundler/man/bundle-exec.1.ronn +150 -0
- data/lib/bundler/man/bundle-fund.1 +22 -0
- data/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/lib/bundler/man/bundle-gem.1 +107 -0
- data/lib/bundler/man/bundle-gem.1.ronn +150 -0
- data/lib/bundler/man/bundle-help.1 +9 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +17 -0
- data/lib/bundler/man/bundle-info.1.ronn +21 -0
- data/lib/bundler/man/bundle-init.1 +20 -0
- data/lib/bundler/man/bundle-init.1.ronn +32 -0
- data/lib/bundler/man/bundle-install.1 +178 -0
- data/lib/bundler/man/bundle-install.1.ronn +314 -0
- data/lib/bundler/man/bundle-issue.1 +45 -0
- data/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/lib/bundler/man/bundle-licenses.1 +9 -0
- data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/lib/bundler/man/bundle-list.1 +40 -0
- data/lib/bundler/man/bundle-list.1.ronn +41 -0
- data/lib/bundler/man/bundle-lock.1 +75 -0
- data/lib/bundler/man/bundle-lock.1.ronn +115 -0
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/lib/bundler/man/bundle-open.1.ronn +28 -0
- data/lib/bundler/man/bundle-outdated.1 +106 -0
- data/lib/bundler/man/bundle-outdated.1.ronn +117 -0
- data/lib/bundler/man/bundle-platform.1 +49 -0
- data/lib/bundler/man/bundle-platform.1.ronn +49 -0
- data/lib/bundler/man/bundle-plugin.1 +76 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +84 -0
- data/lib/bundler/man/bundle-pristine.1 +23 -0
- data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/lib/bundler/man/bundle-remove.1 +15 -0
- data/lib/bundler/man/bundle-remove.1.ronn +16 -0
- data/lib/bundler/man/bundle-show.1 +16 -0
- data/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/lib/bundler/man/bundle-update.1 +284 -0
- data/lib/bundler/man/bundle-update.1.ronn +367 -0
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/lib/bundler/man/bundle.1 +93 -0
- data/lib/bundler/man/bundle.1.ronn +107 -0
- data/lib/bundler/man/gemfile.5 +503 -0
- data/lib/bundler/man/gemfile.5.ronn +586 -0
- data/lib/bundler/man/index.txt +31 -0
- data/lib/bundler/match_metadata.rb +30 -0
- data/lib/bundler/match_platform.rb +42 -0
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/materialization.rb +59 -0
- data/lib/bundler/mirror.rb +221 -0
- data/lib/bundler/plugin/api/source.rb +330 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +85 -0
- data/lib/bundler/plugin/index.rb +203 -0
- data/lib/bundler/plugin/installer/git.rb +34 -0
- data/lib/bundler/plugin/installer/path.rb +26 -0
- data/lib/bundler/plugin/installer/rubygems.rb +19 -0
- data/lib/bundler/plugin/installer.rb +123 -0
- data/lib/bundler/plugin/source_list.rb +31 -0
- data/lib/bundler/plugin/unloaded_source.rb +25 -0
- data/lib/bundler/plugin.rb +387 -0
- data/lib/bundler/process_lock.rb +20 -0
- data/lib/bundler/remote_specification.rb +126 -0
- data/lib/bundler/resolver/base.rb +127 -0
- data/lib/bundler/resolver/candidate.rb +85 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +95 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +74 -0
- data/lib/bundler/resolver/strategy.rb +43 -0
- data/lib/bundler/resolver.rb +603 -0
- data/lib/bundler/retry.rb +92 -0
- data/lib/bundler/ruby_dsl.rb +67 -0
- data/lib/bundler/ruby_version.rb +135 -0
- data/lib/bundler/rubygems_ext.rb +503 -0
- data/lib/bundler/rubygems_gem_installer.rb +206 -0
- data/lib/bundler/rubygems_integration.rb +456 -0
- data/lib/bundler/runtime.rb +331 -0
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +197 -0
- data/lib/bundler/settings/validator.rb +86 -0
- data/lib/bundler/settings.rb +585 -0
- data/lib/bundler/setup.rb +39 -0
- data/lib/bundler/shared_helpers.rb +392 -0
- data/lib/bundler/source/gemspec.rb +19 -0
- data/lib/bundler/source/git/git_proxy.rb +509 -0
- data/lib/bundler/source/git.rb +451 -0
- data/lib/bundler/source/metadata.rb +67 -0
- data/lib/bundler/source/path/installer.rb +53 -0
- data/lib/bundler/source/path.rb +256 -0
- data/lib/bundler/source/rubygems/remote.rb +86 -0
- data/lib/bundler/source/rubygems.rb +606 -0
- data/lib/bundler/source/rubygems_aggregate.rb +71 -0
- data/lib/bundler/source.rb +120 -0
- data/lib/bundler/source_list.rb +240 -0
- data/lib/bundler/source_map.rb +72 -0
- data/lib/bundler/spec_set.rb +390 -0
- data/lib/bundler/stub_specification.rb +147 -0
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +16 -0
- data/lib/bundler/templates/Executable.standalone +14 -0
- data/lib/bundler/templates/Gemfile +5 -0
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +10 -0
- data/lib/bundler/templates/newgem/Cargo.toml.tt +13 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +24 -0
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/lib/bundler/templates/newgem/README.md.tt +49 -0
- data/lib/bundler/templates/newgem/Rakefile.tt +72 -0
- data/lib/bundler/templates/newgem/bin/console.tt +11 -0
- data/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +37 -0
- data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +22 -0
- data/lib/bundler/templates/newgem/ext/newgem/build.rs.tt +5 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +23 -0
- data/lib/bundler/templates/newgem/github/workflows/build-gems.yml.tt +69 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +48 -0
- data/lib/bundler/templates/newgem/gitignore.tt +23 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +27 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +58 -0
- data/lib/bundler/templates/newgem/rspec.tt +3 -0
- data/lib/bundler/templates/newgem/rubocop.yml.tt +8 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +19 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
- 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/minitest/test_newgem.rb.tt +19 -0
- 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 +19 -0
- data/lib/bundler/ui/shell.rb +191 -0
- data/lib/bundler/ui/silent.rb +96 -0
- data/lib/bundler/ui.rb +9 -0
- data/lib/bundler/uri_credentials_filter.rb +43 -0
- 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 +227 -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 +230 -0
- data/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +2701 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +80 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1153 -0
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +169 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -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 +423 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +236 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +407 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
- data/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
- data/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +292 -0
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +86 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +294 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +384 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +112 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +81 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
- data/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +674 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/lib/bundler/vendor/uri/COPYING +56 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +922 -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 +1592 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +137 -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 +547 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +4 -0
- data/lib/bundler/vendored_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +11 -0
- data/lib/bundler/vendored_pub_grub.rb +4 -0
- data/lib/bundler/vendored_securerandom.rb +12 -0
- data/lib/bundler/vendored_thor.rb +8 -0
- data/lib/bundler/vendored_timeout.rb +12 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +21 -0
- data/lib/bundler/version.rb +21 -0
- data/lib/bundler/vlad.rb +4 -0
- data/lib/bundler/worker.rb +125 -0
- data/lib/bundler/yaml_serializer.rb +98 -0
- data/lib/bundler.rb +691 -0
- metadata +409 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "vendored_persistent"
|
|
4
|
+
require_relative "vendored_timeout"
|
|
5
|
+
require_relative "vendored_securerandom"
|
|
6
|
+
require "zlib"
|
|
7
|
+
|
|
8
|
+
module Bundler
|
|
9
|
+
# Handles all the fetching with the rubygems server
|
|
10
|
+
class Fetcher
|
|
11
|
+
autoload :Base, File.expand_path("fetcher/base", __dir__)
|
|
12
|
+
autoload :CompactIndex, File.expand_path("fetcher/compact_index", __dir__)
|
|
13
|
+
autoload :Downloader, File.expand_path("fetcher/downloader", __dir__)
|
|
14
|
+
autoload :Dependency, File.expand_path("fetcher/dependency", __dir__)
|
|
15
|
+
autoload :Index, File.expand_path("fetcher/index", __dir__)
|
|
16
|
+
|
|
17
|
+
# This error is raised when it looks like the network is down
|
|
18
|
+
class NetworkDownError < HTTPError; end
|
|
19
|
+
# This error is raised if we should rate limit our requests to the API
|
|
20
|
+
class TooManyRequestsError < HTTPError; end
|
|
21
|
+
# This error is raised if the API returns a 413 (only printed in verbose)
|
|
22
|
+
class FallbackError < HTTPError; end
|
|
23
|
+
|
|
24
|
+
# This is the error raised if OpenSSL fails the cert verification
|
|
25
|
+
class CertificateFailureError < HTTPError
|
|
26
|
+
def initialize(remote_uri)
|
|
27
|
+
remote_uri = filter_uri(remote_uri)
|
|
28
|
+
super "Could not verify the SSL certificate for #{remote_uri}.\nThere" \
|
|
29
|
+
" is a chance you are experiencing a man-in-the-middle attack, but" \
|
|
30
|
+
" most likely your system doesn't have the CA certificates needed" \
|
|
31
|
+
" for verification. For information about OpenSSL certificates, see" \
|
|
32
|
+
" https://railsapps.github.io/openssl-certificate-verify-failed.html."
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# This is the error raised when a source is HTTPS and OpenSSL didn't load
|
|
37
|
+
class SSLError < HTTPError
|
|
38
|
+
def initialize(msg = nil)
|
|
39
|
+
super "Could not load OpenSSL.\n" \
|
|
40
|
+
"You must recompile Ruby with OpenSSL support.\n" \
|
|
41
|
+
"original error: #{msg}\n"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# This error is raised if HTTP authentication is required, but not provided.
|
|
46
|
+
class AuthenticationRequiredError < HTTPError
|
|
47
|
+
def initialize(remote_uri)
|
|
48
|
+
remote_uri = filter_uri(remote_uri)
|
|
49
|
+
super "Authentication is required for #{remote_uri}.\n" \
|
|
50
|
+
"Please supply credentials for this source. You can do this by running:\n" \
|
|
51
|
+
"`bundle config set --global #{remote_uri} username:password`\n" \
|
|
52
|
+
"or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# This error is raised if HTTP authentication is provided, but incorrect.
|
|
57
|
+
class BadAuthenticationError < HTTPError
|
|
58
|
+
def initialize(remote_uri)
|
|
59
|
+
remote_uri = filter_uri(remote_uri)
|
|
60
|
+
super "Bad username or password for #{remote_uri}.\n" \
|
|
61
|
+
"Please double-check your credentials and correct them."
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# This error is raised if HTTP authentication is correct, but lacks
|
|
66
|
+
# necessary permissions.
|
|
67
|
+
class AuthenticationForbiddenError < HTTPError
|
|
68
|
+
def initialize(remote_uri)
|
|
69
|
+
remote_uri = filter_uri(remote_uri)
|
|
70
|
+
super "Access token could not be authenticated for #{remote_uri}.\n" \
|
|
71
|
+
"Make sure it's valid and has the necessary scopes configured."
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
HTTP_ERRORS = (Downloader::HTTP_RETRYABLE_ERRORS + Downloader::HTTP_NON_RETRYABLE_ERRORS).freeze
|
|
76
|
+
deprecate_constant :HTTP_ERRORS
|
|
77
|
+
|
|
78
|
+
NET_ERRORS = [
|
|
79
|
+
:HTTPBadGateway,
|
|
80
|
+
:HTTPBadRequest,
|
|
81
|
+
:HTTPFailedDependency,
|
|
82
|
+
:HTTPForbidden,
|
|
83
|
+
:HTTPInsufficientStorage,
|
|
84
|
+
:HTTPMethodNotAllowed,
|
|
85
|
+
:HTTPMovedPermanently,
|
|
86
|
+
:HTTPNoContent,
|
|
87
|
+
:HTTPNotFound,
|
|
88
|
+
:HTTPNotImplemented,
|
|
89
|
+
:HTTPPreconditionFailed,
|
|
90
|
+
:HTTPRequestEntityTooLarge,
|
|
91
|
+
:HTTPRequestURITooLong,
|
|
92
|
+
:HTTPUnauthorized,
|
|
93
|
+
:HTTPUnprocessableEntity,
|
|
94
|
+
:HTTPUnsupportedMediaType,
|
|
95
|
+
:HTTPVersionNotSupported,
|
|
96
|
+
].freeze
|
|
97
|
+
deprecate_constant :NET_ERRORS
|
|
98
|
+
|
|
99
|
+
# Exceptions classes that should bypass retry attempts. If your password didn't work the
|
|
100
|
+
# first time, it's not going to the third time.
|
|
101
|
+
FAIL_ERRORS = [
|
|
102
|
+
AuthenticationRequiredError,
|
|
103
|
+
BadAuthenticationError,
|
|
104
|
+
AuthenticationForbiddenError,
|
|
105
|
+
FallbackError,
|
|
106
|
+
SecurityError,
|
|
107
|
+
Gem::Requirement::BadRequirementError,
|
|
108
|
+
Gem::Net::HTTPBadGateway,
|
|
109
|
+
Gem::Net::HTTPBadRequest,
|
|
110
|
+
Gem::Net::HTTPFailedDependency,
|
|
111
|
+
Gem::Net::HTTPForbidden,
|
|
112
|
+
Gem::Net::HTTPInsufficientStorage,
|
|
113
|
+
Gem::Net::HTTPMethodNotAllowed,
|
|
114
|
+
Gem::Net::HTTPMovedPermanently,
|
|
115
|
+
Gem::Net::HTTPNoContent,
|
|
116
|
+
Gem::Net::HTTPNotFound,
|
|
117
|
+
Gem::Net::HTTPNotImplemented,
|
|
118
|
+
Gem::Net::HTTPPreconditionFailed,
|
|
119
|
+
Gem::Net::HTTPRequestEntityTooLarge,
|
|
120
|
+
Gem::Net::HTTPRequestURITooLong,
|
|
121
|
+
Gem::Net::HTTPUnauthorized,
|
|
122
|
+
Gem::Net::HTTPUnprocessableEntity,
|
|
123
|
+
Gem::Net::HTTPUnsupportedMediaType,
|
|
124
|
+
Gem::Net::HTTPVersionNotSupported,
|
|
125
|
+
].freeze
|
|
126
|
+
|
|
127
|
+
class << self
|
|
128
|
+
attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
self.redirect_limit = Bundler.settings[:redirect] # How many redirects to allow in one request
|
|
132
|
+
self.api_timeout = Bundler.settings[:timeout] # How long to wait for each API call
|
|
133
|
+
self.max_retries = Bundler.settings[:retry] # How many retries for the API call
|
|
134
|
+
|
|
135
|
+
def initialize(remote)
|
|
136
|
+
@cis = nil
|
|
137
|
+
@remote = remote
|
|
138
|
+
|
|
139
|
+
Socket.do_not_reverse_lookup = true
|
|
140
|
+
connection # create persistent connection
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def uri
|
|
144
|
+
@remote.anonymized_uri
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# fetch a gem specification
|
|
148
|
+
def fetch_spec(spec)
|
|
149
|
+
spec -= [nil, "ruby", ""]
|
|
150
|
+
spec_file_name = "#{spec.join "-"}.gemspec"
|
|
151
|
+
|
|
152
|
+
uri = Gem::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
|
153
|
+
spec = if uri.scheme == "file"
|
|
154
|
+
path = Gem::Util.correct_for_windows_path(uri.path)
|
|
155
|
+
Bundler.safe_load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
|
|
156
|
+
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
|
|
157
|
+
Bundler.load_gemspec(cached_spec_path)
|
|
158
|
+
else
|
|
159
|
+
Bundler.safe_load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
|
|
160
|
+
end
|
|
161
|
+
raise MarshalError, "is #{spec.inspect}" unless spec.is_a?(Gem::Specification)
|
|
162
|
+
spec
|
|
163
|
+
rescue MarshalError
|
|
164
|
+
raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
|
|
165
|
+
"Your network or your gem server is probably having issues right now."
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# return the specs in the bundler format as an index with retries
|
|
169
|
+
def specs_with_retry(gem_names, source)
|
|
170
|
+
Bundler::Retry.new("fetcher", FAIL_ERRORS).attempts do
|
|
171
|
+
specs(gem_names, source)
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# return the specs in the bundler format as an index
|
|
176
|
+
def specs(gem_names, source)
|
|
177
|
+
index = Bundler::Index.new
|
|
178
|
+
|
|
179
|
+
fetch_specs(gem_names).each do |name, version, platform, dependencies, metadata|
|
|
180
|
+
spec = if dependencies
|
|
181
|
+
EndpointSpecification.new(name, version, platform, self, dependencies, metadata).tap do |es|
|
|
182
|
+
source.checksum_store.replace(es, es.checksum)
|
|
183
|
+
end
|
|
184
|
+
else
|
|
185
|
+
RemoteSpecification.new(name, version, platform, self)
|
|
186
|
+
end
|
|
187
|
+
spec.source = source
|
|
188
|
+
spec.remote = @remote
|
|
189
|
+
index << spec
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
index
|
|
193
|
+
rescue CertificateFailureError
|
|
194
|
+
Bundler.ui.info "" if gem_names && api_fetcher? # newline after dots
|
|
195
|
+
raise
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def user_agent
|
|
199
|
+
@user_agent ||= begin
|
|
200
|
+
ruby = Bundler::RubyVersion.system
|
|
201
|
+
|
|
202
|
+
agent = String.new("bundler/#{Bundler::VERSION}")
|
|
203
|
+
agent << " rubygems/#{Gem::VERSION}"
|
|
204
|
+
agent << " ruby/#{ruby.versions_string(ruby.versions)}"
|
|
205
|
+
agent << " (#{ruby.host})"
|
|
206
|
+
agent << " command/#{ARGV.first}"
|
|
207
|
+
|
|
208
|
+
if ruby.engine != "ruby"
|
|
209
|
+
# engine_version raises on unknown engines
|
|
210
|
+
engine_version = begin
|
|
211
|
+
ruby.engine_versions
|
|
212
|
+
rescue RuntimeError
|
|
213
|
+
"???"
|
|
214
|
+
end
|
|
215
|
+
agent << " #{ruby.engine}/#{ruby.versions_string(engine_version)}"
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
agent << " options/#{Bundler.settings.all.join(",")}"
|
|
219
|
+
|
|
220
|
+
agent << " ci/#{cis.join(",")}" if cis.any?
|
|
221
|
+
|
|
222
|
+
# add a random ID so we can consolidate runs server-side
|
|
223
|
+
agent << " " << Gem::SecureRandom.hex(8)
|
|
224
|
+
|
|
225
|
+
# add any user agent strings set in the config
|
|
226
|
+
extra_ua = Bundler.settings[:user_agent]
|
|
227
|
+
agent << " " << extra_ua if extra_ua
|
|
228
|
+
|
|
229
|
+
agent
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def http_proxy
|
|
234
|
+
return unless uri = connection.proxy_uri
|
|
235
|
+
uri.to_s
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def inspect
|
|
239
|
+
"#<#{self.class}:0x#{object_id} uri=#{uri}>"
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def api_fetcher?
|
|
243
|
+
fetchers.first.api_fetcher?
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
def release_resolution_memory!
|
|
247
|
+
@fetchers&.each(&:release_resolution_memory!)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def gem_remote_fetcher
|
|
251
|
+
@gem_remote_fetcher ||= begin
|
|
252
|
+
require_relative "fetcher/gem_remote_fetcher"
|
|
253
|
+
fetcher = GemRemoteFetcher.new Gem.configuration[:http_proxy]
|
|
254
|
+
fetcher.headers["User-Agent"] = user_agent
|
|
255
|
+
fetcher.headers["X-Gemfile-Source"] = @remote.original_uri.to_s if @remote.original_uri
|
|
256
|
+
fetcher
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
private
|
|
261
|
+
|
|
262
|
+
def available_fetchers
|
|
263
|
+
if Bundler::Fetcher.disable_endpoint
|
|
264
|
+
[Index]
|
|
265
|
+
elsif remote_uri.scheme == "file"
|
|
266
|
+
Bundler.ui.debug("Using a local server, bundler won't use the CompactIndex API")
|
|
267
|
+
[Index]
|
|
268
|
+
else
|
|
269
|
+
[CompactIndex, Dependency, Index]
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
def fetchers
|
|
274
|
+
@fetchers ||= available_fetchers.map {|f| f.new(downloader, @remote, uri, gem_remote_fetcher) }.drop_while {|f| !f.available? }
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
def fetch_specs(gem_names)
|
|
278
|
+
fetchers.reject!(&:api_fetcher?) unless gem_names
|
|
279
|
+
fetchers.reject! do |f|
|
|
280
|
+
specs = f.specs(gem_names)
|
|
281
|
+
return specs if specs
|
|
282
|
+
true
|
|
283
|
+
end
|
|
284
|
+
[]
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
def cis
|
|
288
|
+
@cis ||= Bundler::CIDetector.ci_strings
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
def connection
|
|
292
|
+
@connection ||= begin
|
|
293
|
+
needs_ssl = remote_uri.scheme == "https" ||
|
|
294
|
+
Bundler.settings[:ssl_verify_mode] ||
|
|
295
|
+
Bundler.settings[:ssl_client_cert]
|
|
296
|
+
if needs_ssl
|
|
297
|
+
begin
|
|
298
|
+
require "openssl"
|
|
299
|
+
rescue StandardError, LoadError => e
|
|
300
|
+
raise SSLError.new(e.message)
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
con = Gem::Net::HTTP::Persistent.new name: "bundler", proxy: :ENV
|
|
305
|
+
if gem_proxy = Gem.configuration[:http_proxy]
|
|
306
|
+
con.proxy = Gem::URI.parse(gem_proxy) if gem_proxy != :no_proxy
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
if remote_uri.scheme == "https"
|
|
310
|
+
con.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
|
|
311
|
+
OpenSSL::SSL::VERIFY_PEER)
|
|
312
|
+
con.cert_store = bundler_cert_store
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
|
|
316
|
+
(Gem.configuration.ssl_client_cert if
|
|
317
|
+
Gem.configuration.respond_to?(:ssl_client_cert))
|
|
318
|
+
if ssl_client_cert
|
|
319
|
+
pem = File.read(ssl_client_cert)
|
|
320
|
+
con.cert = OpenSSL::X509::Certificate.new(pem)
|
|
321
|
+
con.key = OpenSSL::PKey::RSA.new(pem)
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
con.read_timeout = Fetcher.api_timeout
|
|
325
|
+
con.open_timeout = Fetcher.api_timeout
|
|
326
|
+
con.override_headers["User-Agent"] = user_agent
|
|
327
|
+
con.override_headers["X-Gemfile-Source"] = @remote.original_uri.to_s if @remote.original_uri
|
|
328
|
+
con
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# cached gem specification path, if one exists
|
|
333
|
+
def gemspec_cached_path(spec_file_name)
|
|
334
|
+
paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
|
|
335
|
+
paths.find {|path| File.file? path }
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def bundler_cert_store
|
|
339
|
+
store = OpenSSL::X509::Store.new
|
|
340
|
+
ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
|
|
341
|
+
(Gem.configuration.ssl_ca_cert if
|
|
342
|
+
Gem.configuration.respond_to?(:ssl_ca_cert))
|
|
343
|
+
if ssl_ca_cert
|
|
344
|
+
if File.directory? ssl_ca_cert
|
|
345
|
+
store.add_path ssl_ca_cert
|
|
346
|
+
else
|
|
347
|
+
store.add_file ssl_ca_cert
|
|
348
|
+
end
|
|
349
|
+
else
|
|
350
|
+
store.set_default_paths
|
|
351
|
+
require "rubygems/request"
|
|
352
|
+
Gem::Request.get_cert_files.each {|c| store.add_file c }
|
|
353
|
+
end
|
|
354
|
+
store
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
def remote_uri
|
|
358
|
+
@remote.uri
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
def downloader
|
|
362
|
+
@downloader ||= Downloader.new(connection, self.class.redirect_limit)
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bundler
|
|
4
|
+
module ForcePlatform
|
|
5
|
+
# The `:force_ruby_platform` value used by dependencies for resolution, and
|
|
6
|
+
# by locked specifications for materialization is `false` by default, except
|
|
7
|
+
# for TruffleRuby. TruffleRuby generally needs to force the RUBY platform
|
|
8
|
+
# variant unless the name is explicitly allowlisted.
|
|
9
|
+
|
|
10
|
+
def default_force_ruby_platform
|
|
11
|
+
return false unless RUBY_ENGINE == "truffleruby"
|
|
12
|
+
|
|
13
|
+
!Gem::Platform::REUSE_AS_BINARY_ON_TRUFFLERUBY.include?(name)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "vendored_thor"
|
|
4
|
+
|
|
5
|
+
module Bundler
|
|
6
|
+
module FriendlyErrors
|
|
7
|
+
module_function
|
|
8
|
+
|
|
9
|
+
def enable!
|
|
10
|
+
@disabled = false
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def disabled?
|
|
14
|
+
@disabled
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def disable!
|
|
18
|
+
@disabled = true
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def log_error(error)
|
|
22
|
+
case error
|
|
23
|
+
when YamlSyntaxError
|
|
24
|
+
Bundler.ui.error error.message
|
|
25
|
+
Bundler.ui.trace error.orig_exception
|
|
26
|
+
when Dsl::DSLError, GemspecError
|
|
27
|
+
Bundler.ui.error error.message
|
|
28
|
+
when GemRequireError
|
|
29
|
+
Bundler.ui.error error.message
|
|
30
|
+
Bundler.ui.trace error.orig_exception
|
|
31
|
+
when BundlerError
|
|
32
|
+
if Bundler.ui.debug?
|
|
33
|
+
Bundler.ui.trace error
|
|
34
|
+
else
|
|
35
|
+
Bundler.ui.error error.message, wrap: true
|
|
36
|
+
end
|
|
37
|
+
when Thor::Error
|
|
38
|
+
Bundler.ui.error error.message
|
|
39
|
+
when Interrupt
|
|
40
|
+
Bundler.ui.error "\nQuitting..."
|
|
41
|
+
Bundler.ui.trace error
|
|
42
|
+
when Gem::InvalidSpecificationException
|
|
43
|
+
Bundler.ui.error error.message, wrap: true
|
|
44
|
+
when SystemExit
|
|
45
|
+
when *[defined?(Java::JavaLang::OutOfMemoryError) && Java::JavaLang::OutOfMemoryError].compact
|
|
46
|
+
Bundler.ui.error "\nYour JVM has run out of memory, and Bundler cannot continue. " \
|
|
47
|
+
"You can decrease the amount of memory Bundler needs by removing gems from your Gemfile, " \
|
|
48
|
+
"especially large gems. (Gems can be as large as hundreds of megabytes, and Bundler has to read those files!). " \
|
|
49
|
+
"Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
|
|
50
|
+
else request_issue_report_for(error)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def exit_status(error)
|
|
55
|
+
case error
|
|
56
|
+
when BundlerError then error.status_code
|
|
57
|
+
when Thor::Error then 15
|
|
58
|
+
when SystemExit then error.status
|
|
59
|
+
else 1
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def request_issue_report_for(e)
|
|
64
|
+
Bundler.ui.error <<~EOS, nil, nil
|
|
65
|
+
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
#{exception_message(e)}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#{Bundler::Env.report}
|
|
72
|
+
--- TEMPLATE END ----------------------------------------------------------------
|
|
73
|
+
|
|
74
|
+
EOS
|
|
75
|
+
|
|
76
|
+
Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
|
|
77
|
+
|
|
78
|
+
Bundler.ui.error <<~EOS, nil, :yellow
|
|
79
|
+
|
|
80
|
+
First, try this link to see if there are any existing issue reports for this error:
|
|
81
|
+
#{issues_url(e)}
|
|
82
|
+
|
|
83
|
+
If there aren't any reports for this error yet, please fill in the new issue form located at #{new_issue_url}. Make sure to copy and paste the full output of this command under the "What happened instead?" section.
|
|
84
|
+
EOS
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def exception_message(error)
|
|
88
|
+
message = serialized_exception_for(error)
|
|
89
|
+
cause = error.cause
|
|
90
|
+
return message unless cause
|
|
91
|
+
|
|
92
|
+
message + serialized_exception_for(cause)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def serialized_exception_for(e)
|
|
96
|
+
<<~EOS
|
|
97
|
+
#{e.class}: #{e.message}
|
|
98
|
+
#{e.backtrace&.join("\n ")&.chomp}
|
|
99
|
+
EOS
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def issues_url(exception)
|
|
103
|
+
message = exception.message.lines.first.tr(":", " ").chomp
|
|
104
|
+
message = message.split("-").first if exception.is_a?(Errno)
|
|
105
|
+
require "cgi/escape"
|
|
106
|
+
require "cgi/util" unless defined?(CGI::EscapeExt)
|
|
107
|
+
"https://github.com/ruby/rubygems/search?q=" \
|
|
108
|
+
"#{CGI.escape(message)}&type=Issues"
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def new_issue_url
|
|
112
|
+
"https://github.com/ruby/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md"
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def self.with_friendly_errors
|
|
117
|
+
FriendlyErrors.enable!
|
|
118
|
+
yield
|
|
119
|
+
rescue SignalException
|
|
120
|
+
raise
|
|
121
|
+
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
122
|
+
raise if FriendlyErrors.disabled?
|
|
123
|
+
|
|
124
|
+
FriendlyErrors.log_error(e)
|
|
125
|
+
exit FriendlyErrors.exit_status(e)
|
|
126
|
+
end
|
|
127
|
+
end
|