bundler 1.9.0 → 1.17.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1157 -6
- data/README.md +33 -6
- data/bundler.gemspec +51 -18
- data/exe/bundle +31 -0
- data/{bin → exe}/bundle_ruby +10 -6
- data/exe/bundler +4 -0
- data/lib/bundler.rb +326 -207
- data/lib/bundler/build_metadata.rb +53 -0
- data/lib/bundler/capistrano.rb +9 -3
- data/lib/bundler/cli.rb +522 -141
- data/lib/bundler/cli/add.rb +35 -0
- data/lib/bundler/cli/binstubs.rb +22 -11
- data/lib/bundler/cli/cache.rb +7 -6
- data/lib/bundler/cli/check.rb +11 -8
- data/lib/bundler/cli/clean.rb +7 -8
- data/lib/bundler/cli/common.rb +53 -7
- data/lib/bundler/cli/config.rb +84 -49
- data/lib/bundler/cli/console.rb +13 -8
- data/lib/bundler/cli/doctor.rb +140 -0
- data/lib/bundler/cli/exec.rb +77 -16
- data/lib/bundler/cli/gem.rb +120 -52
- data/lib/bundler/cli/info.rb +50 -0
- data/lib/bundler/cli/init.rb +21 -7
- data/lib/bundler/cli/inject.rb +37 -10
- data/lib/bundler/cli/install.rb +139 -78
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +58 -0
- data/lib/bundler/cli/lock.rb +63 -0
- data/lib/bundler/cli/open.rb +9 -6
- data/lib/bundler/cli/outdated.rb +221 -35
- data/lib/bundler/cli/package.rb +11 -7
- data/lib/bundler/cli/platform.rb +7 -4
- data/lib/bundler/cli/plugin.rb +24 -0
- data/lib/bundler/cli/pristine.rb +47 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +11 -10
- data/lib/bundler/cli/update.rb +47 -29
- data/lib/bundler/cli/viz.rb +12 -8
- data/lib/bundler/compact_index_client.rb +109 -0
- data/lib/bundler/compact_index_client/cache.rb +118 -0
- data/lib/bundler/compact_index_client/updater.rb +116 -0
- data/lib/bundler/compatibility_guard.rb +14 -0
- data/lib/bundler/constants.rb +3 -1
- data/lib/bundler/current_ruby.rb +47 -137
- data/lib/bundler/definition.rb +599 -230
- data/lib/bundler/dep_proxy.rb +15 -10
- data/lib/bundler/dependency.rb +54 -25
- data/lib/bundler/deployment.rb +12 -2
- data/lib/bundler/deprecate.rb +33 -4
- data/lib/bundler/dsl.rb +383 -99
- data/lib/bundler/endpoint_specification.rb +72 -7
- data/lib/bundler/env.rb +121 -41
- data/lib/bundler/environment_preserver.rb +59 -0
- data/lib/bundler/errors.rb +158 -0
- data/lib/bundler/feature_flag.rb +74 -0
- data/lib/bundler/fetcher.rb +171 -280
- data/lib/bundler/fetcher/base.rb +52 -0
- data/lib/bundler/fetcher/compact_index.rb +126 -0
- data/lib/bundler/fetcher/dependency.rb +82 -0
- data/lib/bundler/fetcher/downloader.rb +84 -0
- data/lib/bundler/fetcher/index.rb +52 -0
- data/lib/bundler/friendly_errors.rb +113 -58
- data/lib/bundler/gem_helper.rb +73 -46
- data/lib/bundler/gem_helpers.rb +85 -9
- data/lib/bundler/gem_remote_fetcher.rb +43 -0
- data/lib/bundler/gem_tasks.rb +6 -1
- data/lib/bundler/gem_version_promoter.rb +190 -0
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +32 -49
- data/lib/bundler/index.rb +79 -67
- data/lib/bundler/injector.rb +219 -30
- data/lib/bundler/inline.rb +74 -0
- data/lib/bundler/installer.rb +191 -206
- data/lib/bundler/installer/gem_installer.rb +85 -0
- data/lib/bundler/installer/parallel_installer.rb +233 -0
- data/lib/bundler/installer/standalone.rb +53 -0
- data/lib/bundler/lazy_specification.rb +53 -13
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +157 -62
- data/lib/bundler/match_platform.rb +15 -4
- data/lib/bundler/mirror.rb +223 -0
- data/lib/bundler/plugin.rb +292 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/api/source.rb +306 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +162 -0
- data/lib/bundler/plugin/installer.rb +96 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +27 -0
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +17 -6
- data/lib/bundler/remote_specification.rb +68 -11
- data/lib/bundler/resolver.rb +263 -229
- data/lib/bundler/resolver/spec_group.rb +106 -0
- data/lib/bundler/retry.rb +25 -19
- data/lib/bundler/ruby_dsl.rb +9 -2
- data/lib/bundler/ruby_version.rb +101 -66
- data/lib/bundler/rubygems_ext.rb +77 -37
- data/lib/bundler/rubygems_gem_installer.rb +106 -0
- data/lib/bundler/rubygems_integration.rb +450 -163
- data/lib/bundler/runtime.rb +133 -103
- data/lib/bundler/settings.rb +344 -83
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +7 -3
- data/lib/bundler/shared_helpers.rb +284 -54
- data/lib/bundler/similarity_detector.rb +21 -21
- data/lib/bundler/source.rb +68 -15
- data/lib/bundler/source/gemspec.rb +18 -0
- data/lib/bundler/source/git.rb +90 -55
- data/lib/bundler/source/git/git_proxy.rb +135 -35
- data/lib/bundler/source/metadata.rb +62 -0
- data/lib/bundler/source/path.rb +84 -61
- data/lib/bundler/source/path/installer.rb +53 -17
- data/lib/bundler/source/rubygems.rb +282 -122
- data/lib/bundler/source/rubygems/remote.rb +69 -0
- data/lib/bundler/source_list.rb +107 -22
- data/lib/bundler/spec_set.rb +83 -45
- data/lib/bundler/ssl_certs/certificate_manager.rb +8 -7
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/bundler/ssl_certs/{DigiCertHighAssuranceEVRootCA.pem → rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem} +0 -0
- data/lib/bundler/ssl_certs/{AddTrustExternalCARoot-2048.pem → rubygems.org/AddTrustExternalCARoot.pem} +0 -0
- data/lib/bundler/stub_specification.rb +108 -0
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +19 -6
- data/lib/bundler/templates/Executable.bundler +105 -0
- data/lib/bundler/templates/Executable.standalone +6 -4
- data/lib/bundler/templates/Gemfile +4 -1
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +68 -7
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +19 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +10 -6
- data/lib/bundler/templates/newgem/bin/console.tt +1 -1
- data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/lib/bundler/templates/newgem/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +31 -15
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +3 -5
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +14 -2
- data/lib/bundler/templates/newgem/test/{test_newgem.rb.tt → newgem_test.rb.tt} +2 -2
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
- data/lib/bundler/templates/newgem/travis.yml.tt +7 -0
- data/lib/bundler/ui.rb +5 -3
- data/lib/bundler/ui/rg_proxy.rb +5 -7
- data/lib/bundler/ui/shell.rb +69 -18
- data/lib/bundler/ui/silent.rb +26 -1
- data/lib/bundler/uri_credentials_filter.rb +37 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +12 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +223 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +136 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +143 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/lib/bundler/vendor/{Molinillo-0.2.1 → molinillo}/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/bundler/vendor/{Molinillo-0.2.1 → molinillo}/lib/molinillo/modules/ui.rb +6 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +837 -0
- data/lib/bundler/vendor/{Molinillo-0.2.1 → molinillo}/lib/molinillo/resolver.rb +6 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +58 -0
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +27 -24
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor.rb +47 -22
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions.rb +31 -29
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/directory.rb +3 -3
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/file_manipulation.rb +66 -18
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/inject_into_file.rb +18 -16
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/base.rb +67 -44
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/command.rb +13 -11
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +12 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +129 -0
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/error.rb +3 -3
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/group.rb +14 -14
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/invocation.rb +4 -5
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/line_editor/readline.rb +0 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/arguments.rb +16 -16
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/option.rb +42 -21
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/options.rb +13 -10
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/rake_compat.rb +1 -1
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/runner.rb +35 -33
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell/basic.rb +49 -33
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell/color.rb +2 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell/html.rb +5 -5
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/util.rb +8 -7
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/version.rb +1 -1
- data/lib/bundler/vendored_fileutils.rb +9 -0
- data/lib/bundler/vendored_molinillo.rb +4 -5
- data/lib/bundler/vendored_persistent.rb +45 -4
- data/lib/bundler/vendored_thor.rb +8 -5
- data/lib/bundler/version.rb +23 -1
- data/lib/bundler/version_ranges.rb +76 -0
- data/lib/bundler/vlad.rb +8 -2
- data/lib/bundler/worker.rb +39 -6
- data/lib/bundler/yaml_serializer.rb +90 -0
- data/man/bundle-add.1 +58 -0
- data/man/bundle-add.1.txt +52 -0
- data/man/bundle-add.ronn +40 -0
- data/man/bundle-binstubs.1 +40 -0
- data/man/bundle-binstubs.1.txt +48 -0
- data/man/bundle-binstubs.ronn +43 -0
- data/man/bundle-check.1 +31 -0
- data/man/bundle-check.1.txt +33 -0
- data/man/bundle-check.ronn +26 -0
- data/man/bundle-clean.1 +24 -0
- data/man/bundle-clean.1.txt +26 -0
- data/man/bundle-clean.ronn +18 -0
- data/man/bundle-config.1 +497 -0
- data/man/bundle-config.1.txt +529 -0
- data/man/bundle-config.ronn +256 -31
- data/man/bundle-doctor.1 +44 -0
- data/man/bundle-doctor.1.txt +44 -0
- data/man/bundle-doctor.ronn +33 -0
- data/man/bundle-exec.1 +165 -0
- data/man/bundle-exec.1.txt +178 -0
- data/man/bundle-exec.ronn +19 -3
- data/man/bundle-gem.1 +80 -0
- data/man/bundle-gem.1.txt +91 -0
- data/man/bundle-gem.ronn +78 -0
- data/man/bundle-info.1 +20 -0
- data/man/bundle-info.1.txt +21 -0
- data/man/bundle-info.ronn +17 -0
- data/man/bundle-init.1 +25 -0
- data/man/bundle-init.1.txt +34 -0
- data/man/bundle-init.ronn +29 -0
- data/man/bundle-inject.1 +33 -0
- data/man/bundle-inject.1.txt +32 -0
- data/man/bundle-inject.ronn +22 -0
- data/man/bundle-install.1 +308 -0
- data/man/bundle-install.1.txt +396 -0
- data/man/bundle-install.ronn +64 -67
- data/man/bundle-list.1 +50 -0
- data/man/bundle-list.1.txt +43 -0
- data/man/bundle-list.ronn +33 -0
- data/man/bundle-lock.1 +84 -0
- data/man/bundle-lock.1.txt +93 -0
- data/man/bundle-lock.ronn +94 -0
- data/man/bundle-open.1 +32 -0
- data/man/bundle-open.1.txt +29 -0
- data/man/bundle-open.ronn +19 -0
- data/man/bundle-outdated.1 +155 -0
- data/man/bundle-outdated.1.txt +131 -0
- data/man/bundle-outdated.ronn +111 -0
- data/man/bundle-package.1 +55 -0
- data/man/bundle-package.1.txt +79 -0
- data/man/bundle-package.ronn +14 -8
- data/man/bundle-platform.1 +61 -0
- data/man/bundle-platform.1.txt +57 -0
- data/man/bundle-platform.ronn +1 -1
- data/man/bundle-pristine.1 +34 -0
- data/man/bundle-pristine.1.txt +44 -0
- data/man/bundle-pristine.ronn +34 -0
- data/man/bundle-remove.1 +31 -0
- data/man/bundle-remove.1.txt +34 -0
- data/man/bundle-remove.ronn +23 -0
- data/man/bundle-show.1 +23 -0
- data/man/bundle-show.1.txt +27 -0
- data/man/bundle-show.ronn +21 -0
- data/man/bundle-update.1 +394 -0
- data/man/bundle-update.1.txt +391 -0
- data/man/bundle-update.ronn +180 -18
- data/man/bundle-viz.1 +39 -0
- data/man/bundle-viz.1.txt +39 -0
- data/man/bundle-viz.ronn +30 -0
- data/man/bundle.1 +136 -0
- data/man/bundle.1.txt +116 -0
- data/man/bundle.ronn +46 -33
- data/man/gemfile.5 +689 -0
- data/man/gemfile.5.ronn +127 -79
- data/man/gemfile.5.txt +653 -0
- data/man/index.txt +25 -7
- metadata +242 -95
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.travis.yml +0 -110
- data/CODE_OF_CONDUCT.md +0 -40
- data/CONTRIBUTING.md +0 -32
- data/DEVELOPMENT.md +0 -119
- data/ISSUES.md +0 -96
- data/Rakefile +0 -302
- data/UPGRADING.md +0 -103
- data/bin/bundle +0 -21
- data/bin/bundler +0 -21
- data/lib/bundler/anonymizable_uri.rb +0 -32
- data/lib/bundler/environment.rb +0 -42
- data/lib/bundler/gem_installer.rb +0 -9
- data/lib/bundler/gem_path_manipulation.rb +0 -8
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/bundler/templates/newgem/.travis.yml.tt +0 -3
- data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +0 -4
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo.rb +0 -5
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/dependency_graph.rb +0 -266
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/errors.rb +0 -69
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/gem_metadata.rb +0 -3
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/resolution.rb +0 -412
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/state.rb +0 -43
- data/lib/bundler/vendor/thor-0.19.1/lib/thor/core_ext/io_binary_read.rb +0 -10
- data/lib/bundler/vendor/thor-0.19.1/lib/thor/core_ext/ordered_hash.rb +0 -98
- data/lib/bundler/vendor/thor-0.19.1/lib/thor/parser.rb +0 -4
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Fetcher
|
5
|
+
class Base
|
6
|
+
attr_reader :downloader
|
7
|
+
attr_reader :display_uri
|
8
|
+
attr_reader :remote
|
9
|
+
|
10
|
+
def initialize(downloader, remote, display_uri)
|
11
|
+
raise "Abstract class" if self.class == Base
|
12
|
+
@downloader = downloader
|
13
|
+
@remote = remote
|
14
|
+
@display_uri = display_uri
|
15
|
+
end
|
16
|
+
|
17
|
+
def remote_uri
|
18
|
+
@remote.uri
|
19
|
+
end
|
20
|
+
|
21
|
+
def fetch_uri
|
22
|
+
@fetch_uri ||= begin
|
23
|
+
if remote_uri.host == "rubygems.org"
|
24
|
+
uri = remote_uri.dup
|
25
|
+
uri.host = "index.rubygems.org"
|
26
|
+
uri
|
27
|
+
else
|
28
|
+
remote_uri
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def available?
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
def api_fetcher?
|
38
|
+
false
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def log_specs(debug_msg)
|
44
|
+
if Bundler.ui.debug?
|
45
|
+
Bundler.ui.debug debug_msg
|
46
|
+
else
|
47
|
+
Bundler.ui.info ".", false
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/fetcher/base"
|
4
|
+
require "bundler/worker"
|
5
|
+
|
6
|
+
module Bundler
|
7
|
+
autoload :CompactIndexClient, "bundler/compact_index_client"
|
8
|
+
|
9
|
+
class Fetcher
|
10
|
+
class CompactIndex < Base
|
11
|
+
def self.compact_index_request(method_name)
|
12
|
+
method = instance_method(method_name)
|
13
|
+
undef_method(method_name)
|
14
|
+
define_method(method_name) do |*args, &blk|
|
15
|
+
begin
|
16
|
+
method.bind(self).call(*args, &blk)
|
17
|
+
rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
|
18
|
+
raise HTTPError, e.message
|
19
|
+
rescue AuthenticationRequiredError
|
20
|
+
# Fail since we got a 401 from the server.
|
21
|
+
raise
|
22
|
+
rescue HTTPError => e
|
23
|
+
Bundler.ui.trace(e)
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def specs(gem_names)
|
30
|
+
specs_for_names(gem_names)
|
31
|
+
end
|
32
|
+
compact_index_request :specs
|
33
|
+
|
34
|
+
def specs_for_names(gem_names)
|
35
|
+
gem_info = []
|
36
|
+
complete_gems = []
|
37
|
+
remaining_gems = gem_names.dup
|
38
|
+
|
39
|
+
until remaining_gems.empty?
|
40
|
+
log_specs "Looking up gems #{remaining_gems.inspect}"
|
41
|
+
|
42
|
+
deps = compact_index_client.dependencies(remaining_gems)
|
43
|
+
next_gems = deps.map {|d| d[3].map(&:first).flatten(1) }.flatten(1).uniq
|
44
|
+
deps.each {|dep| gem_info << dep }
|
45
|
+
complete_gems.concat(deps.map(&:first)).uniq!
|
46
|
+
remaining_gems = next_gems - complete_gems
|
47
|
+
end
|
48
|
+
@bundle_worker.stop if @bundle_worker
|
49
|
+
@bundle_worker = nil # reset it. Not sure if necessary
|
50
|
+
|
51
|
+
gem_info
|
52
|
+
end
|
53
|
+
|
54
|
+
def fetch_spec(spec)
|
55
|
+
spec -= [nil, "ruby", ""]
|
56
|
+
contents = compact_index_client.spec(*spec)
|
57
|
+
return nil if contents.nil?
|
58
|
+
contents.unshift(spec.first)
|
59
|
+
contents[3].map! {|d| Gem::Dependency.new(*d) }
|
60
|
+
EndpointSpecification.new(*contents)
|
61
|
+
end
|
62
|
+
compact_index_request :fetch_spec
|
63
|
+
|
64
|
+
def available?
|
65
|
+
return nil unless SharedHelpers.md5_available?
|
66
|
+
user_home = Bundler.user_home
|
67
|
+
return nil unless user_home.directory? && user_home.writable?
|
68
|
+
# Read info file checksums out of /versions, so we can know if gems are up to date
|
69
|
+
fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums!
|
70
|
+
rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
|
71
|
+
Bundler.ui.debug(e.message)
|
72
|
+
nil
|
73
|
+
end
|
74
|
+
compact_index_request :available?
|
75
|
+
|
76
|
+
def api_fetcher?
|
77
|
+
true
|
78
|
+
end
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def compact_index_client
|
83
|
+
@compact_index_client ||= begin
|
84
|
+
SharedHelpers.filesystem_access(cache_path) do
|
85
|
+
CompactIndexClient.new(cache_path, client_fetcher)
|
86
|
+
end.tap do |client|
|
87
|
+
client.in_parallel = lambda do |inputs, &blk|
|
88
|
+
func = lambda {|object, _index| blk.call(object) }
|
89
|
+
worker = bundle_worker(func)
|
90
|
+
inputs.each {|input| worker.enq(input) }
|
91
|
+
inputs.map { worker.deq }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def bundle_worker(func = nil)
|
98
|
+
@bundle_worker ||= begin
|
99
|
+
worker_name = "Compact Index (#{display_uri.host})"
|
100
|
+
Bundler::Worker.new(Bundler.current_ruby.rbx? ? 1 : 25, worker_name, func)
|
101
|
+
end
|
102
|
+
@bundle_worker.tap do |worker|
|
103
|
+
worker.instance_variable_set(:@func, func) if func
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def cache_path
|
108
|
+
Bundler.user_cache.join("compact_index", remote.cache_slug)
|
109
|
+
end
|
110
|
+
|
111
|
+
def client_fetcher
|
112
|
+
ClientFetcher.new(self, Bundler.ui)
|
113
|
+
end
|
114
|
+
|
115
|
+
ClientFetcher = Struct.new(:fetcher, :ui) do
|
116
|
+
def call(path, headers)
|
117
|
+
fetcher.downloader.fetch(fetcher.fetch_uri + path, headers)
|
118
|
+
rescue NetworkDownError => e
|
119
|
+
raise unless Bundler.feature_flag.allow_offline_install? && headers["If-None-Match"]
|
120
|
+
ui.warn "Using the cached data for the new index because of a network error: #{e}"
|
121
|
+
Net::HTTPNotModified.new(nil, nil, nil)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/fetcher/base"
|
4
|
+
require "cgi"
|
5
|
+
|
6
|
+
module Bundler
|
7
|
+
class Fetcher
|
8
|
+
class Dependency < Base
|
9
|
+
def available?
|
10
|
+
@available ||= fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri)
|
11
|
+
rescue NetworkDownError => e
|
12
|
+
raise HTTPError, e.message
|
13
|
+
rescue AuthenticationRequiredError
|
14
|
+
# Fail since we got a 401 from the server.
|
15
|
+
raise
|
16
|
+
rescue HTTPError
|
17
|
+
false
|
18
|
+
end
|
19
|
+
|
20
|
+
def api_fetcher?
|
21
|
+
true
|
22
|
+
end
|
23
|
+
|
24
|
+
def specs(gem_names, full_dependency_list = [], last_spec_list = [])
|
25
|
+
query_list = gem_names.uniq - full_dependency_list
|
26
|
+
|
27
|
+
log_specs "Query List: #{query_list.inspect}"
|
28
|
+
|
29
|
+
return last_spec_list if query_list.empty?
|
30
|
+
|
31
|
+
spec_list, deps_list = Bundler::Retry.new("dependency api", FAIL_ERRORS).attempts do
|
32
|
+
dependency_specs(query_list)
|
33
|
+
end
|
34
|
+
|
35
|
+
returned_gems = spec_list.map(&:first).uniq
|
36
|
+
specs(deps_list, full_dependency_list + returned_gems, spec_list + last_spec_list)
|
37
|
+
rescue MarshalError
|
38
|
+
Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
|
39
|
+
Bundler.ui.debug "could not fetch from the dependency API, trying the full index"
|
40
|
+
nil
|
41
|
+
rescue HTTPError, GemspecError
|
42
|
+
Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
|
43
|
+
Bundler.ui.debug "could not fetch from the dependency API\nit's suggested to retry using the full index via `bundle install --full-index`"
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
47
|
+
def dependency_specs(gem_names)
|
48
|
+
Bundler.ui.debug "Query Gemcutter Dependency Endpoint API: #{gem_names.join(",")}"
|
49
|
+
|
50
|
+
gem_list = unmarshalled_dep_gems(gem_names)
|
51
|
+
get_formatted_specs_and_deps(gem_list)
|
52
|
+
end
|
53
|
+
|
54
|
+
def unmarshalled_dep_gems(gem_names)
|
55
|
+
gem_list = []
|
56
|
+
gem_names.each_slice(Source::Rubygems::API_REQUEST_SIZE) do |names|
|
57
|
+
marshalled_deps = downloader.fetch(dependency_api_uri(names)).body
|
58
|
+
gem_list.concat(Bundler.load_marshal(marshalled_deps))
|
59
|
+
end
|
60
|
+
gem_list
|
61
|
+
end
|
62
|
+
|
63
|
+
def get_formatted_specs_and_deps(gem_list)
|
64
|
+
deps_list = []
|
65
|
+
spec_list = []
|
66
|
+
|
67
|
+
gem_list.each do |s|
|
68
|
+
deps_list.concat(s[:dependencies].map(&:first))
|
69
|
+
deps = s[:dependencies].map {|n, d| [n, d.split(", ")] }
|
70
|
+
spec_list.push([s[:name], s[:number], s[:platform], deps])
|
71
|
+
end
|
72
|
+
[spec_list, deps_list]
|
73
|
+
end
|
74
|
+
|
75
|
+
def dependency_api_uri(gem_names = [])
|
76
|
+
uri = fetch_uri + "api/v1/dependencies"
|
77
|
+
uri.query = "gems=#{CGI.escape(gem_names.sort.join(","))}" if gem_names.any?
|
78
|
+
uri
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Fetcher
|
5
|
+
class Downloader
|
6
|
+
attr_reader :connection
|
7
|
+
attr_reader :redirect_limit
|
8
|
+
|
9
|
+
def initialize(connection, redirect_limit)
|
10
|
+
@connection = connection
|
11
|
+
@redirect_limit = redirect_limit
|
12
|
+
end
|
13
|
+
|
14
|
+
def fetch(uri, headers = {}, counter = 0)
|
15
|
+
raise HTTPError, "Too many redirects" if counter >= redirect_limit
|
16
|
+
|
17
|
+
response = request(uri, headers)
|
18
|
+
Bundler.ui.debug("HTTP #{response.code} #{response.message} #{uri}")
|
19
|
+
|
20
|
+
case response
|
21
|
+
when Net::HTTPSuccess, Net::HTTPNotModified
|
22
|
+
response
|
23
|
+
when Net::HTTPRedirection
|
24
|
+
new_uri = URI.parse(response["location"])
|
25
|
+
if new_uri.host == uri.host
|
26
|
+
new_uri.user = uri.user
|
27
|
+
new_uri.password = uri.password
|
28
|
+
end
|
29
|
+
fetch(new_uri, headers, counter + 1)
|
30
|
+
when Net::HTTPRequestedRangeNotSatisfiable
|
31
|
+
new_headers = headers.dup
|
32
|
+
new_headers.delete("Range")
|
33
|
+
new_headers["Accept-Encoding"] = "gzip"
|
34
|
+
fetch(uri, new_headers)
|
35
|
+
when Net::HTTPRequestEntityTooLarge
|
36
|
+
raise FallbackError, response.body
|
37
|
+
when Net::HTTPUnauthorized
|
38
|
+
raise AuthenticationRequiredError, uri.host
|
39
|
+
when Net::HTTPNotFound
|
40
|
+
raise FallbackError, "Net::HTTPNotFound"
|
41
|
+
else
|
42
|
+
raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def request(uri, headers)
|
47
|
+
validate_uri_scheme!(uri)
|
48
|
+
|
49
|
+
Bundler.ui.debug "HTTP GET #{uri}"
|
50
|
+
req = Net::HTTP::Get.new uri.request_uri, headers
|
51
|
+
if uri.user
|
52
|
+
user = CGI.unescape(uri.user)
|
53
|
+
password = uri.password ? CGI.unescape(uri.password) : nil
|
54
|
+
req.basic_auth(user, password)
|
55
|
+
end
|
56
|
+
connection.request(uri, req)
|
57
|
+
rescue NoMethodError => e
|
58
|
+
raise unless ["undefined method", "use_ssl="].all? {|snippet| e.message.include? snippet }
|
59
|
+
raise LoadError.new("cannot load such file -- openssl")
|
60
|
+
rescue OpenSSL::SSL::SSLError
|
61
|
+
raise CertificateFailureError.new(uri)
|
62
|
+
rescue *HTTP_ERRORS => e
|
63
|
+
Bundler.ui.trace e
|
64
|
+
case e.message
|
65
|
+
when /host down:/, /getaddrinfo: nodename nor servname provided/
|
66
|
+
raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
|
67
|
+
"connection and try again."
|
68
|
+
else
|
69
|
+
raise HTTPError, "Network error while fetching #{URICredentialsFilter.credential_filtered_uri(uri)}" \
|
70
|
+
" (#{e})"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def validate_uri_scheme!(uri)
|
77
|
+
return if uri.scheme =~ /\Ahttps?\z/
|
78
|
+
raise InvalidOption,
|
79
|
+
"The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). " \
|
80
|
+
"Did you mean `http` or `https`?"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/fetcher/base"
|
4
|
+
require "rubygems/remote_fetcher"
|
5
|
+
|
6
|
+
module Bundler
|
7
|
+
class Fetcher
|
8
|
+
class Index < Base
|
9
|
+
def specs(_gem_names)
|
10
|
+
Bundler.rubygems.fetch_all_remote_specs(remote)
|
11
|
+
rescue Gem::RemoteFetcher::FetchError, OpenSSL::SSL::SSLError, Net::HTTPFatalError => e
|
12
|
+
case e.message
|
13
|
+
when /certificate verify failed/
|
14
|
+
raise CertificateFailureError.new(display_uri)
|
15
|
+
when /401/
|
16
|
+
raise AuthenticationRequiredError, remote_uri
|
17
|
+
when /403/
|
18
|
+
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
|
19
|
+
raise AuthenticationRequiredError, remote_uri
|
20
|
+
else
|
21
|
+
Bundler.ui.trace e
|
22
|
+
raise HTTPError, "Could not fetch specs from #{display_uri}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def fetch_spec(spec)
|
27
|
+
spec -= [nil, "ruby", ""]
|
28
|
+
spec_file_name = "#{spec.join "-"}.gemspec"
|
29
|
+
|
30
|
+
uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
31
|
+
if uri.scheme == "file"
|
32
|
+
Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path))
|
33
|
+
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
|
34
|
+
Bundler.load_gemspec(cached_spec_path)
|
35
|
+
else
|
36
|
+
Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
|
37
|
+
end
|
38
|
+
rescue MarshalError
|
39
|
+
raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
|
40
|
+
"Your network or your gem server is probably having issues right now."
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
# cached gem specification path, if one exists
|
46
|
+
def gemspec_cached_path(spec_file_name)
|
47
|
+
paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
|
48
|
+
paths.find {|path| File.file? path }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -1,76 +1,131 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require "cgi"
|
3
5
|
require "bundler/vendored_thor"
|
4
6
|
|
5
7
|
module Bundler
|
6
|
-
|
7
|
-
|
8
|
-
rescue Bundler::BundlerError => e
|
9
|
-
Bundler.ui.error e.message, :wrap => true
|
10
|
-
Bundler.ui.trace e
|
11
|
-
exit e.status_code
|
12
|
-
rescue Thor::AmbiguousTaskError => e
|
13
|
-
Bundler.ui.error e.message
|
14
|
-
exit 15
|
15
|
-
rescue Thor::UndefinedTaskError => e
|
16
|
-
Bundler.ui.error e.message
|
17
|
-
exit 15
|
18
|
-
rescue Thor::Error => e
|
19
|
-
Bundler.ui.error e.message
|
20
|
-
exit 1
|
21
|
-
rescue LoadError => e
|
22
|
-
raise e unless e.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
|
23
|
-
Bundler.ui.error "\nCould not load OpenSSL."
|
24
|
-
Bundler.ui.warn <<-WARN, :wrap => true
|
25
|
-
You must recompile Ruby with OpenSSL support or change the sources in your \
|
26
|
-
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \
|
27
|
-
using RVM are available at http://rvm.io/packages/openssl.
|
28
|
-
WARN
|
29
|
-
Bundler.ui.trace e
|
30
|
-
exit 1
|
31
|
-
rescue Interrupt => e
|
32
|
-
Bundler.ui.error "\nQuitting..."
|
33
|
-
Bundler.ui.trace e
|
34
|
-
exit 1
|
35
|
-
rescue SystemExit => e
|
36
|
-
exit e.status
|
37
|
-
rescue Exception => e
|
38
|
-
request_issue_report_for(e)
|
39
|
-
exit 1
|
40
|
-
end
|
8
|
+
module FriendlyErrors
|
9
|
+
module_function
|
41
10
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
11
|
+
def log_error(error)
|
12
|
+
case error
|
13
|
+
when YamlSyntaxError
|
14
|
+
Bundler.ui.error error.message
|
15
|
+
Bundler.ui.trace error.orig_exception
|
16
|
+
when Dsl::DSLError, GemspecError
|
17
|
+
Bundler.ui.error error.message
|
18
|
+
when GemRequireError
|
19
|
+
Bundler.ui.error error.message
|
20
|
+
Bundler.ui.trace error.orig_exception, nil, true
|
21
|
+
when BundlerError
|
22
|
+
Bundler.ui.error error.message, :wrap => true
|
23
|
+
Bundler.ui.trace error
|
24
|
+
when Thor::Error
|
25
|
+
Bundler.ui.error error.message
|
26
|
+
when LoadError
|
27
|
+
raise error unless error.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
|
28
|
+
Bundler.ui.error "\nCould not load OpenSSL."
|
29
|
+
Bundler.ui.warn <<-WARN, :wrap => true
|
30
|
+
You must recompile Ruby with OpenSSL support or change the sources in your \
|
31
|
+
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \
|
32
|
+
using RVM are available at http://rvm.io/packages/openssl.
|
33
|
+
WARN
|
34
|
+
Bundler.ui.trace error
|
35
|
+
when Interrupt
|
36
|
+
Bundler.ui.error "\nQuitting..."
|
37
|
+
Bundler.ui.trace error
|
38
|
+
when Gem::InvalidSpecificationException
|
39
|
+
Bundler.ui.error error.message, :wrap => true
|
40
|
+
when SystemExit
|
41
|
+
when *[defined?(Java::JavaLang::OutOfMemoryError) && Java::JavaLang::OutOfMemoryError].compact
|
42
|
+
Bundler.ui.error "\nYour JVM has run out of memory, and Bundler cannot continue. " \
|
43
|
+
"You can decrease the amount of memory Bundler needs by removing gems from your Gemfile, " \
|
44
|
+
"especially large gems. (Gems can be as large as hundreds of megabytes, and Bundler has to read those files!). " \
|
45
|
+
"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)."
|
46
|
+
else request_issue_report_for(error)
|
47
|
+
end
|
48
|
+
rescue
|
49
|
+
raise error
|
50
|
+
end
|
48
51
|
|
49
|
-
|
52
|
+
def exit_status(error)
|
53
|
+
case error
|
54
|
+
when BundlerError then error.status_code
|
55
|
+
when Thor::Error then 15
|
56
|
+
when SystemExit then error.status
|
57
|
+
else 1
|
58
|
+
end
|
59
|
+
end
|
50
60
|
|
51
|
-
|
52
|
-
|
61
|
+
def request_issue_report_for(e)
|
62
|
+
Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
|
63
|
+
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
64
|
+
# Error Report
|
53
65
|
|
54
|
-
|
55
|
-
#{'――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'}
|
66
|
+
## Questions
|
56
67
|
|
57
|
-
|
68
|
+
Please fill out answers to these questions, it'll help us figure out
|
69
|
+
why things are going wrong.
|
58
70
|
|
59
|
-
|
71
|
+
- **What did you do?**
|
60
72
|
|
61
|
-
|
73
|
+
I ran the command `#{$PROGRAM_NAME} #{ARGV.join(" ")}`
|
62
74
|
|
63
|
-
|
64
|
-
#{issues_url(e)}
|
75
|
+
- **What did you expect to happen?**
|
65
76
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
77
|
+
I expected Bundler to...
|
78
|
+
|
79
|
+
- **What happened instead?**
|
80
|
+
|
81
|
+
Instead, what happened was...
|
82
|
+
|
83
|
+
- **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
|
84
|
+
|
85
|
+
I tried...
|
86
|
+
|
87
|
+
- **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
|
88
|
+
|
89
|
+
...
|
70
90
|
|
71
|
-
|
72
|
-
|
73
|
-
|
91
|
+
## Backtrace
|
92
|
+
|
93
|
+
```
|
94
|
+
#{e.class}: #{e.message}
|
95
|
+
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
96
|
+
```
|
97
|
+
|
98
|
+
#{Bundler::Env.report}
|
99
|
+
--- TEMPLATE END ----------------------------------------------------------------
|
100
|
+
|
101
|
+
EOS
|
102
|
+
|
103
|
+
Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
|
104
|
+
|
105
|
+
Bundler.ui.warn <<-EOS.gsub(/^ {8}/, "")
|
106
|
+
|
107
|
+
First, try this link to see if there are any existing issue reports for this error:
|
108
|
+
#{issues_url(e)}
|
109
|
+
|
110
|
+
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
|
111
|
+
https://github.com/bundler/bundler/issues/new
|
112
|
+
EOS
|
113
|
+
end
|
114
|
+
|
115
|
+
def issues_url(exception)
|
116
|
+
message = exception.message.lines.first.tr(":", " ").chomp
|
117
|
+
message = message.split("-").first if exception.is_a?(Errno)
|
118
|
+
"https://github.com/bundler/bundler/search?q=" \
|
119
|
+
"#{CGI.escape(message)}&type=Issues"
|
120
|
+
end
|
74
121
|
end
|
75
122
|
|
123
|
+
def self.with_friendly_errors
|
124
|
+
yield
|
125
|
+
rescue SignalException
|
126
|
+
raise
|
127
|
+
rescue Exception => e
|
128
|
+
FriendlyErrors.log_error(e)
|
129
|
+
exit FriendlyErrors.exit_status(e)
|
130
|
+
end
|
76
131
|
end
|