bundler 2.1.4 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2468 -1430
- data/README.md +8 -10
- data/bundler.gemspec +10 -13
- data/exe/bundle +7 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli/add.rb +2 -2
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +3 -8
- data/lib/bundler/cli/check.rb +5 -3
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +32 -3
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/console.rb +3 -3
- data/lib/bundler/cli/doctor.rb +23 -6
- data/lib/bundler/cli/exec.rb +5 -10
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +258 -45
- data/lib/bundler/cli/info.rb +38 -6
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +27 -57
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +11 -4
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +106 -79
- data/lib/bundler/cli/platform.rb +2 -2
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +20 -9
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +149 -85
- data/lib/bundler/compact_index_client/cache.rb +7 -24
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +56 -51
- data/lib/bundler/compact_index_client.rb +3 -9
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +17 -6
- data/lib/bundler/definition.rb +343 -440
- data/lib/bundler/dependency.rb +23 -77
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +77 -85
- data/lib/bundler/endpoint_specification.rb +20 -14
- data/lib/bundler/env.rb +3 -3
- data/lib/bundler/environment_preserver.rb +30 -2
- data/lib/bundler/errors.rb +31 -14
- data/lib/bundler/feature_flag.rb +0 -9
- data/lib/bundler/fetcher/base.rb +7 -9
- data/lib/bundler/fetcher/compact_index.rb +20 -27
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +11 -11
- data/lib/bundler/fetcher/index.rb +2 -30
- data/lib/bundler/fetcher.rb +24 -29
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +45 -49
- data/lib/bundler/gem_helper.rb +53 -31
- data/lib/bundler/gem_helpers.rb +42 -24
- data/lib/bundler/gem_version_promoter.rb +54 -99
- data/lib/bundler/graph.rb +4 -4
- data/lib/bundler/index.rb +14 -52
- data/lib/bundler/injector.rb +40 -8
- data/lib/bundler/inline.rb +6 -15
- data/lib/bundler/installer/gem_installer.rb +19 -24
- data/lib/bundler/installer/parallel_installer.rb +32 -42
- data/lib/bundler/installer/standalone.rb +58 -11
- data/lib/bundler/installer.rb +47 -87
- data/lib/bundler/lazy_specification.rb +76 -35
- data/lib/bundler/lockfile_generator.rb +3 -3
- data/lib/bundler/lockfile_parser.rb +24 -49
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1 +21 -5
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +16 -4
- data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +7 -1
- data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +7 -0
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- 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 +65 -47
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +74 -65
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
- 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/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +5 -2
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +3 -1
- data/{man → lib/bundler/man}/bundle-install.1 +35 -33
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +33 -34
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
- 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/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +5 -5
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +5 -4
- 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 +4 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +2 -0
- data/{man → lib/bundler/man}/bundle.1 +15 -10
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +12 -7
- data/{man → lib/bundler/man}/gemfile.5 +120 -83
- data/{man → lib/bundler/man}/gemfile.5.ronn +109 -88
- data/{man → lib/bundler/man}/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +0 -1
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +7 -9
- data/lib/bundler/plugin/api/source.rb +25 -9
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +17 -5
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +11 -11
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +58 -11
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +15 -6
- data/lib/bundler/resolver/base.rb +46 -0
- data/lib/bundler/resolver/candidate.rb +92 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +63 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +49 -74
- data/lib/bundler/resolver.rb +320 -344
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +6 -19
- data/lib/bundler/rubygems_ext.rb +231 -32
- data/lib/bundler/rubygems_gem_installer.rb +89 -16
- data/lib/bundler/rubygems_integration.rb +72 -162
- data/lib/bundler/runtime.rb +23 -31
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +145 -72
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +19 -34
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +244 -114
- data/lib/bundler/source/git.rb +62 -46
- data/lib/bundler/source/metadata.rb +3 -8
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +15 -9
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +167 -199
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +25 -5
- data/lib/bundler/source_list.rb +112 -64
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +64 -61
- data/lib/bundler/stub_specification.rb +30 -10
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +10 -15
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- 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 +15 -1
- data/lib/bundler/templates/newgem/README.md.tt +13 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +33 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- 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.rb.tt → extconf-c.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +34 -18
- 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 +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -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/shell.rb +37 -14
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- 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 +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +41 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- 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 +151 -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 +53 -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 +124 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -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_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +9 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +10 -5
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +28 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +28 -7
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
- 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 +76 -91
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +32 -13
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +14 -21
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +11 -17
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- 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 +3 -3
- data/lib/bundler/vendored_persistent.rb +1 -40
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/worker.rb +25 -12
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +95 -108
- metadata +132 -118
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -81
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -158
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -223
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -101
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -837
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -12
- data/lib/bundler/version_ranges.rb +0 -122
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1 +0 -80
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-gem.ronn +0 -78
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
- /data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- /data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- /data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- /data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
data/lib/bundler/errors.rb
CHANGED
@@ -21,16 +21,7 @@ module Bundler
|
|
21
21
|
class InstallError < BundlerError; status_code(5); end
|
22
22
|
|
23
23
|
# Internal error, should be rescued
|
24
|
-
class
|
25
|
-
attr_reader :conflicts
|
26
|
-
|
27
|
-
def initialize(conflicts, msg = nil)
|
28
|
-
super(msg)
|
29
|
-
@conflicts = conflicts
|
30
|
-
end
|
31
|
-
|
32
|
-
status_code(6)
|
33
|
-
end
|
24
|
+
class SolveFailure < BundlerError; status_code(6); end
|
34
25
|
|
35
26
|
class GemNotFound < BundlerError; status_code(7); end
|
36
27
|
class InstallHookError < BundlerError; status_code(8); end
|
@@ -41,21 +32,23 @@ module Bundler
|
|
41
32
|
class GemspecError < BundlerError; status_code(14); end
|
42
33
|
class InvalidOption < BundlerError; status_code(15); end
|
43
34
|
class ProductionError < BundlerError; status_code(16); end
|
35
|
+
|
44
36
|
class HTTPError < BundlerError
|
45
37
|
status_code(17)
|
46
38
|
def filter_uri(uri)
|
47
39
|
URICredentialsFilter.credential_filtered_uri(uri)
|
48
40
|
end
|
49
41
|
end
|
42
|
+
|
50
43
|
class RubyVersionMismatch < BundlerError; status_code(18); end
|
51
44
|
class SecurityError < BundlerError; status_code(19); end
|
52
45
|
class LockfileError < BundlerError; status_code(20); end
|
53
46
|
class CyclicDependencyError < BundlerError; status_code(21); end
|
54
47
|
class GemfileLockNotFound < BundlerError; status_code(22); end
|
55
48
|
class PluginError < BundlerError; status_code(29); end
|
56
|
-
class SudoNotPermittedError < BundlerError; status_code(30); end
|
57
49
|
class ThreadCreationError < BundlerError; status_code(33); end
|
58
50
|
class APIResponseMismatchError < BundlerError; status_code(34); end
|
51
|
+
class APIResponseInvalidDependenciesError < BundlerError; status_code(35); end
|
59
52
|
class GemfileEvalError < GemfileError; end
|
60
53
|
class MarshalError < StandardError; end
|
61
54
|
|
@@ -74,10 +67,22 @@ module Bundler
|
|
74
67
|
end
|
75
68
|
end
|
76
69
|
|
70
|
+
def permission_type
|
71
|
+
case @permission_type
|
72
|
+
when :create
|
73
|
+
"executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
74
|
+
else
|
75
|
+
"#{@permission_type} permissions for that path"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def parent_folder
|
80
|
+
File.dirname(@path)
|
81
|
+
end
|
82
|
+
|
77
83
|
def message
|
78
84
|
"There was an error while trying to #{action} `#{@path}`. " \
|
79
|
-
"It is likely that you need to grant #{
|
80
|
-
"for that path."
|
85
|
+
"It is likely that you need to grant #{permission_type}."
|
81
86
|
end
|
82
87
|
|
83
88
|
status_code(23)
|
@@ -121,7 +126,7 @@ module Bundler
|
|
121
126
|
|
122
127
|
class VirtualProtocolError < BundlerError
|
123
128
|
def message
|
124
|
-
"There was an error relating to virtualization and file access." \
|
129
|
+
"There was an error relating to virtualization and file access. " \
|
125
130
|
"It is likely that you need to grant access to or mount some file system correctly."
|
126
131
|
end
|
127
132
|
|
@@ -155,4 +160,16 @@ module Bundler
|
|
155
160
|
|
156
161
|
status_code(32)
|
157
162
|
end
|
163
|
+
|
164
|
+
class DirectoryRemovalError < BundlerError
|
165
|
+
def initialize(orig_exception, msg)
|
166
|
+
full_message = "#{msg}.\n" \
|
167
|
+
"The underlying error was #{orig_exception.class}: #{orig_exception.message}, with backtrace:\n" \
|
168
|
+
" #{orig_exception.backtrace.join("\n ")}\n\n" \
|
169
|
+
"Bundler Error Backtrace:"
|
170
|
+
super(full_message)
|
171
|
+
end
|
172
|
+
|
173
|
+
status_code(36)
|
174
|
+
end
|
158
175
|
end
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -27,27 +27,18 @@ module Bundler
|
|
27
27
|
|
28
28
|
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
|
29
29
|
|
30
|
-
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
|
31
30
|
settings_flag(:allow_offline_install) { bundler_3_mode? }
|
32
31
|
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
|
33
|
-
settings_flag(:auto_config_jobs) { bundler_3_mode? }
|
34
32
|
settings_flag(:cache_all) { bundler_3_mode? }
|
35
33
|
settings_flag(:default_install_uses_path) { bundler_3_mode? }
|
36
|
-
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
|
37
|
-
settings_flag(:disable_multisource) { bundler_3_mode? }
|
38
34
|
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
39
35
|
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
40
|
-
settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
|
41
36
|
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
42
37
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
43
38
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
44
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
45
|
-
settings_flag(:skip_default_git_sources) { bundler_3_mode? }
|
46
|
-
settings_flag(:specific_platform) { bundler_3_mode? }
|
47
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
48
|
-
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
49
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
50
|
-
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
51
42
|
|
52
43
|
settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
|
53
44
|
|
data/lib/bundler/fetcher/base.rb
CHANGED
@@ -19,14 +19,12 @@ module Bundler
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def fetch_uri
|
22
|
-
@fetch_uri ||=
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
remote_uri
|
29
|
-
end
|
22
|
+
@fetch_uri ||= if remote_uri.host == "rubygems.org"
|
23
|
+
uri = remote_uri.dup
|
24
|
+
uri.host = "index.rubygems.org"
|
25
|
+
uri
|
26
|
+
else
|
27
|
+
remote_uri
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
@@ -38,7 +36,7 @@ module Bundler
|
|
38
36
|
false
|
39
37
|
end
|
40
38
|
|
41
|
-
|
39
|
+
private
|
42
40
|
|
43
41
|
def log_specs(debug_msg)
|
44
42
|
if Bundler.ui.debug?
|
@@ -12,17 +12,15 @@ module Bundler
|
|
12
12
|
method = instance_method(method_name)
|
13
13
|
undef_method(method_name)
|
14
14
|
define_method(method_name) do |*args, &blk|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
nil
|
25
|
-
end
|
15
|
+
method.bind(self).call(*args, &blk)
|
16
|
+
rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
|
17
|
+
raise HTTPError, e.message
|
18
|
+
rescue AuthenticationRequiredError
|
19
|
+
# Fail since we got a 401 from the server.
|
20
|
+
raise
|
21
|
+
rescue HTTPError => e
|
22
|
+
Bundler.ui.trace(e)
|
23
|
+
nil
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
@@ -57,22 +55,17 @@ module Bundler
|
|
57
55
|
gem_info
|
58
56
|
end
|
59
57
|
|
60
|
-
def fetch_spec(spec)
|
61
|
-
spec -= [nil, "ruby", ""]
|
62
|
-
contents = compact_index_client.spec(*spec)
|
63
|
-
return nil if contents.nil?
|
64
|
-
contents.unshift(spec.first)
|
65
|
-
contents[3].map! {|d| Gem::Dependency.new(*d) }
|
66
|
-
EndpointSpecification.new(*contents)
|
67
|
-
end
|
68
|
-
compact_index_request :fetch_spec
|
69
|
-
|
70
58
|
def available?
|
71
|
-
|
72
|
-
|
73
|
-
|
59
|
+
unless SharedHelpers.md5_available?
|
60
|
+
Bundler.ui.debug("FIPS mode is enabled, bundler can't use the CompactIndex API")
|
61
|
+
return nil
|
62
|
+
end
|
63
|
+
if fetch_uri.scheme == "file"
|
64
|
+
Bundler.ui.debug("Using a local server, bundler won't use the CompactIndex API")
|
65
|
+
return false
|
66
|
+
end
|
74
67
|
# Read info file checksums out of /versions, so we can know if gems are up to date
|
75
|
-
|
68
|
+
compact_index_client.update_and_parse_checksums!
|
76
69
|
rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
|
77
70
|
Bundler.ui.debug(e.message)
|
78
71
|
nil
|
@@ -83,7 +76,7 @@ module Bundler
|
|
83
76
|
true
|
84
77
|
end
|
85
78
|
|
86
|
-
|
79
|
+
private
|
87
80
|
|
88
81
|
def compact_index_client
|
89
82
|
@compact_index_client ||=
|
@@ -111,7 +104,7 @@ module Bundler
|
|
111
104
|
def bundle_worker(func = nil)
|
112
105
|
@bundle_worker ||= begin
|
113
106
|
worker_name = "Compact Index (#{display_uri.host})"
|
114
|
-
Bundler::Worker.new(Bundler.
|
107
|
+
Bundler::Worker.new(Bundler.settings.processor_count, worker_name, func)
|
115
108
|
end
|
116
109
|
@bundle_worker.tap do |worker|
|
117
110
|
worker.instance_variable_set(:@func, func) if func
|
@@ -55,7 +55,7 @@ module Bundler
|
|
55
55
|
gem_list = []
|
56
56
|
gem_names.each_slice(Source::Rubygems::API_REQUEST_SIZE) do |names|
|
57
57
|
marshalled_deps = downloader.fetch(dependency_api_uri(names)).body
|
58
|
-
gem_list.concat(Bundler.
|
58
|
+
gem_list.concat(Bundler.safe_load_marshal(marshalled_deps))
|
59
59
|
end
|
60
60
|
gem_list
|
61
61
|
end
|
@@ -14,8 +14,10 @@ module Bundler
|
|
14
14
|
def fetch(uri, headers = {}, counter = 0)
|
15
15
|
raise HTTPError, "Too many redirects" if counter >= redirect_limit
|
16
16
|
|
17
|
+
filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)
|
18
|
+
|
17
19
|
response = request(uri, headers)
|
18
|
-
Bundler.ui.debug("HTTP #{response.code} #{response.message} #{
|
20
|
+
Bundler.ui.debug("HTTP #{response.code} #{response.message} #{filtered_uri}")
|
19
21
|
|
20
22
|
case response
|
21
23
|
when Net::HTTPSuccess, Net::HTTPNotModified
|
@@ -40,7 +42,7 @@ module Bundler
|
|
40
42
|
raise BadAuthenticationError, uri.host if uri.userinfo
|
41
43
|
raise AuthenticationRequiredError, uri.host
|
42
44
|
when Net::HTTPNotFound
|
43
|
-
raise FallbackError, "Net::HTTPNotFound: #{
|
45
|
+
raise FallbackError, "Net::HTTPNotFound: #{filtered_uri}"
|
44
46
|
else
|
45
47
|
raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
|
46
48
|
end
|
@@ -49,7 +51,9 @@ module Bundler
|
|
49
51
|
def request(uri, headers)
|
50
52
|
validate_uri_scheme!(uri)
|
51
53
|
|
52
|
-
|
54
|
+
filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)
|
55
|
+
|
56
|
+
Bundler.ui.debug "HTTP GET #{filtered_uri}"
|
53
57
|
req = Net::HTTP::Get.new uri.request_uri, headers
|
54
58
|
if uri.user
|
55
59
|
user = CGI.unescape(uri.user)
|
@@ -57,27 +61,23 @@ module Bundler
|
|
57
61
|
req.basic_auth(user, password)
|
58
62
|
end
|
59
63
|
connection.request(uri, req)
|
60
|
-
rescue NoMethodError => e
|
61
|
-
raise unless ["undefined method", "use_ssl="].all? {|snippet| e.message.include? snippet }
|
62
|
-
raise LoadError.new("cannot load such file -- openssl")
|
63
64
|
rescue OpenSSL::SSL::SSLError
|
64
65
|
raise CertificateFailureError.new(uri)
|
65
66
|
rescue *HTTP_ERRORS => e
|
66
67
|
Bundler.ui.trace e
|
67
|
-
|
68
|
-
when /host down:/, /getaddrinfo: nodename nor servname provided/
|
68
|
+
if e.is_a?(SocketError) || e.message.to_s.include?("host down:")
|
69
69
|
raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
|
70
70
|
"connection and try again."
|
71
71
|
else
|
72
|
-
raise HTTPError, "Network error while fetching #{
|
72
|
+
raise HTTPError, "Network error while fetching #{filtered_uri}" \
|
73
73
|
" (#{e})"
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
|
77
|
+
private
|
78
78
|
|
79
79
|
def validate_uri_scheme!(uri)
|
80
|
-
return if
|
80
|
+
return if /\Ahttps?\z/.match?(uri.scheme)
|
81
81
|
raise InvalidOption,
|
82
82
|
"The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). " \
|
83
83
|
"Did you mean `http` or `https`?"
|
@@ -1,14 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "base"
|
4
|
-
require "rubygems/remote_fetcher"
|
5
4
|
|
6
5
|
module Bundler
|
7
6
|
class Fetcher
|
8
7
|
class Index < Base
|
9
8
|
def specs(_gem_names)
|
10
9
|
Bundler.rubygems.fetch_all_remote_specs(remote)
|
11
|
-
rescue Gem::RemoteFetcher::FetchError
|
10
|
+
rescue Gem::RemoteFetcher::FetchError => e
|
12
11
|
case e.message
|
13
12
|
when /certificate verify failed/
|
14
13
|
raise CertificateFailureError.new(display_uri)
|
@@ -19,36 +18,9 @@ module Bundler
|
|
19
18
|
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
|
20
19
|
raise AuthenticationRequiredError, remote_uri
|
21
20
|
else
|
22
|
-
|
23
|
-
raise HTTPError, "Could not fetch specs from #{display_uri}"
|
21
|
+
raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
|
24
22
|
end
|
25
23
|
end
|
26
|
-
|
27
|
-
def fetch_spec(spec)
|
28
|
-
spec -= [nil, "ruby", ""]
|
29
|
-
spec_file_name = "#{spec.join "-"}.gemspec"
|
30
|
-
|
31
|
-
uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
32
|
-
if uri.scheme == "file"
|
33
|
-
path = Bundler.rubygems.correct_for_windows_path(uri.path)
|
34
|
-
Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
|
35
|
-
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
|
36
|
-
Bundler.load_gemspec(cached_spec_path)
|
37
|
-
else
|
38
|
-
Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
|
39
|
-
end
|
40
|
-
rescue MarshalError
|
41
|
-
raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
|
42
|
-
"Your network or your gem server is probably having issues right now."
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
|
47
|
-
# cached gem specification path, if one exists
|
48
|
-
def gemspec_cached_path(spec_file_name)
|
49
|
-
paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
|
50
|
-
paths.find {|path| File.file? path }
|
51
|
-
end
|
52
24
|
end
|
53
25
|
end
|
54
26
|
end
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -20,6 +20,7 @@ module Bundler
|
|
20
20
|
class TooManyRequestsError < HTTPError; end
|
21
21
|
# This error is raised if the API returns a 413 (only printed in verbose)
|
22
22
|
class FallbackError < HTTPError; end
|
23
|
+
|
23
24
|
# This is the error raised if OpenSSL fails the cert verification
|
24
25
|
class CertificateFailureError < HTTPError
|
25
26
|
def initialize(remote_uri)
|
@@ -28,28 +29,29 @@ module Bundler
|
|
28
29
|
" is a chance you are experiencing a man-in-the-middle attack, but" \
|
29
30
|
" most likely your system doesn't have the CA certificates needed" \
|
30
31
|
" for verification. For information about OpenSSL certificates, see" \
|
31
|
-
"
|
32
|
-
" sources and change 'https' to 'http'."
|
32
|
+
" https://railsapps.github.io/openssl-certificate-verify-failed.html."
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
35
36
|
# This is the error raised when a source is HTTPS and OpenSSL didn't load
|
36
37
|
class SSLError < HTTPError
|
37
38
|
def initialize(msg = nil)
|
38
39
|
super msg || "Could not load OpenSSL.\n" \
|
39
|
-
"You must recompile Ruby with OpenSSL support
|
40
|
-
"Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL " \
|
41
|
-
"using RVM are available at rvm.io/packages/openssl."
|
40
|
+
"You must recompile Ruby with OpenSSL support."
|
42
41
|
end
|
43
42
|
end
|
43
|
+
|
44
44
|
# This error is raised if HTTP authentication is required, but not provided.
|
45
45
|
class AuthenticationRequiredError < HTTPError
|
46
46
|
def initialize(remote_uri)
|
47
47
|
remote_uri = filter_uri(remote_uri)
|
48
48
|
super "Authentication is required for #{remote_uri}.\n" \
|
49
49
|
"Please supply credentials for this source. You can do this by running:\n" \
|
50
|
-
"
|
50
|
+
"`bundle config set --global #{remote_uri} username:password`\n" \
|
51
|
+
"or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
|
51
52
|
end
|
52
53
|
end
|
54
|
+
|
53
55
|
# This error is raised if HTTP authentication is provided, but incorrect.
|
54
56
|
class BadAuthenticationError < HTTPError
|
55
57
|
def initialize(remote_uri)
|
@@ -69,8 +71,8 @@ module Bundler
|
|
69
71
|
:HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
|
70
72
|
FAIL_ERRORS = begin
|
71
73
|
fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
|
72
|
-
fail_errors << Gem::Requirement::BadRequirementError
|
73
|
-
fail_errors.concat(NET_ERRORS.map {|e|
|
74
|
+
fail_errors << Gem::Requirement::BadRequirementError
|
75
|
+
fail_errors.concat(NET_ERRORS.map {|e| Net.const_get(e) })
|
74
76
|
end.freeze
|
75
77
|
|
76
78
|
class << self
|
@@ -120,7 +122,6 @@ module Bundler
|
|
120
122
|
|
121
123
|
# return the specs in the bundler format as an index
|
122
124
|
def specs(gem_names, source)
|
123
|
-
old = Bundler.rubygems.sources
|
124
125
|
index = Bundler::Index.new
|
125
126
|
|
126
127
|
if Bundler::Fetcher.disable_endpoint
|
@@ -128,18 +129,15 @@ module Bundler
|
|
128
129
|
specs = fetchers.last.specs(gem_names)
|
129
130
|
else
|
130
131
|
specs = []
|
131
|
-
fetchers
|
132
|
-
|
133
|
-
break unless f.api_fetcher? && !gem_names || !specs = f.specs(gem_names)
|
134
|
-
fetchers.delete(f)
|
132
|
+
@fetchers = fetchers.drop_while do |f|
|
133
|
+
!f.available? || (f.api_fetcher? && !gem_names) || !specs = f.specs(gem_names)
|
135
134
|
end
|
136
135
|
@use_api = false if fetchers.none?(&:api_fetcher?)
|
137
136
|
end
|
138
137
|
|
139
138
|
specs.each do |name, version, platform, dependencies, metadata|
|
140
|
-
next if name == "bundler"
|
141
139
|
spec = if dependencies
|
142
|
-
EndpointSpecification.new(name, version, platform, dependencies, metadata)
|
140
|
+
EndpointSpecification.new(name, version, platform, self, dependencies, metadata)
|
143
141
|
else
|
144
142
|
RemoteSpecification.new(name, version, platform, self)
|
145
143
|
end
|
@@ -152,8 +150,6 @@ module Bundler
|
|
152
150
|
rescue CertificateFailureError
|
153
151
|
Bundler.ui.info "" if gem_names && use_api # newline after dots
|
154
152
|
raise
|
155
|
-
ensure
|
156
|
-
Bundler.rubygems.sources = old
|
157
153
|
end
|
158
154
|
|
159
155
|
def use_api
|
@@ -216,7 +212,7 @@ module Bundler
|
|
216
212
|
"#<#{self.class}:0x#{object_id} uri=#{uri}>"
|
217
213
|
end
|
218
214
|
|
219
|
-
|
215
|
+
private
|
220
216
|
|
221
217
|
FETCHERS = [CompactIndex, Dependency, Index].freeze
|
222
218
|
|
@@ -229,6 +225,8 @@ module Bundler
|
|
229
225
|
"BUILDBOX" => "buildbox",
|
230
226
|
"GO_SERVER_URL" => "go",
|
231
227
|
"SNAP_CI" => "snap",
|
228
|
+
"GITLAB_CI" => "gitlab",
|
229
|
+
"GITHUB_ACTIONS" => "github",
|
232
230
|
"CI_NAME" => ENV["CI_NAME"],
|
233
231
|
"CI" => "ci",
|
234
232
|
}
|
@@ -238,12 +236,12 @@ module Bundler
|
|
238
236
|
def connection
|
239
237
|
@connection ||= begin
|
240
238
|
needs_ssl = remote_uri.scheme == "https" ||
|
241
|
-
|
242
|
-
|
239
|
+
Bundler.settings[:ssl_verify_mode] ||
|
240
|
+
Bundler.settings[:ssl_client_cert]
|
243
241
|
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
|
244
242
|
|
245
243
|
con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
|
246
|
-
if gem_proxy =
|
244
|
+
if gem_proxy = Gem.configuration[:http_proxy]
|
247
245
|
con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
|
248
246
|
end
|
249
247
|
|
@@ -254,8 +252,8 @@ module Bundler
|
|
254
252
|
end
|
255
253
|
|
256
254
|
ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
|
257
|
-
|
258
|
-
|
255
|
+
(Gem.configuration.ssl_client_cert if
|
256
|
+
Gem.configuration.respond_to?(:ssl_client_cert))
|
259
257
|
if ssl_client_cert
|
260
258
|
pem = File.read(ssl_client_cert)
|
261
259
|
con.cert = OpenSSL::X509::Certificate.new(pem)
|
@@ -273,8 +271,7 @@ module Bundler
|
|
273
271
|
# cached gem specification path, if one exists
|
274
272
|
def gemspec_cached_path(spec_file_name)
|
275
273
|
paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
|
276
|
-
paths
|
277
|
-
paths.first
|
274
|
+
paths.find {|path| File.file? path }
|
278
275
|
end
|
279
276
|
|
280
277
|
HTTP_ERRORS = [
|
@@ -287,8 +284,8 @@ module Bundler
|
|
287
284
|
def bundler_cert_store
|
288
285
|
store = OpenSSL::X509::Store.new
|
289
286
|
ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
|
290
|
-
|
291
|
-
|
287
|
+
(Gem.configuration.ssl_ca_cert if
|
288
|
+
Gem.configuration.respond_to?(:ssl_ca_cert))
|
292
289
|
if ssl_ca_cert
|
293
290
|
if File.directory? ssl_ca_cert
|
294
291
|
store.add_path ssl_ca_cert
|
@@ -302,8 +299,6 @@ module Bundler
|
|
302
299
|
store
|
303
300
|
end
|
304
301
|
|
305
|
-
private
|
306
|
-
|
307
302
|
def remote_uri
|
308
303
|
@remote.uri
|
309
304
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
module ForcePlatform
|
5
|
+
private
|
6
|
+
|
7
|
+
# The `:force_ruby_platform` value used by dependencies for resolution, and
|
8
|
+
# by locked specifications for materialization is `false` by default, except
|
9
|
+
# for TruffleRuby. TruffleRuby generally needs to force the RUBY platform
|
10
|
+
# variant unless the name is explicitly allowlisted.
|
11
|
+
|
12
|
+
def default_force_ruby_platform
|
13
|
+
return false unless RUBY_ENGINE == "truffleruby"
|
14
|
+
|
15
|
+
!Gem::Platform::REUSE_AS_BINARY_ON_TRUFFLERUBY.include?(name)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|