bundler 1.17.2 → 2.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2095 -1251
- data/LICENSE.md +18 -19
- data/README.md +10 -11
- data/bundler.gemspec +10 -28
- data/exe/bundle +22 -3
- data/lib/bundler/build_metadata.rb +4 -12
- data/lib/bundler/capistrano.rb +4 -4
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +39 -13
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +20 -9
- data/lib/bundler/cli/exec.rb +8 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +213 -32
- data/lib/bundler/cli/info.rb +42 -7
- data/lib/bundler/cli/init.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +34 -44
- data/lib/bundler/cli/issue.rb +8 -7
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +11 -8
- data/lib/bundler/cli/outdated.rb +142 -118
- data/lib/bundler/cli/plugin.rb +19 -2
- data/lib/bundler/cli/pristine.rb +6 -1
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +43 -16
- data/lib/bundler/cli.rb +211 -150
- data/lib/bundler/compact_index_client/cache.rb +6 -14
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +15 -28
- data/lib/bundler/compact_index_client.rb +28 -12
- data/lib/bundler/current_ruby.rb +14 -11
- data/lib/bundler/definition.rb +207 -368
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +19 -14
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +81 -81
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +9 -14
- data/lib/bundler/environment_preserver.rb +29 -3
- data/lib/bundler/errors.rb +20 -3
- data/lib/bundler/feature_flag.rb +14 -33
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +28 -14
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +14 -8
- data/lib/bundler/fetcher/index.rb +8 -8
- data/lib/bundler/fetcher.rb +22 -17
- data/lib/bundler/friendly_errors.rb +29 -48
- data/lib/bundler/gem_helper.rb +79 -43
- data/lib/bundler/gem_helpers.rb +38 -29
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +5 -5
- data/lib/bundler/graph.rb +3 -3
- data/lib/bundler/index.rb +9 -9
- data/lib/bundler/injector.rb +33 -13
- data/lib/bundler/inline.rb +41 -30
- data/lib/bundler/installer/gem_installer.rb +9 -18
- data/lib/bundler/installer/parallel_installer.rb +50 -33
- data/lib/bundler/installer/standalone.rb +30 -11
- data/lib/bundler/installer.rb +39 -66
- data/lib/bundler/lazy_specification.rb +63 -28
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +19 -52
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/{man → lib/bundler/man}/bundle-add.1 +10 -2
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +6 -4
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +15 -15
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-config.1 +59 -60
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +77 -78
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- 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/{man → lib/bundler/man}/bundle-gem.1 +38 -3
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +46 -7
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-init.1 +2 -2
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-install.1 +37 -7
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +34 -7
- 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/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-update.1 +7 -7
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle.1 +7 -3
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +5 -2
- data/{man → lib/bundler/man}/gemfile.5 +44 -21
- data/{man → lib/bundler/man}/gemfile.5.ronn +24 -20
- data/{man → lib/bundler/man}/index.txt +1 -1
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/mirror.rb +5 -5
- data/lib/bundler/plugin/api/source.rb +27 -7
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +27 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/installer.rb +35 -22
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +100 -42
- data/lib/bundler/psyched_yaml.rb +0 -15
- data/lib/bundler/remote_specification.rb +5 -4
- data/lib/bundler/resolver/spec_group.rb +57 -53
- data/lib/bundler/resolver.rb +127 -113
- data/lib/bundler/retry.rb +4 -4
- data/lib/bundler/ruby_version.rb +5 -20
- data/lib/bundler/rubygems_ext.rb +103 -79
- data/lib/bundler/rubygems_gem_installer.rb +69 -8
- data/lib/bundler/rubygems_integration.rb +181 -446
- data/lib/bundler/runtime.rb +24 -34
- data/lib/bundler/settings.rb +159 -110
- data/lib/bundler/setup.rb +11 -12
- data/lib/bundler/shared_helpers.rb +56 -90
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +106 -105
- data/lib/bundler/source/git.rb +66 -39
- data/lib/bundler/source/metadata.rb +9 -9
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/path.rb +23 -12
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +136 -120
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +27 -6
- data/lib/bundler/source_list.rb +101 -66
- data/lib/bundler/source_map.rb +58 -0
- data/lib/bundler/spec_set.rb +49 -53
- data/lib/bundler/stub_specification.rb +40 -34
- data/lib/bundler/templates/Executable.bundler +24 -15
- data/lib/bundler/templates/Gemfile +1 -1
- data/lib/bundler/templates/gems.rb +1 -1
- 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/Gemfile.tt +19 -2
- data/lib/bundler/templates/newgem/README.md.tt +7 -5
- data/lib/bundler/templates/newgem/Rakefile.tt +23 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +27 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -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 +29 -40
- 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 +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +7 -11
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +10 -4
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +126 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +39 -11
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +38 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +4 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +53 -51
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -6
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +302 -462
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +20 -9
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +28 -13
- data/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- 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/arguments.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +21 -5
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +65 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +16 -9
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -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 +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +7 -12
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +2 -2
- data/lib/bundler/worker.rb +21 -8
- data/lib/bundler/yaml_serializer.rb +3 -4
- data/lib/bundler.rb +248 -118
- metadata +115 -190
- 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/gem_remote_fetcher.rb +0 -43
- 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/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- 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/man/bundle-add.1.txt +0 -52
- 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.txt +0 -91
- 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 -396
- 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-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- 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 -113
- data/man/gemfile.5.txt +0 -653
data/lib/bundler/runtime.rb
CHANGED
@@ -12,36 +12,23 @@ module Bundler
|
|
12
12
|
def setup(*groups)
|
13
13
|
@definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle?
|
14
14
|
|
15
|
-
groups.map!(&:to_sym)
|
16
|
-
|
17
15
|
# Has to happen first
|
18
16
|
clean_load_path
|
19
17
|
|
20
|
-
specs =
|
18
|
+
specs = @definition.specs_for(groups)
|
21
19
|
|
22
20
|
SharedHelpers.set_bundle_environment
|
23
21
|
Bundler.rubygems.replace_entrypoints(specs)
|
24
22
|
|
25
23
|
# Activate the specs
|
26
24
|
load_paths = specs.map do |spec|
|
27
|
-
unless spec.loaded_from
|
28
|
-
raise GemNotFound, "#{spec.full_name} is missing. Run `bundle install` to get it."
|
29
|
-
end
|
30
|
-
|
31
25
|
check_for_activated_spec!(spec)
|
32
26
|
|
33
27
|
Bundler.rubygems.mark_loaded(spec)
|
34
28
|
spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
|
35
29
|
end.reverse.flatten
|
36
30
|
|
37
|
-
|
38
|
-
if insert_index = Bundler.rubygems.load_path_insert_index
|
39
|
-
# Gem directories must come after -I and ENV['RUBYLIB']
|
40
|
-
$LOAD_PATH.insert(insert_index, *load_paths)
|
41
|
-
else
|
42
|
-
# We are probably testing in core, -I and RUBYLIB don't apply
|
43
|
-
$LOAD_PATH.unshift(*load_paths)
|
44
|
-
end
|
31
|
+
Bundler.rubygems.add_to_load_path(load_paths)
|
45
32
|
|
46
33
|
setup_manpath
|
47
34
|
|
@@ -50,14 +37,6 @@ module Bundler
|
|
50
37
|
self
|
51
38
|
end
|
52
39
|
|
53
|
-
REQUIRE_ERRORS = [
|
54
|
-
/^no such file to load -- (.+)$/i,
|
55
|
-
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
|
56
|
-
/^Missing API definition file in (.+)$/i,
|
57
|
-
/^cannot load such file -- (.+)$/i,
|
58
|
-
/^dlopen\([^)]*\): Library not loaded: (.+)$/i,
|
59
|
-
].freeze
|
60
|
-
|
61
40
|
def require(*groups)
|
62
41
|
groups.map!(&:to_sym)
|
63
42
|
groups = [:default] if groups.empty?
|
@@ -86,16 +65,14 @@ module Bundler
|
|
86
65
|
end
|
87
66
|
end
|
88
67
|
rescue LoadError => e
|
89
|
-
|
90
|
-
raise if dep.autorequire || $1 != required_file
|
68
|
+
raise if dep.autorequire || e.path != required_file
|
91
69
|
|
92
70
|
if dep.autorequire.nil? && dep.name.include?("-")
|
93
71
|
begin
|
94
72
|
namespaced_file = dep.name.tr("-", "/")
|
95
73
|
Kernel.require namespaced_file
|
96
74
|
rescue LoadError => e
|
97
|
-
|
98
|
-
raise if $1 != namespaced_file
|
75
|
+
raise if e.path != namespaced_file
|
99
76
|
end
|
100
77
|
end
|
101
78
|
end
|
@@ -123,7 +100,7 @@ module Bundler
|
|
123
100
|
|
124
101
|
alias_method :gems, :specs
|
125
102
|
|
126
|
-
def cache(custom_path = nil)
|
103
|
+
def cache(custom_path = nil, local = false)
|
127
104
|
cache_path = Bundler.app_cache(custom_path)
|
128
105
|
SharedHelpers.filesystem_access(cache_path) do |p|
|
129
106
|
FileUtils.mkdir_p(p)
|
@@ -131,7 +108,20 @@ module Bundler
|
|
131
108
|
|
132
109
|
Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
|
133
110
|
|
134
|
-
specs_to_cache = Bundler.settings[:cache_all_platforms]
|
111
|
+
specs_to_cache = if Bundler.settings[:cache_all_platforms]
|
112
|
+
@definition.resolve.materialized_for_all_platforms
|
113
|
+
else
|
114
|
+
begin
|
115
|
+
specs
|
116
|
+
rescue GemNotFound
|
117
|
+
if local
|
118
|
+
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
119
|
+
end
|
120
|
+
|
121
|
+
raise
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
135
125
|
specs_to_cache.each do |spec|
|
136
126
|
next if spec.name == "bundler"
|
137
127
|
next if spec.source.is_a?(Source::Gemspec)
|
@@ -163,7 +153,7 @@ module Bundler
|
|
163
153
|
gem_dirs = Dir["#{Gem.dir}/gems/*"]
|
164
154
|
gem_files = Dir["#{Gem.dir}/cache/*.gem"]
|
165
155
|
gemspec_files = Dir["#{Gem.dir}/specifications/*.gemspec"]
|
166
|
-
extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"]
|
156
|
+
extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"] + Dir["#{Gem.dir}/bundler/gems/extensions/*/*/*"]
|
167
157
|
spec_gem_paths = []
|
168
158
|
# need to keep git sources around
|
169
159
|
spec_git_paths = @definition.spec_git_paths
|
@@ -172,7 +162,7 @@ module Bundler
|
|
172
162
|
spec_cache_paths = []
|
173
163
|
spec_gemspec_paths = []
|
174
164
|
spec_extension_paths = []
|
175
|
-
specs.each do |spec|
|
165
|
+
Bundler.rubygems.add_default_gems_to(specs).values.each do |spec|
|
176
166
|
spec_gem_paths << spec.full_gem_path
|
177
167
|
# need to check here in case gems are nested like for the rails git repo
|
178
168
|
md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
|
@@ -220,7 +210,7 @@ module Bundler
|
|
220
210
|
output
|
221
211
|
end
|
222
212
|
|
223
|
-
|
213
|
+
private
|
224
214
|
|
225
215
|
def prune_gem_cache(resolve, cache_path)
|
226
216
|
cached = Dir["#{cache_path}/*.gem"]
|
@@ -275,7 +265,7 @@ module Bundler
|
|
275
265
|
|
276
266
|
return if manuals.empty?
|
277
267
|
Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
|
278
|
-
ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR)
|
268
|
+
ENV["MANPATH"] ? ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR) : [""]
|
279
269
|
).uniq.join(File::PATH_SEPARATOR)
|
280
270
|
end
|
281
271
|
|
@@ -301,7 +291,7 @@ module Bundler
|
|
301
291
|
return unless activated_spec = Bundler.rubygems.loaded_specs(spec.name)
|
302
292
|
return if activated_spec.version == spec.version
|
303
293
|
|
304
|
-
suggestion = if
|
294
|
+
suggestion = if activated_spec.default_gem?
|
305
295
|
"Since #{spec.name} is a default gem, you can either remove your dependency on it" \
|
306
296
|
" or try updating to a newer version of bundler that supports #{spec.name} as a default gem."
|
307
297
|
else
|
data/lib/bundler/settings.rb
CHANGED
@@ -1,64 +1,51 @@
|
|
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
10
|
allow_deployment_source_credential_changes
|
14
11
|
allow_offline_install
|
15
12
|
auto_clean_without_path
|
16
13
|
auto_install
|
17
|
-
auto_config_jobs
|
18
14
|
cache_all
|
19
15
|
cache_all_platforms
|
20
|
-
|
21
|
-
console_command
|
16
|
+
clean
|
22
17
|
default_install_uses_path
|
23
18
|
deployment
|
24
|
-
deployment_means_frozen
|
25
19
|
disable_checksum_validation
|
26
20
|
disable_exec_load
|
27
21
|
disable_local_branch_check
|
28
|
-
|
29
|
-
disable_platform_warnings
|
22
|
+
disable_local_revision_check
|
30
23
|
disable_shared_gems
|
31
24
|
disable_version_check
|
32
|
-
error_on_stderr
|
33
25
|
force_ruby_platform
|
34
26
|
forget_cli_options
|
35
27
|
frozen
|
28
|
+
gem.changelog
|
36
29
|
gem.coc
|
37
30
|
gem.mit
|
38
|
-
|
31
|
+
git.allow_insecure
|
39
32
|
global_gem_cache
|
40
33
|
ignore_messages
|
41
34
|
init_gems_rb
|
42
|
-
|
43
|
-
lockfile_uses_separate_rubygems_sources
|
44
|
-
major_deprecations
|
35
|
+
inline
|
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
46
|
suppress_install_using_messages
|
58
|
-
unlock_source_unlocks_spec
|
59
47
|
update_requires_all_flag
|
60
48
|
use_gem_version_promoter_for_major_updates
|
61
|
-
viz_command
|
62
49
|
].freeze
|
63
50
|
|
64
51
|
NUMBER_KEYS = %w[
|
@@ -74,29 +61,42 @@ module Bundler
|
|
74
61
|
without
|
75
62
|
].freeze
|
76
63
|
|
64
|
+
STRING_KEYS = %w[
|
65
|
+
bin
|
66
|
+
cache_path
|
67
|
+
console
|
68
|
+
gem.ci
|
69
|
+
gem.github_username
|
70
|
+
gem.linter
|
71
|
+
gem.rubocop
|
72
|
+
gem.test
|
73
|
+
gemfile
|
74
|
+
path
|
75
|
+
shebang
|
76
|
+
system_bindir
|
77
|
+
trust-policy
|
78
|
+
].freeze
|
79
|
+
|
77
80
|
DEFAULT_CONFIG = {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
81
|
+
"BUNDLE_SILENCE_DEPRECATIONS" => false,
|
82
|
+
"BUNDLE_DISABLE_VERSION_CHECK" => true,
|
83
|
+
"BUNDLE_PREFER_PATCH" => false,
|
84
|
+
"BUNDLE_REDIRECT" => 5,
|
85
|
+
"BUNDLE_RETRY" => 3,
|
86
|
+
"BUNDLE_TIMEOUT" => 10,
|
82
87
|
}.freeze
|
83
88
|
|
84
89
|
def initialize(root = nil)
|
85
90
|
@root = root
|
86
91
|
@local_config = load_config(local_config_file)
|
92
|
+
@env_config = ENV.to_h.select {|key, _value| key =~ /\ABUNDLE_.+/ }
|
87
93
|
@global_config = load_config(global_config_file)
|
88
94
|
@temporary = {}
|
89
95
|
end
|
90
96
|
|
91
97
|
def [](name)
|
92
98
|
key = key_for(name)
|
93
|
-
value =
|
94
|
-
@local_config.fetch(key) do
|
95
|
-
ENV.fetch(key) do
|
96
|
-
@global_config.fetch(key) do
|
97
|
-
DEFAULT_CONFIG.fetch(name) do
|
98
|
-
nil
|
99
|
-
end end end end end
|
99
|
+
value = configs.values.map {|config| config[key] }.compact.first
|
100
100
|
|
101
101
|
converted_value(value, name)
|
102
102
|
end
|
@@ -106,18 +106,6 @@ module Bundler
|
|
106
106
|
temporary(key => value)
|
107
107
|
value
|
108
108
|
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
109
|
set_local(key, value)
|
122
110
|
end
|
123
111
|
end
|
@@ -151,13 +139,11 @@ module Bundler
|
|
151
139
|
end
|
152
140
|
|
153
141
|
def all
|
154
|
-
|
155
|
-
|
156
|
-
keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
|
142
|
+
keys = @temporary.keys | @global_config.keys | @local_config.keys | @env_config.keys
|
157
143
|
|
158
144
|
keys.map do |key|
|
159
|
-
key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
|
160
|
-
end
|
145
|
+
key.sub(/^BUNDLE_/, "").gsub(/___/, "-").gsub(/__/, ".").downcase
|
146
|
+
end.sort
|
161
147
|
end
|
162
148
|
|
163
149
|
def local_overrides
|
@@ -169,7 +155,11 @@ module Bundler
|
|
169
155
|
end
|
170
156
|
|
171
157
|
def mirror_for(uri)
|
172
|
-
|
158
|
+
if uri.is_a?(String)
|
159
|
+
require_relative "vendored_uri"
|
160
|
+
uri = Bundler::URI(uri)
|
161
|
+
end
|
162
|
+
|
173
163
|
gem_mirrors.for(uri.to_s).uri
|
174
164
|
end
|
175
165
|
|
@@ -186,13 +176,11 @@ module Bundler
|
|
186
176
|
|
187
177
|
def locations(key)
|
188
178
|
key = key_for(key)
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
|
195
|
-
locations
|
179
|
+
configs.keys.inject({}) do |partial_locations, level|
|
180
|
+
value_on_level = configs[level][key]
|
181
|
+
partial_locations[level] = value_on_level unless value_on_level.nil?
|
182
|
+
partial_locations
|
183
|
+
end
|
196
184
|
end
|
197
185
|
|
198
186
|
def pretty_values_for(exposed_key)
|
@@ -200,50 +188,58 @@ module Bundler
|
|
200
188
|
|
201
189
|
locations = []
|
202
190
|
|
203
|
-
if @temporary
|
204
|
-
locations << "Set for the current command: #{
|
191
|
+
if value = @temporary[key]
|
192
|
+
locations << "Set for the current command: #{printable_value(value, exposed_key).inspect}"
|
205
193
|
end
|
206
194
|
|
207
|
-
if @local_config
|
208
|
-
locations << "Set for your local app (#{local_config_file}): #{
|
195
|
+
if value = @local_config[key]
|
196
|
+
locations << "Set for your local app (#{local_config_file}): #{printable_value(value, exposed_key).inspect}"
|
209
197
|
end
|
210
198
|
|
211
|
-
if value =
|
212
|
-
locations << "Set via #{key}: #{
|
199
|
+
if value = @env_config[key]
|
200
|
+
locations << "Set via #{key}: #{printable_value(value, exposed_key).inspect}"
|
213
201
|
end
|
214
202
|
|
215
|
-
if @global_config
|
216
|
-
locations << "Set for the current user (#{global_config_file}): #{
|
203
|
+
if value = @global_config[key]
|
204
|
+
locations << "Set for the current user (#{global_config_file}): #{printable_value(value, exposed_key).inspect}"
|
217
205
|
end
|
218
206
|
|
219
207
|
return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
|
220
208
|
locations
|
221
209
|
end
|
222
210
|
|
223
|
-
|
224
|
-
|
211
|
+
def processor_count
|
212
|
+
require "etc"
|
213
|
+
Etc.nprocessors
|
214
|
+
rescue StandardError
|
215
|
+
1
|
216
|
+
end
|
217
|
+
|
218
|
+
# for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
|
225
219
|
def path
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
220
|
+
configs.each do |_level, settings|
|
221
|
+
path = value_for("path", settings)
|
222
|
+
path_system = value_for("path.system", settings)
|
223
|
+
disabled_shared_gems = value_for("disable_shared_gems", settings)
|
224
|
+
next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
|
225
|
+
system_path = path_system || (disabled_shared_gems == false)
|
226
|
+
return Path.new(path, system_path)
|
230
227
|
end
|
231
228
|
|
232
|
-
|
233
|
-
Path.new(self[:path], true, system_path, Bundler.feature_flag.default_install_uses_path?)
|
229
|
+
Path.new(nil, false)
|
234
230
|
end
|
235
231
|
|
236
|
-
Path = Struct.new(:explicit_path, :
|
232
|
+
Path = Struct.new(:explicit_path, :system_path) do
|
237
233
|
def path
|
238
234
|
path = base_path
|
239
|
-
path = File.join(path, Bundler.ruby_scope)
|
235
|
+
path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
|
240
236
|
path
|
241
237
|
end
|
242
238
|
|
243
239
|
def use_system_gems?
|
244
240
|
return true if system_path
|
245
241
|
return false if explicit_path
|
246
|
-
!default_install_uses_path
|
242
|
+
!Bundler.feature_flag.default_install_uses_path?
|
247
243
|
end
|
248
244
|
|
249
245
|
def base_path
|
@@ -296,20 +292,32 @@ module Bundler
|
|
296
292
|
|
297
293
|
def validate!
|
298
294
|
all.each do |raw_key|
|
299
|
-
[@local_config,
|
300
|
-
value =
|
301
|
-
Validator.validate!(raw_key, value, settings.
|
295
|
+
[@local_config, @env_config, @global_config].each do |settings|
|
296
|
+
value = value_for(raw_key, settings)
|
297
|
+
Validator.validate!(raw_key, value, settings.dup)
|
302
298
|
end
|
303
299
|
end
|
304
300
|
end
|
305
301
|
|
306
302
|
def key_for(key)
|
307
|
-
|
308
|
-
key = key.to_s.gsub(".", "__").upcase
|
309
|
-
"BUNDLE_#{key}"
|
303
|
+
self.class.key_for(key)
|
310
304
|
end
|
311
305
|
|
312
|
-
|
306
|
+
private
|
307
|
+
|
308
|
+
def configs
|
309
|
+
{
|
310
|
+
:temporary => @temporary,
|
311
|
+
:local => @local_config,
|
312
|
+
:env => @env_config,
|
313
|
+
:global => @global_config,
|
314
|
+
:default => DEFAULT_CONFIG,
|
315
|
+
}
|
316
|
+
end
|
317
|
+
|
318
|
+
def value_for(name, config)
|
319
|
+
converted_value(config[key_for(name)], name)
|
320
|
+
end
|
313
321
|
|
314
322
|
def parent_setting_for(name)
|
315
323
|
split_specific_setting_for(name)[0]
|
@@ -327,6 +335,10 @@ module Bundler
|
|
327
335
|
BOOL_KEYS.include?(name.to_s) || BOOL_KEYS.include?(parent_setting_for(name.to_s))
|
328
336
|
end
|
329
337
|
|
338
|
+
def is_string(name)
|
339
|
+
STRING_KEYS.include?(name.to_s) || name.to_s.start_with?("local.") || name.to_s.start_with?("mirror.") || name.to_s.start_with?("build.")
|
340
|
+
end
|
341
|
+
|
330
342
|
def to_bool(value)
|
331
343
|
case value
|
332
344
|
when nil, /\A(false|f|no|n|0|)\z/i, false
|
@@ -344,6 +356,14 @@ module Bundler
|
|
344
356
|
ARRAY_KEYS.include?(key.to_s)
|
345
357
|
end
|
346
358
|
|
359
|
+
def is_credential(key)
|
360
|
+
key == "gem.push_key"
|
361
|
+
end
|
362
|
+
|
363
|
+
def is_userinfo(value)
|
364
|
+
value.include?(":")
|
365
|
+
end
|
366
|
+
|
347
367
|
def to_array(value)
|
348
368
|
return [] unless value
|
349
369
|
value.split(":").map(&:to_sym)
|
@@ -371,7 +391,7 @@ module Bundler
|
|
371
391
|
return unless file
|
372
392
|
SharedHelpers.filesystem_access(file) do |p|
|
373
393
|
FileUtils.mkdir_p(p.dirname)
|
374
|
-
|
394
|
+
require_relative "yaml_serializer"
|
375
395
|
p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
|
376
396
|
end
|
377
397
|
end
|
@@ -390,15 +410,38 @@ module Bundler
|
|
390
410
|
end
|
391
411
|
end
|
392
412
|
|
413
|
+
def printable_value(value, key)
|
414
|
+
converted = converted_value(value, key)
|
415
|
+
return converted unless converted.is_a?(String)
|
416
|
+
|
417
|
+
if is_string(key)
|
418
|
+
converted
|
419
|
+
elsif is_credential(key)
|
420
|
+
"[REDACTED]"
|
421
|
+
elsif is_userinfo(converted)
|
422
|
+
username, pass = converted.split(":", 2)
|
423
|
+
|
424
|
+
if pass == "x-oauth-basic"
|
425
|
+
username = "[REDACTED]"
|
426
|
+
else
|
427
|
+
pass = "[REDACTED]"
|
428
|
+
end
|
429
|
+
|
430
|
+
[username, pass].join(":")
|
431
|
+
else
|
432
|
+
converted
|
433
|
+
end
|
434
|
+
end
|
435
|
+
|
393
436
|
def global_config_file
|
394
437
|
if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
|
395
438
|
Pathname.new(ENV["BUNDLE_CONFIG"])
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
439
|
+
elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
|
440
|
+
Pathname.new(ENV["BUNDLE_USER_CONFIG"])
|
441
|
+
elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
|
442
|
+
Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
|
443
|
+
elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
|
444
|
+
Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
|
402
445
|
end
|
403
446
|
end
|
404
447
|
|
@@ -406,27 +449,26 @@ module Bundler
|
|
406
449
|
Pathname.new(@root).join("config") if @root
|
407
450
|
end
|
408
451
|
|
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
452
|
def load_config(config_file)
|
424
453
|
return {} if !config_file || ignore_config?
|
425
454
|
SharedHelpers.filesystem_access(config_file, :read) do |file|
|
426
455
|
valid_file = file.exist? && !file.size.zero?
|
427
456
|
return {} unless valid_file
|
428
|
-
|
429
|
-
YAMLSerializer.load
|
457
|
+
require_relative "yaml_serializer"
|
458
|
+
YAMLSerializer.load(file.read).inject({}) do |config, (k, v)|
|
459
|
+
new_k = k
|
460
|
+
|
461
|
+
if k.include?("-")
|
462
|
+
Bundler.ui.warn "Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n" \
|
463
|
+
"This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n" \
|
464
|
+
"Please edit #{file} and replace any dashes in configuration keys with a triple underscore (`___`)."
|
465
|
+
|
466
|
+
new_k = k.gsub("-", "___")
|
467
|
+
end
|
468
|
+
|
469
|
+
config[new_k] = v
|
470
|
+
config
|
471
|
+
end
|
430
472
|
end
|
431
473
|
end
|
432
474
|
|
@@ -441,7 +483,13 @@ module Bundler
|
|
441
483
|
(https?.*?) # URI
|
442
484
|
(\.#{Regexp.union(PER_URI_OPTIONS)})? # optional suffix key
|
443
485
|
\z
|
444
|
-
/ix
|
486
|
+
/ix.freeze
|
487
|
+
|
488
|
+
def self.key_for(key)
|
489
|
+
key = normalize_uri(key).to_s if key.is_a?(String) && /https?:/ =~ key
|
490
|
+
key = key.to_s.gsub(".", "__").gsub("-", "___").upcase
|
491
|
+
"BUNDLE_#{key}"
|
492
|
+
end
|
445
493
|
|
446
494
|
# TODO: duplicates Rubygems#normalize_uri
|
447
495
|
# TODO: is this the correct place to validate mirror URIs?
|
@@ -453,7 +501,8 @@ module Bundler
|
|
453
501
|
suffix = $3
|
454
502
|
end
|
455
503
|
uri = "#{uri}/" unless uri.end_with?("/")
|
456
|
-
|
504
|
+
require_relative "vendored_uri"
|
505
|
+
uri = Bundler::URI(uri)
|
457
506
|
unless uri.absolute?
|
458
507
|
raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri)
|
459
508
|
end
|
data/lib/bundler/setup.rb
CHANGED
@@ -1,28 +1,27 @@
|
|
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
7
|
|
8
8
|
if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
|
9
9
|
begin
|
10
|
-
Bundler.setup
|
10
|
+
Bundler.ui.silence { Bundler.setup }
|
11
11
|
rescue Bundler::BundlerError => e
|
12
|
-
|
13
|
-
|
12
|
+
Bundler.ui.error e.message
|
13
|
+
Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
|
14
14
|
if e.is_a?(Bundler::GemNotFound)
|
15
|
-
|
15
|
+
Bundler.ui.warn "Run `bundle install` to install missing gems."
|
16
16
|
end
|
17
17
|
exit e.status_code
|
18
18
|
end
|
19
19
|
else
|
20
|
-
Bundler.setup
|
20
|
+
Bundler.ui.silence { Bundler.setup }
|
21
21
|
end
|
22
22
|
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Bundler.ui = nil
|
23
|
+
# We might be in the middle of shelling out to rubygems
|
24
|
+
# (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
|
25
|
+
# not being silent.
|
26
|
+
Gem::DefaultUserInteraction.ui = nil
|
28
27
|
end
|