bundler 1.17.3 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3354 -1258
- data/LICENSE.md +18 -19
- data/README.md +10 -15
- data/bundler.gemspec +15 -33
- data/exe/bundle +8 -10
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +5 -13
- data/lib/bundler/capistrano.rb +5 -5
- data/lib/bundler/checksum.rb +254 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +29 -15
- data/lib/bundler/cli/binstubs.rb +13 -5
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +7 -5
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +50 -14
- data/lib/bundler/cli/config.rb +171 -86
- data/lib/bundler/cli/console.rb +3 -6
- data/lib/bundler/cli/doctor.rb +29 -12
- data/lib/bundler/cli/exec.rb +9 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +268 -53
- data/lib/bundler/cli/info.rb +51 -18
- data/lib/bundler/cli/init.rb +7 -3
- data/lib/bundler/cli/inject.rb +2 -2
- data/lib/bundler/cli/install.rb +55 -73
- data/lib/bundler/cli/issue.rb +9 -8
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +56 -26
- data/lib/bundler/cli/open.rb +10 -7
- data/lib/bundler/cli/outdated.rb +159 -128
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +23 -12
- data/lib/bundler/cli/pristine.rb +39 -26
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +7 -7
- data/lib/bundler/cli/update.rb +51 -19
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +399 -390
- data/lib/bundler/compact_index_client/cache.rb +55 -77
- data/lib/bundler/compact_index_client/cache_file.rb +148 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +32 -0
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client/updater.rb +72 -84
- data/lib/bundler/compact_index_client.rb +61 -73
- data/lib/bundler/constants.rb +9 -2
- data/lib/bundler/current_ruby.rb +20 -21
- data/lib/bundler/definition.rb +663 -505
- data/lib/bundler/dependency.rb +38 -71
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +171 -152
- data/lib/bundler/endpoint_specification.rb +43 -17
- data/lib/bundler/env.rb +11 -18
- data/lib/bundler/environment_preserver.rb +17 -8
- data/lib/bundler/errors.rb +115 -14
- data/lib/bundler/feature_flag.rb +15 -39
- data/lib/bundler/fetcher/base.rb +12 -12
- data/lib/bundler/fetcher/compact_index.rb +41 -47
- data/lib/bundler/fetcher/dependency.rb +4 -8
- data/lib/bundler/fetcher/downloader.rb +27 -20
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +6 -33
- data/lib/bundler/fetcher.rb +109 -90
- data/lib/bundler/force_platform.rb +16 -0
- data/lib/bundler/friendly_errors.rb +50 -55
- data/lib/bundler/gem_helper.rb +81 -46
- data/lib/bundler/gem_helpers.rb +78 -29
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +68 -109
- data/lib/bundler/graph.rb +11 -11
- data/lib/bundler/index.rb +74 -82
- data/lib/bundler/injector.rb +58 -26
- data/lib/bundler/inline.rb +59 -35
- data/lib/bundler/installer/gem_installer.rb +29 -29
- data/lib/bundler/installer/parallel_installer.rb +38 -68
- data/lib/bundler/installer/standalone.rb +76 -16
- data/lib/bundler/installer.rb +60 -135
- data/lib/bundler/lazy_specification.rb +161 -63
- data/lib/bundler/lockfile_generator.rb +14 -5
- data/lib/bundler/lockfile_parser.rb +150 -109
- data/lib/bundler/man/bundle-add.1 +76 -0
- data/lib/bundler/man/bundle-add.1.ronn +87 -0
- data/{man → lib/bundler/man}/bundle-binstubs.1 +15 -22
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +8 -7
- data/lib/bundler/man/bundle-cache.1 +68 -0
- data/lib/bundler/man/bundle-cache.1.ronn +108 -0
- data/{man → lib/bundler/man}/bundle-check.1 +7 -14
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +7 -2
- data/{man → lib/bundler/man}/bundle-clean.1 +4 -11
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +80 -260
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +104 -98
- data/lib/bundler/man/bundle-console.1 +33 -0
- data/lib/bundler/man/bundle-console.1.ronn +39 -0
- data/{man → lib/bundler/man}/bundle-doctor.1 +5 -19
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +1 -1
- data/lib/bundler/man/bundle-env.1 +9 -0
- data/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +20 -78
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +12 -10
- 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 +87 -0
- data/lib/bundler/man/bundle-gem.1.ronn +149 -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/{man → lib/bundler/man}/bundle-init.1 +8 -13
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +5 -2
- data/lib/bundler/man/bundle-inject.1 +31 -0
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +12 -2
- data/{man → lib/bundler/man}/bundle-install.1 +65 -155
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +66 -57
- 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/{man → lib/bundler/man}/bundle-list.1 +9 -24
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +10 -7
- data/{man → lib/bundler/man}/bundle-lock.1 +25 -34
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +25 -4
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +10 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +23 -75
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +21 -22
- data/lib/bundler/man/bundle-platform.1 +49 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/lib/bundler/man/bundle-plugin.1 +58 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +5 -16
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +4 -14
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +7 -11
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +4 -0
- data/{man → lib/bundler/man}/bundle-update.1 +35 -148
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +21 -12
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +9 -18
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +9 -3
- data/{man → lib/bundler/man}/bundle.1 +19 -53
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +14 -9
- data/{man → lib/bundler/man}/gemfile.5 +139 -356
- data/{man → lib/bundler/man}/gemfile.5.ronn +134 -97
- data/{man → lib/bundler/man}/index.txt +9 -1
- data/lib/bundler/match_metadata.rb +17 -0
- data/lib/bundler/match_platform.rb +2 -3
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/materialization.rb +59 -0
- data/lib/bundler/mirror.rb +10 -12
- data/lib/bundler/plugin/api/source.rb +34 -18
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/events.rb +24 -0
- data/lib/bundler/plugin/index.rb +44 -9
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/path.rb +18 -0
- data/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/lib/bundler/plugin/installer.rb +63 -27
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +131 -45
- data/lib/bundler/process_lock.rb +10 -14
- data/lib/bundler/remote_specification.rb +22 -10
- data/lib/bundler/resolver/base.rb +118 -0
- data/lib/bundler/resolver/candidate.rb +82 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +90 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +60 -68
- data/lib/bundler/resolver.rb +454 -303
- data/lib/bundler/retry.rb +6 -6
- data/lib/bundler/ruby_dsl.rb +51 -7
- data/lib/bundler/ruby_version.rb +23 -38
- data/lib/bundler/rubygems_ext.rb +357 -98
- data/lib/bundler/rubygems_gem_installer.rb +131 -65
- data/lib/bundler/rubygems_integration.rb +149 -591
- data/lib/bundler/runtime.rb +51 -51
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +206 -0
- data/lib/bundler/settings.rb +271 -135
- data/lib/bundler/setup.rb +23 -12
- data/lib/bundler/shared_helpers.rb +127 -117
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +326 -127
- data/lib/bundler/source/git.rb +207 -88
- data/lib/bundler/source/metadata.rb +19 -18
- data/lib/bundler/source/path/installer.rb +11 -32
- data/lib/bundler/source/path.rb +39 -38
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +223 -255
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +33 -11
- data/lib/bundler/source_list.rb +131 -66
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +239 -94
- data/lib/bundler/stub_specification.rb +77 -39
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +23 -19
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +104 -46
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +19 -2
- data/lib/bundler/templates/newgem/README.md.tt +18 -16
- data/lib/bundler/templates/newgem/Rakefile.tt +44 -6
- data/lib/bundler/templates/newgem/bin/console.tt +1 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/lib/bundler/templates/newgem/gitignore.tt +3 -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 +37 -40
- 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 +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/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/rg_proxy.rb +2 -2
- data/lib/bundler/ui/shell.rb +64 -23
- data/lib/bundler/ui/silent.rb +33 -6
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +11 -5
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +175 -0
- data/lib/bundler/vendor/fileutils/.document +1 -0
- data/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1490 -432
- data/lib/bundler/vendor/net-http-persistent/.document +1 -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 +79 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +362 -484
- data/lib/bundler/vendor/pub_grub/.document +1 -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 +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -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/.document +1 -0
- data/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/bundler/vendor/thor/.document +1 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +4 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +8 -18
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +27 -20
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +34 -13
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +47 -28
- data/lib/bundler/vendor/thor/lib/thor/base.rb +200 -54
- data/lib/bundler/vendor/thor/lib/thor/command.rb +34 -18
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +74 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +15 -4
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +17 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +35 -15
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +45 -13
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +86 -13
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +51 -40
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +99 -148
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -43
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -49
- 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 +6 -6
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +182 -17
- data/lib/bundler/vendor/tsort/.document +1 -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/.document +1 -0
- data/lib/bundler/vendor/uri/COPYING +56 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +876 -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 +1578 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -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 +1 -6
- data/lib/bundler/vendored_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +1 -42
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_securerandom.rb +12 -0
- data/lib/bundler/vendored_thor.rb +2 -2
- 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 +5 -20
- data/lib/bundler/vlad.rb +3 -3
- data/lib/bundler/worker.rb +26 -15
- data/lib/bundler/yaml_serializer.rb +21 -13
- data/lib/bundler.rb +364 -230
- metadata +186 -218
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/dep_proxy.rb +0 -48
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -3
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -7
- 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 -136
- 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/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/lib/bundler/version_ranges.rb +0 -76
- data/man/bundle-add.1 +0 -58
- data/man/bundle-add.1.txt +0 -52
- data/man/bundle-add.ronn +0 -40
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -529
- 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 +0 -20
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-info.ronn +0 -17
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1 +0 -33
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -396
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1 +0 -32
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- data/man/bundle-package.ronn +0 -72
- data/man/bundle-platform.1 +0 -61
- 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 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -653
- /data/lib/bundler/{ssl_certs → man}/.document +0 -0
data/lib/bundler/settings.rb
CHANGED
@@ -1,64 +1,63 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "uri"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class Settings
|
7
|
-
autoload :Mirror, "
|
8
|
-
autoload :Mirrors, "
|
9
|
-
autoload :Validator, "
|
5
|
+
autoload :Mirror, File.expand_path("mirror", __dir__)
|
6
|
+
autoload :Mirrors, File.expand_path("mirror", __dir__)
|
7
|
+
autoload :Validator, File.expand_path("settings/validator", __dir__)
|
10
8
|
|
11
9
|
BOOL_KEYS = %w[
|
12
|
-
allow_bundler_dependency_conflicts
|
13
|
-
allow_deployment_source_credential_changes
|
14
10
|
allow_offline_install
|
15
11
|
auto_clean_without_path
|
16
12
|
auto_install
|
17
|
-
auto_config_jobs
|
18
13
|
cache_all
|
19
14
|
cache_all_platforms
|
20
|
-
|
21
|
-
console_command
|
15
|
+
clean
|
22
16
|
default_install_uses_path
|
23
17
|
deployment
|
24
|
-
deployment_means_frozen
|
25
18
|
disable_checksum_validation
|
26
19
|
disable_exec_load
|
27
20
|
disable_local_branch_check
|
28
|
-
|
29
|
-
disable_platform_warnings
|
21
|
+
disable_local_revision_check
|
30
22
|
disable_shared_gems
|
31
23
|
disable_version_check
|
32
|
-
error_on_stderr
|
33
24
|
force_ruby_platform
|
34
25
|
forget_cli_options
|
35
26
|
frozen
|
27
|
+
gem.changelog
|
36
28
|
gem.coc
|
37
29
|
gem.mit
|
38
|
-
|
30
|
+
git.allow_insecure
|
39
31
|
global_gem_cache
|
40
32
|
ignore_messages
|
41
33
|
init_gems_rb
|
42
|
-
|
43
|
-
|
44
|
-
major_deprecations
|
34
|
+
inline
|
35
|
+
lockfile_checksums
|
45
36
|
no_install
|
46
37
|
no_prune
|
47
|
-
only_update_to_newer_versions
|
48
38
|
path_relative_to_cwd
|
49
39
|
path.system
|
50
40
|
plugins
|
51
|
-
|
41
|
+
prefer_patch
|
52
42
|
print_only_version_number
|
53
43
|
setup_makes_kernel_gem_public
|
44
|
+
silence_deprecations
|
54
45
|
silence_root_warning
|
55
|
-
skip_default_git_sources
|
56
|
-
specific_platform
|
57
|
-
suppress_install_using_messages
|
58
|
-
unlock_source_unlocks_spec
|
59
46
|
update_requires_all_flag
|
60
|
-
|
61
|
-
|
47
|
+
].freeze
|
48
|
+
|
49
|
+
REMEMBERED_KEYS = %w[
|
50
|
+
bin
|
51
|
+
cache_all
|
52
|
+
clean
|
53
|
+
deployment
|
54
|
+
frozen
|
55
|
+
no_prune
|
56
|
+
path
|
57
|
+
shebang
|
58
|
+
path.system
|
59
|
+
without
|
60
|
+
with
|
62
61
|
].freeze
|
63
62
|
|
64
63
|
NUMBER_KEYS = %w[
|
@@ -70,54 +69,71 @@ module Bundler
|
|
70
69
|
].freeze
|
71
70
|
|
72
71
|
ARRAY_KEYS = %w[
|
72
|
+
only
|
73
73
|
with
|
74
74
|
without
|
75
75
|
].freeze
|
76
76
|
|
77
|
+
STRING_KEYS = %w[
|
78
|
+
bin
|
79
|
+
cache_path
|
80
|
+
console
|
81
|
+
gem.ci
|
82
|
+
gem.github_username
|
83
|
+
gem.linter
|
84
|
+
gem.rubocop
|
85
|
+
gem.test
|
86
|
+
gemfile
|
87
|
+
path
|
88
|
+
shebang
|
89
|
+
system_bindir
|
90
|
+
trust-policy
|
91
|
+
version
|
92
|
+
].freeze
|
93
|
+
|
77
94
|
DEFAULT_CONFIG = {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
95
|
+
"BUNDLE_SILENCE_DEPRECATIONS" => false,
|
96
|
+
"BUNDLE_DISABLE_VERSION_CHECK" => true,
|
97
|
+
"BUNDLE_PREFER_PATCH" => false,
|
98
|
+
"BUNDLE_REDIRECT" => 5,
|
99
|
+
"BUNDLE_RETRY" => 3,
|
100
|
+
"BUNDLE_TIMEOUT" => 10,
|
101
|
+
"BUNDLE_VERSION" => "lockfile",
|
82
102
|
}.freeze
|
83
103
|
|
84
104
|
def initialize(root = nil)
|
85
105
|
@root = root
|
86
106
|
@local_config = load_config(local_config_file)
|
107
|
+
@local_root = root || Pathname.new(".bundle").expand_path
|
108
|
+
|
109
|
+
@env_config = ENV.to_h
|
110
|
+
@env_config.select! {|key, _value| key.start_with?("BUNDLE_") }
|
111
|
+
@env_config.delete("BUNDLE_")
|
112
|
+
|
87
113
|
@global_config = load_config(global_config_file)
|
88
114
|
@temporary = {}
|
115
|
+
|
116
|
+
@key_cache = {}
|
89
117
|
end
|
90
118
|
|
91
119
|
def [](name)
|
92
120
|
key = key_for(name)
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
121
|
+
|
122
|
+
value = nil
|
123
|
+
configs.each do |_, config|
|
124
|
+
value = config[key]
|
125
|
+
next if value.nil?
|
126
|
+
break
|
127
|
+
end
|
100
128
|
|
101
129
|
converted_value(value, name)
|
102
130
|
end
|
103
131
|
|
104
132
|
def set_command_option(key, value)
|
105
|
-
if Bundler.feature_flag.forget_cli_options?
|
133
|
+
if !is_remembered(key) || Bundler.feature_flag.forget_cli_options?
|
106
134
|
temporary(key => value)
|
107
135
|
value
|
108
136
|
else
|
109
|
-
command = if value.nil?
|
110
|
-
"bundle config --delete #{key}"
|
111
|
-
else
|
112
|
-
"bundle config #{key} #{Array(value).join(":")}"
|
113
|
-
end
|
114
|
-
|
115
|
-
Bundler::SharedHelpers.major_deprecation 2,\
|
116
|
-
"flags passed to commands " \
|
117
|
-
"will no longer be automatically remembered. Instead please set flags " \
|
118
|
-
"you want remembered between commands using `bundle config " \
|
119
|
-
"<setting name> <setting value>`, i.e. `#{command}`"
|
120
|
-
|
121
137
|
set_local(key, value)
|
122
138
|
end
|
123
139
|
end
|
@@ -128,7 +144,7 @@ module Bundler
|
|
128
144
|
end
|
129
145
|
|
130
146
|
def set_local(key, value)
|
131
|
-
local_config_file
|
147
|
+
local_config_file = @local_root.join("config")
|
132
148
|
|
133
149
|
set_key(key, value, @local_config, local_config_file)
|
134
150
|
end
|
@@ -151,25 +167,32 @@ module Bundler
|
|
151
167
|
end
|
152
168
|
|
153
169
|
def all
|
154
|
-
|
155
|
-
|
156
|
-
keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
|
170
|
+
keys = @temporary.keys.union(@global_config.keys, @local_config.keys, @env_config.keys)
|
157
171
|
|
158
|
-
keys.map do |key|
|
159
|
-
key
|
160
|
-
|
172
|
+
keys.map! do |key|
|
173
|
+
key = key.delete_prefix("BUNDLE_")
|
174
|
+
key.gsub!("___", "-")
|
175
|
+
key.gsub!("__", ".")
|
176
|
+
key.downcase!
|
177
|
+
key
|
178
|
+
end.sort!
|
179
|
+
keys
|
161
180
|
end
|
162
181
|
|
163
182
|
def local_overrides
|
164
183
|
repos = {}
|
165
184
|
all.each do |k|
|
166
|
-
repos[
|
185
|
+
repos[k.delete_prefix("local.")] = self[k] if k.start_with?("local.")
|
167
186
|
end
|
168
187
|
repos
|
169
188
|
end
|
170
189
|
|
171
190
|
def mirror_for(uri)
|
172
|
-
|
191
|
+
if uri.is_a?(String)
|
192
|
+
require_relative "vendored_uri"
|
193
|
+
uri = Gem::URI(uri)
|
194
|
+
end
|
195
|
+
|
173
196
|
gem_mirrors.for(uri.to_s).uri
|
174
197
|
end
|
175
198
|
|
@@ -186,13 +209,11 @@ module Bundler
|
|
186
209
|
|
187
210
|
def locations(key)
|
188
211
|
key = key_for(key)
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
|
195
|
-
locations
|
212
|
+
configs.keys.inject({}) do |partial_locations, level|
|
213
|
+
value_on_level = configs[level][key]
|
214
|
+
partial_locations[level] = value_on_level unless value_on_level.nil?
|
215
|
+
partial_locations
|
216
|
+
end
|
196
217
|
end
|
197
218
|
|
198
219
|
def pretty_values_for(exposed_key)
|
@@ -200,50 +221,60 @@ module Bundler
|
|
200
221
|
|
201
222
|
locations = []
|
202
223
|
|
203
|
-
if @temporary
|
204
|
-
locations << "Set for the current command: #{
|
224
|
+
if value = @temporary[key]
|
225
|
+
locations << "Set for the current command: #{printable_value(value, exposed_key).inspect}"
|
205
226
|
end
|
206
227
|
|
207
|
-
if @local_config
|
208
|
-
locations << "Set for your local app (#{local_config_file}): #{
|
228
|
+
if value = @local_config[key]
|
229
|
+
locations << "Set for your local app (#{local_config_file}): #{printable_value(value, exposed_key).inspect}"
|
209
230
|
end
|
210
231
|
|
211
|
-
if value =
|
212
|
-
locations << "Set via #{key}: #{
|
232
|
+
if value = @env_config[key]
|
233
|
+
locations << "Set via #{key}: #{printable_value(value, exposed_key).inspect}"
|
213
234
|
end
|
214
235
|
|
215
|
-
if @global_config
|
216
|
-
locations << "Set for the current user (#{global_config_file}): #{
|
236
|
+
if value = @global_config[key]
|
237
|
+
locations << "Set for the current user (#{global_config_file}): #{printable_value(value, exposed_key).inspect}"
|
217
238
|
end
|
218
239
|
|
219
240
|
return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
|
220
241
|
locations
|
221
242
|
end
|
222
243
|
|
223
|
-
|
224
|
-
|
244
|
+
def processor_count
|
245
|
+
require "etc"
|
246
|
+
Etc.nprocessors
|
247
|
+
rescue StandardError
|
248
|
+
1
|
249
|
+
end
|
250
|
+
|
251
|
+
# for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
|
225
252
|
def path
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
253
|
+
configs.each do |_level, settings|
|
254
|
+
path = value_for("path", settings)
|
255
|
+
path_system = value_for("path.system", settings)
|
256
|
+
disabled_shared_gems = value_for("disable_shared_gems", settings)
|
257
|
+
next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
|
258
|
+
system_path = path_system || (disabled_shared_gems == false)
|
259
|
+
return Path.new(path, system_path)
|
230
260
|
end
|
231
261
|
|
232
|
-
|
233
|
-
|
262
|
+
path = "vendor/bundle" if self[:deployment]
|
263
|
+
|
264
|
+
Path.new(path, false)
|
234
265
|
end
|
235
266
|
|
236
|
-
Path = Struct.new(:explicit_path, :
|
267
|
+
Path = Struct.new(:explicit_path, :system_path) do
|
237
268
|
def path
|
238
269
|
path = base_path
|
239
|
-
path = File.join(path, Bundler.ruby_scope)
|
270
|
+
path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
|
240
271
|
path
|
241
272
|
end
|
242
273
|
|
243
274
|
def use_system_gems?
|
244
275
|
return true if system_path
|
245
276
|
return false if explicit_path
|
246
|
-
!default_install_uses_path
|
277
|
+
!Bundler.feature_flag.default_install_uses_path?
|
247
278
|
end
|
248
279
|
|
249
280
|
def base_path
|
@@ -280,12 +311,6 @@ module Bundler
|
|
280
311
|
end
|
281
312
|
end
|
282
313
|
|
283
|
-
def allow_sudo?
|
284
|
-
key = key_for(:path)
|
285
|
-
path_configured = @temporary.key?(key) || @local_config.key?(key)
|
286
|
-
!path_configured
|
287
|
-
end
|
288
|
-
|
289
314
|
def ignore_config?
|
290
315
|
ENV["BUNDLE_IGNORE_CONFIG"]
|
291
316
|
end
|
@@ -296,20 +321,32 @@ module Bundler
|
|
296
321
|
|
297
322
|
def validate!
|
298
323
|
all.each do |raw_key|
|
299
|
-
[@local_config,
|
300
|
-
value =
|
301
|
-
Validator.validate!(raw_key, value, settings.
|
324
|
+
[@local_config, @env_config, @global_config].each do |settings|
|
325
|
+
value = value_for(raw_key, settings)
|
326
|
+
Validator.validate!(raw_key, value, settings.dup)
|
302
327
|
end
|
303
328
|
end
|
304
329
|
end
|
305
330
|
|
306
331
|
def key_for(key)
|
307
|
-
key
|
308
|
-
|
309
|
-
|
332
|
+
@key_cache[key] ||= self.class.key_for(key)
|
333
|
+
end
|
334
|
+
|
335
|
+
private
|
336
|
+
|
337
|
+
def configs
|
338
|
+
@configs ||= {
|
339
|
+
temporary: @temporary,
|
340
|
+
local: @local_config,
|
341
|
+
env: @env_config,
|
342
|
+
global: @global_config,
|
343
|
+
default: DEFAULT_CONFIG,
|
344
|
+
}
|
310
345
|
end
|
311
346
|
|
312
|
-
|
347
|
+
def value_for(name, config)
|
348
|
+
converted_value(config[key_for(name)], name)
|
349
|
+
end
|
313
350
|
|
314
351
|
def parent_setting_for(name)
|
315
352
|
split_specific_setting_for(name)[0]
|
@@ -324,12 +361,20 @@ module Bundler
|
|
324
361
|
end
|
325
362
|
|
326
363
|
def is_bool(name)
|
327
|
-
|
364
|
+
name = self.class.key_to_s(name)
|
365
|
+
BOOL_KEYS.include?(name) || BOOL_KEYS.include?(parent_setting_for(name))
|
366
|
+
end
|
367
|
+
|
368
|
+
def is_string(name)
|
369
|
+
name = self.class.key_to_s(name)
|
370
|
+
STRING_KEYS.include?(name) || name.start_with?("local.") || name.start_with?("mirror.") || name.start_with?("build.")
|
328
371
|
end
|
329
372
|
|
330
373
|
def to_bool(value)
|
331
374
|
case value
|
332
|
-
when
|
375
|
+
when String
|
376
|
+
value.match?(/\A(false|f|no|n|0|)\z/i) ? false : true
|
377
|
+
when nil, false
|
333
378
|
false
|
334
379
|
else
|
335
380
|
true
|
@@ -337,16 +382,28 @@ module Bundler
|
|
337
382
|
end
|
338
383
|
|
339
384
|
def is_num(key)
|
340
|
-
NUMBER_KEYS.include?(key
|
385
|
+
NUMBER_KEYS.include?(self.class.key_to_s(key))
|
341
386
|
end
|
342
387
|
|
343
388
|
def is_array(key)
|
344
|
-
ARRAY_KEYS.include?(key
|
389
|
+
ARRAY_KEYS.include?(self.class.key_to_s(key))
|
390
|
+
end
|
391
|
+
|
392
|
+
def is_remembered(key)
|
393
|
+
REMEMBERED_KEYS.include?(self.class.key_to_s(key))
|
394
|
+
end
|
395
|
+
|
396
|
+
def is_credential(key)
|
397
|
+
key == "gem.push_key"
|
398
|
+
end
|
399
|
+
|
400
|
+
def is_userinfo(value)
|
401
|
+
value.include?(":")
|
345
402
|
end
|
346
403
|
|
347
404
|
def to_array(value)
|
348
405
|
return [] unless value
|
349
|
-
value.split(":").map(&:to_sym)
|
406
|
+
value.tr(" ", ":").split(":").map(&:to_sym)
|
350
407
|
end
|
351
408
|
|
352
409
|
def array_to_s(array)
|
@@ -356,7 +413,7 @@ module Bundler
|
|
356
413
|
end
|
357
414
|
|
358
415
|
def set_key(raw_key, value, hash, file)
|
359
|
-
raw_key = raw_key
|
416
|
+
raw_key = self.class.key_to_s(raw_key)
|
360
417
|
value = array_to_s(value) if is_array(raw_key)
|
361
418
|
|
362
419
|
key = key_for(raw_key)
|
@@ -369,14 +426,19 @@ module Bundler
|
|
369
426
|
Validator.validate!(raw_key, converted_value(value, raw_key), hash)
|
370
427
|
|
371
428
|
return unless file
|
429
|
+
|
430
|
+
SharedHelpers.filesystem_access(file.dirname, :create) do |p|
|
431
|
+
FileUtils.mkdir_p(p)
|
432
|
+
end
|
433
|
+
|
372
434
|
SharedHelpers.filesystem_access(file) do |p|
|
373
|
-
|
374
|
-
require "bundler/yaml_serializer"
|
375
|
-
p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
|
435
|
+
p.open("w") {|f| f.write(serializer_class.dump(hash)) }
|
376
436
|
end
|
377
437
|
end
|
378
438
|
|
379
439
|
def converted_value(value, key)
|
440
|
+
key = self.class.key_to_s(key)
|
441
|
+
|
380
442
|
if is_array(key)
|
381
443
|
to_array(value)
|
382
444
|
elsif value.nil?
|
@@ -390,15 +452,38 @@ module Bundler
|
|
390
452
|
end
|
391
453
|
end
|
392
454
|
|
455
|
+
def printable_value(value, key)
|
456
|
+
converted = converted_value(value, key)
|
457
|
+
return converted unless converted.is_a?(String)
|
458
|
+
|
459
|
+
if is_string(key)
|
460
|
+
converted
|
461
|
+
elsif is_credential(key)
|
462
|
+
"[REDACTED]"
|
463
|
+
elsif is_userinfo(converted)
|
464
|
+
username, pass = converted.split(":", 2)
|
465
|
+
|
466
|
+
if pass == "x-oauth-basic"
|
467
|
+
username = "[REDACTED]"
|
468
|
+
else
|
469
|
+
pass = "[REDACTED]"
|
470
|
+
end
|
471
|
+
|
472
|
+
[username, pass].join(":")
|
473
|
+
else
|
474
|
+
converted
|
475
|
+
end
|
476
|
+
end
|
477
|
+
|
393
478
|
def global_config_file
|
394
479
|
if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
|
395
480
|
Pathname.new(ENV["BUNDLE_CONFIG"])
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
481
|
+
elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
|
482
|
+
Pathname.new(ENV["BUNDLE_USER_CONFIG"])
|
483
|
+
elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
|
484
|
+
Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
|
485
|
+
elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
|
486
|
+
Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
|
402
487
|
end
|
403
488
|
end
|
404
489
|
|
@@ -406,43 +491,64 @@ module Bundler
|
|
406
491
|
Pathname.new(@root).join("config") if @root
|
407
492
|
end
|
408
493
|
|
409
|
-
CONFIG_REGEX = %r{ # rubocop:disable Style/RegexpLiteral
|
410
|
-
^
|
411
|
-
(BUNDLE_.+):\s # the key
|
412
|
-
(?: !\s)? # optional exclamation mark found with ruby 1.9.3
|
413
|
-
(['"]?) # optional opening quote
|
414
|
-
(.* # contents of the value
|
415
|
-
(?: # optionally, up until the next key
|
416
|
-
(\n(?!BUNDLE).+)*
|
417
|
-
)
|
418
|
-
)
|
419
|
-
\2 # matching closing quote
|
420
|
-
$
|
421
|
-
}xo
|
422
|
-
|
423
494
|
def load_config(config_file)
|
424
495
|
return {} if !config_file || ignore_config?
|
425
496
|
SharedHelpers.filesystem_access(config_file, :read) do |file|
|
426
497
|
valid_file = file.exist? && !file.size.zero?
|
427
498
|
return {} unless valid_file
|
428
|
-
|
429
|
-
|
499
|
+
serializer_class.load(file.read).inject({}) do |config, (k, v)|
|
500
|
+
k = k.dup
|
501
|
+
k << "/" if /https?:/i.match?(k) && !k.end_with?("/", "__#{FALLBACK_TIMEOUT_URI_OPTION.upcase}")
|
502
|
+
k.gsub!(".", "__")
|
503
|
+
|
504
|
+
unless k.start_with?("#")
|
505
|
+
if k.include?("-")
|
506
|
+
Bundler.ui.warn "Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n" \
|
507
|
+
"This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n" \
|
508
|
+
"Please edit #{file} and replace any dashes in configuration keys with a triple underscore (`___`)."
|
509
|
+
|
510
|
+
# string hash keys are frozen
|
511
|
+
k = k.gsub("-", "___")
|
512
|
+
end
|
513
|
+
|
514
|
+
config[k] = v
|
515
|
+
end
|
516
|
+
|
517
|
+
config
|
518
|
+
end
|
430
519
|
end
|
431
520
|
end
|
432
521
|
|
433
|
-
|
434
|
-
|
435
|
-
|
522
|
+
def serializer_class
|
523
|
+
require "rubygems/yaml_serializer"
|
524
|
+
Gem::YAMLSerializer
|
525
|
+
rescue LoadError
|
526
|
+
# TODO: Remove this when RubyGems 3.4 is EOL
|
527
|
+
require_relative "yaml_serializer"
|
528
|
+
YAMLSerializer
|
529
|
+
end
|
530
|
+
|
531
|
+
FALLBACK_TIMEOUT_URI_OPTION = "fallback_timeout"
|
436
532
|
|
437
533
|
NORMALIZE_URI_OPTIONS_PATTERN =
|
438
534
|
/
|
439
535
|
\A
|
440
536
|
(\w+\.)? # optional prefix key
|
441
537
|
(https?.*?) # URI
|
442
|
-
(\.#{
|
538
|
+
(\.#{FALLBACK_TIMEOUT_URI_OPTION})? # optional suffix key
|
443
539
|
\z
|
444
540
|
/ix
|
445
541
|
|
542
|
+
def self.key_for(key)
|
543
|
+
key = key_to_s(key)
|
544
|
+
key = normalize_uri(key) if key.start_with?("http", "mirror.http")
|
545
|
+
key = key.gsub(".", "__")
|
546
|
+
key.gsub!("-", "___")
|
547
|
+
key.upcase!
|
548
|
+
|
549
|
+
key.gsub(/\A([ #]*)/, '\1BUNDLE_')
|
550
|
+
end
|
551
|
+
|
446
552
|
# TODO: duplicates Rubygems#normalize_uri
|
447
553
|
# TODO: is this the correct place to validate mirror URIs?
|
448
554
|
def self.normalize_uri(uri)
|
@@ -452,12 +558,42 @@ module Bundler
|
|
452
558
|
uri = $2
|
453
559
|
suffix = $3
|
454
560
|
end
|
455
|
-
uri =
|
456
|
-
|
561
|
+
uri = URINormalizer.normalize_suffix(uri)
|
562
|
+
require_relative "vendored_uri"
|
563
|
+
uri = Gem::URI(uri)
|
457
564
|
unless uri.absolute?
|
458
565
|
raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri)
|
459
566
|
end
|
460
567
|
"#{prefix}#{uri}#{suffix}"
|
461
568
|
end
|
569
|
+
|
570
|
+
# This is a hot method, so avoid respond_to? checks on every invocation
|
571
|
+
if :read.respond_to?(:name)
|
572
|
+
def self.key_to_s(key)
|
573
|
+
case key
|
574
|
+
when String
|
575
|
+
key
|
576
|
+
when Symbol
|
577
|
+
key.name
|
578
|
+
when Gem::URI::HTTP
|
579
|
+
key.to_s
|
580
|
+
else
|
581
|
+
raise ArgumentError, "Invalid key: #{key.inspect}"
|
582
|
+
end
|
583
|
+
end
|
584
|
+
else
|
585
|
+
def self.key_to_s(key)
|
586
|
+
case key
|
587
|
+
when String
|
588
|
+
key
|
589
|
+
when Symbol
|
590
|
+
key.to_s
|
591
|
+
when Gem::URI::HTTP
|
592
|
+
key.to_s
|
593
|
+
else
|
594
|
+
raise ArgumentError, "Invalid key: #{key.inspect}"
|
595
|
+
end
|
596
|
+
end
|
597
|
+
end
|
462
598
|
end
|
463
599
|
end
|
data/lib/bundler/setup.rb
CHANGED
@@ -1,28 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "shared_helpers"
|
4
4
|
|
5
5
|
if Bundler::SharedHelpers.in_bundle?
|
6
|
-
|
6
|
+
require_relative "../bundler"
|
7
|
+
|
8
|
+
# autoswitch to locked Bundler version if available
|
9
|
+
Bundler.auto_switch
|
10
|
+
|
11
|
+
# try to auto_install first before we get to the `Bundler.ui.silence`, so user knows what is happening
|
12
|
+
Bundler.auto_install
|
7
13
|
|
8
14
|
if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
|
9
15
|
begin
|
10
|
-
Bundler.setup
|
16
|
+
Bundler.ui.silence { Bundler.setup }
|
11
17
|
rescue Bundler::BundlerError => e
|
12
|
-
|
13
|
-
|
18
|
+
Bundler.ui.error e.message
|
19
|
+
Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
|
14
20
|
if e.is_a?(Bundler::GemNotFound)
|
15
|
-
|
21
|
+
default_bundle = Gem.bin_path("bundler", "bundle")
|
22
|
+
current_bundle = Bundler::SharedHelpers.bundle_bin_path
|
23
|
+
suggested_bundle = default_bundle == current_bundle ? "bundle" : current_bundle
|
24
|
+
suggested_cmd = "#{suggested_bundle} install"
|
25
|
+
original_gemfile = Bundler.original_env["BUNDLE_GEMFILE"]
|
26
|
+
suggested_cmd += " --gemfile #{original_gemfile}" if original_gemfile
|
27
|
+
Bundler.ui.warn "Run `#{suggested_cmd}` to install missing gems."
|
16
28
|
end
|
17
29
|
exit e.status_code
|
18
30
|
end
|
19
31
|
else
|
20
|
-
Bundler.setup
|
32
|
+
Bundler.ui.silence { Bundler.setup }
|
21
33
|
end
|
22
34
|
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Bundler.ui = nil
|
35
|
+
# We might be in the middle of shelling out to rubygems
|
36
|
+
# (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
|
37
|
+
# not being silent.
|
38
|
+
Gem::DefaultUserInteraction.ui = nil
|
28
39
|
end
|