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.rb
CHANGED
@@ -1,65 +1,81 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require "bundler/vendored_fileutils"
|
3
|
+
require_relative "bundler/vendored_fileutils"
|
6
4
|
require "pathname"
|
7
5
|
require "rbconfig"
|
8
|
-
require "thread"
|
9
|
-
|
10
|
-
require "bundler/errors"
|
11
|
-
require "bundler/environment_preserver"
|
12
|
-
require "bundler/plugin"
|
13
|
-
require "bundler/rubygems_ext"
|
14
|
-
require "bundler/rubygems_integration"
|
15
|
-
require "bundler/version"
|
16
|
-
require "bundler/constants"
|
17
|
-
require "bundler/current_ruby"
|
18
|
-
require "bundler/build_metadata"
|
19
6
|
|
7
|
+
require_relative "bundler/errors"
|
8
|
+
require_relative "bundler/environment_preserver"
|
9
|
+
require_relative "bundler/plugin"
|
10
|
+
require_relative "bundler/rubygems_ext"
|
11
|
+
require_relative "bundler/rubygems_integration"
|
12
|
+
require_relative "bundler/version"
|
13
|
+
require_relative "bundler/constants"
|
14
|
+
require_relative "bundler/current_ruby"
|
15
|
+
require_relative "bundler/build_metadata"
|
16
|
+
|
17
|
+
# Bundler provides a consistent environment for Ruby projects by
|
18
|
+
# tracking and installing the exact gems and versions that are needed.
|
19
|
+
#
|
20
|
+
# Since Ruby 2.6, Bundler is a part of Ruby's standard library.
|
21
|
+
#
|
22
|
+
# Bunder is used by creating _gemfiles_ listing all the project dependencies
|
23
|
+
# and (optionally) their versions and then using
|
24
|
+
#
|
25
|
+
# require 'bundler/setup'
|
26
|
+
#
|
27
|
+
# or Bundler.setup to setup environment where only specified gems and their
|
28
|
+
# specified versions could be used.
|
29
|
+
#
|
30
|
+
# See {Bundler website}[https://bundler.io/docs.html] for extensive documentation
|
31
|
+
# on gemfiles creation and Bundler usage.
|
32
|
+
#
|
33
|
+
# As a standard library inside project, Bundler could be used for introspection
|
34
|
+
# of loaded and required modules.
|
35
|
+
#
|
20
36
|
module Bundler
|
21
|
-
environment_preserver = EnvironmentPreserver.
|
37
|
+
environment_preserver = EnvironmentPreserver.from_env
|
22
38
|
ORIGINAL_ENV = environment_preserver.restore
|
23
|
-
|
24
|
-
SUDO_MUTEX = Mutex.new
|
25
|
-
|
26
|
-
autoload :Definition, "bundler/definition"
|
27
|
-
autoload :Dependency, "bundler/dependency"
|
28
|
-
autoload :DepProxy, "bundler/dep_proxy"
|
29
|
-
autoload :Deprecate, "bundler/deprecate"
|
30
|
-
autoload :
|
31
|
-
autoload :
|
32
|
-
autoload :
|
33
|
-
autoload :
|
34
|
-
autoload :
|
35
|
-
autoload :
|
36
|
-
autoload :
|
37
|
-
autoload :
|
38
|
-
autoload :GemVersionPromoter, "bundler/gem_version_promoter"
|
39
|
-
autoload :Graph, "bundler/graph"
|
40
|
-
autoload :Index, "bundler/index"
|
41
|
-
autoload :Injector, "bundler/injector"
|
42
|
-
autoload :Installer, "bundler/installer"
|
43
|
-
autoload :LazySpecification, "bundler/lazy_specification"
|
44
|
-
autoload :LockfileParser, "bundler/lockfile_parser"
|
45
|
-
autoload :MatchPlatform, "bundler/match_platform"
|
46
|
-
autoload :ProcessLock, "bundler/process_lock"
|
47
|
-
autoload :RemoteSpecification, "bundler/remote_specification"
|
48
|
-
autoload :Resolver, "bundler/resolver"
|
49
|
-
autoload :Retry, "bundler/retry"
|
50
|
-
autoload :RubyDsl, "bundler/ruby_dsl"
|
51
|
-
autoload :
|
52
|
-
autoload :
|
53
|
-
autoload :
|
54
|
-
autoload :
|
55
|
-
autoload :
|
56
|
-
autoload :
|
57
|
-
autoload :
|
58
|
-
autoload :SpecSet, "bundler/spec_set"
|
59
|
-
autoload :StubSpecification, "bundler/stub_specification"
|
60
|
-
autoload :UI, "bundler/ui"
|
61
|
-
autoload :URICredentialsFilter, "bundler/uri_credentials_filter"
|
62
|
-
autoload :VersionRanges, "bundler/version_ranges"
|
39
|
+
environment_preserver.replace_with_backup
|
40
|
+
SUDO_MUTEX = Thread::Mutex.new
|
41
|
+
|
42
|
+
autoload :Definition, File.expand_path("bundler/definition", __dir__)
|
43
|
+
autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
|
44
|
+
autoload :DepProxy, File.expand_path("bundler/dep_proxy", __dir__)
|
45
|
+
autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
|
46
|
+
autoload :Digest, File.expand_path("bundler/digest", __dir__)
|
47
|
+
autoload :Dsl, File.expand_path("bundler/dsl", __dir__)
|
48
|
+
autoload :EndpointSpecification, File.expand_path("bundler/endpoint_specification", __dir__)
|
49
|
+
autoload :Env, File.expand_path("bundler/env", __dir__)
|
50
|
+
autoload :Fetcher, File.expand_path("bundler/fetcher", __dir__)
|
51
|
+
autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
|
52
|
+
autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
|
53
|
+
autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
|
54
|
+
autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
|
55
|
+
autoload :Graph, File.expand_path("bundler/graph", __dir__)
|
56
|
+
autoload :Index, File.expand_path("bundler/index", __dir__)
|
57
|
+
autoload :Injector, File.expand_path("bundler/injector", __dir__)
|
58
|
+
autoload :Installer, File.expand_path("bundler/installer", __dir__)
|
59
|
+
autoload :LazySpecification, File.expand_path("bundler/lazy_specification", __dir__)
|
60
|
+
autoload :LockfileParser, File.expand_path("bundler/lockfile_parser", __dir__)
|
61
|
+
autoload :MatchPlatform, File.expand_path("bundler/match_platform", __dir__)
|
62
|
+
autoload :ProcessLock, File.expand_path("bundler/process_lock", __dir__)
|
63
|
+
autoload :RemoteSpecification, File.expand_path("bundler/remote_specification", __dir__)
|
64
|
+
autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
|
65
|
+
autoload :Retry, File.expand_path("bundler/retry", __dir__)
|
66
|
+
autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
|
67
|
+
autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
|
68
|
+
autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
|
69
|
+
autoload :Settings, File.expand_path("bundler/settings", __dir__)
|
70
|
+
autoload :SharedHelpers, File.expand_path("bundler/shared_helpers", __dir__)
|
71
|
+
autoload :Source, File.expand_path("bundler/source", __dir__)
|
72
|
+
autoload :SourceList, File.expand_path("bundler/source_list", __dir__)
|
73
|
+
autoload :SourceMap, File.expand_path("bundler/source_map", __dir__)
|
74
|
+
autoload :SpecSet, File.expand_path("bundler/spec_set", __dir__)
|
75
|
+
autoload :StubSpecification, File.expand_path("bundler/stub_specification", __dir__)
|
76
|
+
autoload :UI, File.expand_path("bundler/ui", __dir__)
|
77
|
+
autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
|
78
|
+
autoload :VersionRanges, File.expand_path("bundler/version_ranges", __dir__)
|
63
79
|
|
64
80
|
class << self
|
65
81
|
def configure
|
@@ -67,11 +83,11 @@ module Bundler
|
|
67
83
|
end
|
68
84
|
|
69
85
|
def ui
|
70
|
-
(defined?(@ui) && @ui) || (self.ui = UI::
|
86
|
+
(defined?(@ui) && @ui) || (self.ui = UI::Shell.new)
|
71
87
|
end
|
72
88
|
|
73
89
|
def ui=(ui)
|
74
|
-
Bundler.rubygems.ui =
|
90
|
+
Bundler.rubygems.ui = UI::RGProxy.new(ui)
|
75
91
|
@ui = ui
|
76
92
|
end
|
77
93
|
|
@@ -94,6 +110,33 @@ module Bundler
|
|
94
110
|
end
|
95
111
|
end
|
96
112
|
|
113
|
+
# Turns on the Bundler runtime. After +Bundler.setup+ call, all +load+ or
|
114
|
+
# +require+ of the gems would be allowed only if they are part of
|
115
|
+
# the Gemfile or Ruby's standard library. If the versions specified
|
116
|
+
# in Gemfile, only those versions would be loaded.
|
117
|
+
#
|
118
|
+
# Assuming Gemfile
|
119
|
+
#
|
120
|
+
# gem 'first_gem', '= 1.0'
|
121
|
+
# group :test do
|
122
|
+
# gem 'second_gem', '= 1.0'
|
123
|
+
# end
|
124
|
+
#
|
125
|
+
# The code using Bundler.setup works as follows:
|
126
|
+
#
|
127
|
+
# require 'third_gem' # allowed, required from global gems
|
128
|
+
# require 'first_gem' # allowed, loads the last installed version
|
129
|
+
# Bundler.setup
|
130
|
+
# require 'fourth_gem' # fails with LoadError
|
131
|
+
# require 'second_gem' # loads exactly version 1.0
|
132
|
+
#
|
133
|
+
# +Bundler.setup+ can be called only once, all subsequent calls are no-op.
|
134
|
+
#
|
135
|
+
# If _groups_ list is provided, only gems from specified groups would
|
136
|
+
# be allowed (gems specified outside groups belong to special +:default+ group).
|
137
|
+
#
|
138
|
+
# To require all gems from Gemfile (or only some groups), see Bundler.require.
|
139
|
+
#
|
97
140
|
def setup(*groups)
|
98
141
|
# Return if all groups are already loaded
|
99
142
|
return @setup if defined?(@setup) && @setup
|
@@ -110,6 +153,24 @@ module Bundler
|
|
110
153
|
end
|
111
154
|
end
|
112
155
|
|
156
|
+
# Setups Bundler environment (see Bundler.setup) if it is not already set,
|
157
|
+
# and loads all gems from groups specified. Unlike ::setup, can be called
|
158
|
+
# multiple times with different groups (if they were allowed by setup).
|
159
|
+
#
|
160
|
+
# Assuming Gemfile
|
161
|
+
#
|
162
|
+
# gem 'first_gem', '= 1.0'
|
163
|
+
# group :test do
|
164
|
+
# gem 'second_gem', '= 1.0'
|
165
|
+
# end
|
166
|
+
#
|
167
|
+
# The code will work as follows:
|
168
|
+
#
|
169
|
+
# Bundler.setup # allow all groups
|
170
|
+
# Bundler.require(:default) # requires only first_gem
|
171
|
+
# # ...later
|
172
|
+
# Bundler.require(:test) # requires second_gem
|
173
|
+
#
|
113
174
|
def require(*groups)
|
114
175
|
setup(*groups).require(*groups)
|
115
176
|
end
|
@@ -119,7 +180,7 @@ module Bundler
|
|
119
180
|
end
|
120
181
|
|
121
182
|
def environment
|
122
|
-
SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
|
183
|
+
SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", :print_caller_location => true
|
123
184
|
load
|
124
185
|
end
|
125
186
|
|
@@ -138,7 +199,7 @@ module Bundler
|
|
138
199
|
|
139
200
|
def frozen_bundle?
|
140
201
|
frozen = settings[:deployment]
|
141
|
-
frozen ||= settings[:frozen]
|
202
|
+
frozen ||= settings[:frozen]
|
142
203
|
frozen
|
143
204
|
end
|
144
205
|
|
@@ -152,8 +213,14 @@ module Bundler
|
|
152
213
|
end
|
153
214
|
end
|
154
215
|
|
216
|
+
def most_specific_locked_platform?(platform)
|
217
|
+
return false unless defined?(@definition) && @definition
|
218
|
+
|
219
|
+
definition.most_specific_locked_platform == platform
|
220
|
+
end
|
221
|
+
|
155
222
|
def ruby_scope
|
156
|
-
"#{Bundler.rubygems.ruby_engine}/#{
|
223
|
+
"#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
|
157
224
|
end
|
158
225
|
|
159
226
|
def user_home
|
@@ -170,9 +237,9 @@ module Bundler
|
|
170
237
|
end
|
171
238
|
|
172
239
|
if warning
|
173
|
-
|
174
|
-
user_home = tmp_home_path
|
175
|
-
Bundler.ui.warn "
|
240
|
+
Bundler.ui.warn "#{warning}\n"
|
241
|
+
user_home = tmp_home_path
|
242
|
+
Bundler.ui.warn "Bundler will use `#{user_home}' as your home directory temporarily.\n"
|
176
243
|
user_home
|
177
244
|
else
|
178
245
|
Pathname.new(home)
|
@@ -180,37 +247,22 @@ module Bundler
|
|
180
247
|
end
|
181
248
|
end
|
182
249
|
|
183
|
-
def tmp_home_path(login, warning)
|
184
|
-
login ||= "unknown"
|
185
|
-
Kernel.send(:require, "tmpdir")
|
186
|
-
path = Pathname.new(Dir.tmpdir).join("bundler", "home")
|
187
|
-
SharedHelpers.filesystem_access(path) do |tmp_home_path|
|
188
|
-
unless tmp_home_path.exist?
|
189
|
-
tmp_home_path.mkpath
|
190
|
-
tmp_home_path.chmod(0o777)
|
191
|
-
end
|
192
|
-
tmp_home_path.join(login).tap(&:mkpath)
|
193
|
-
end
|
194
|
-
rescue RuntimeError => e
|
195
|
-
raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
|
196
|
-
end
|
197
|
-
|
198
250
|
def user_bundle_path(dir = "home")
|
199
251
|
env_var, fallback = case dir
|
200
252
|
when "home"
|
201
|
-
["BUNDLE_USER_HOME", Pathname.new(user_home).join(".bundle")]
|
253
|
+
["BUNDLE_USER_HOME", proc { Pathname.new(user_home).join(".bundle") }]
|
202
254
|
when "cache"
|
203
|
-
["BUNDLE_USER_CACHE", user_bundle_path.join("cache")]
|
255
|
+
["BUNDLE_USER_CACHE", proc { user_bundle_path.join("cache") }]
|
204
256
|
when "config"
|
205
|
-
["BUNDLE_USER_CONFIG", user_bundle_path.join("config")]
|
257
|
+
["BUNDLE_USER_CONFIG", proc { user_bundle_path.join("config") }]
|
206
258
|
when "plugin"
|
207
|
-
["BUNDLE_USER_PLUGIN", user_bundle_path.join("plugin")]
|
259
|
+
["BUNDLE_USER_PLUGIN", proc { user_bundle_path.join("plugin") }]
|
208
260
|
else
|
209
261
|
raise BundlerError, "Unknown user path requested: #{dir}"
|
210
262
|
end
|
211
263
|
# `fallback` will already be a Pathname, but Pathname.new() is
|
212
264
|
# idempotent so it's OK
|
213
|
-
Pathname.new(ENV.fetch(env_var, fallback))
|
265
|
+
Pathname.new(ENV.fetch(env_var, &fallback))
|
214
266
|
end
|
215
267
|
|
216
268
|
def user_cache
|
@@ -241,7 +293,13 @@ module Bundler
|
|
241
293
|
|
242
294
|
def app_config_path
|
243
295
|
if app_config = ENV["BUNDLE_APP_CONFIG"]
|
244
|
-
Pathname.new(app_config)
|
296
|
+
app_config_pathname = Pathname.new(app_config)
|
297
|
+
|
298
|
+
if app_config_pathname.absolute?
|
299
|
+
app_config_pathname
|
300
|
+
else
|
301
|
+
app_config_pathname.expand_path(root)
|
302
|
+
end
|
245
303
|
else
|
246
304
|
root.join(".bundle")
|
247
305
|
end
|
@@ -263,7 +321,7 @@ module Bundler
|
|
263
321
|
message = <<EOF
|
264
322
|
It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue.
|
265
323
|
You should probably consider fixing this issue by running `chmod o-w ~` on *nix.
|
266
|
-
Please refer to
|
324
|
+
Please refer to https://ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details.
|
267
325
|
EOF
|
268
326
|
File.world_writable?(path) ? Bundler.ui.warn(message) : raise
|
269
327
|
raise PathError, "Please fix the world-writable issue with your #{path} directory"
|
@@ -280,10 +338,20 @@ EOF
|
|
280
338
|
ORIGINAL_ENV.clone
|
281
339
|
end
|
282
340
|
|
283
|
-
# @deprecated Use `
|
284
|
-
# @return [Hash] Environment with all bundler-related variables removed
|
341
|
+
# @deprecated Use `unbundled_env` instead
|
285
342
|
def clean_env
|
286
|
-
Bundler::SharedHelpers.major_deprecation(
|
343
|
+
Bundler::SharedHelpers.major_deprecation(
|
344
|
+
2,
|
345
|
+
"`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
|
346
|
+
"If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`",
|
347
|
+
:print_caller_location => true
|
348
|
+
)
|
349
|
+
|
350
|
+
unbundled_env
|
351
|
+
end
|
352
|
+
|
353
|
+
# @return [Hash] Environment with all bundler-related variables removed
|
354
|
+
def unbundled_env
|
287
355
|
env = original_env
|
288
356
|
|
289
357
|
if env.key?("BUNDLER_ORIG_MANPATH")
|
@@ -293,7 +361,10 @@ EOF
|
|
293
361
|
env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
|
294
362
|
|
295
363
|
if env.key?("RUBYOPT")
|
296
|
-
|
364
|
+
rubyopt = env["RUBYOPT"].split(" ")
|
365
|
+
rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
|
366
|
+
rubyopt.delete("-rbundler/setup")
|
367
|
+
env["RUBYOPT"] = rubyopt.join(" ")
|
297
368
|
end
|
298
369
|
|
299
370
|
if env.key?("RUBYLIB")
|
@@ -305,24 +376,74 @@ EOF
|
|
305
376
|
env
|
306
377
|
end
|
307
378
|
|
379
|
+
# Run block with environment present before Bundler was activated
|
308
380
|
def with_original_env
|
309
381
|
with_env(original_env) { yield }
|
310
382
|
end
|
311
383
|
|
384
|
+
# @deprecated Use `with_unbundled_env` instead
|
312
385
|
def with_clean_env
|
313
|
-
|
386
|
+
Bundler::SharedHelpers.major_deprecation(
|
387
|
+
2,
|
388
|
+
"`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
|
389
|
+
"If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`",
|
390
|
+
:print_caller_location => true
|
391
|
+
)
|
392
|
+
|
393
|
+
with_env(unbundled_env) { yield }
|
394
|
+
end
|
395
|
+
|
396
|
+
# Run block with all bundler-related variables removed
|
397
|
+
def with_unbundled_env
|
398
|
+
with_env(unbundled_env) { yield }
|
399
|
+
end
|
400
|
+
|
401
|
+
# Run subcommand with the environment present before Bundler was activated
|
402
|
+
def original_system(*args)
|
403
|
+
with_original_env { Kernel.system(*args) }
|
314
404
|
end
|
315
405
|
|
406
|
+
# @deprecated Use `unbundled_system` instead
|
316
407
|
def clean_system(*args)
|
317
|
-
|
408
|
+
Bundler::SharedHelpers.major_deprecation(
|
409
|
+
2,
|
410
|
+
"`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
|
411
|
+
"If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`",
|
412
|
+
:print_caller_location => true
|
413
|
+
)
|
414
|
+
|
415
|
+
with_env(unbundled_env) { Kernel.system(*args) }
|
416
|
+
end
|
417
|
+
|
418
|
+
# Run subcommand in an environment with all bundler related variables removed
|
419
|
+
def unbundled_system(*args)
|
420
|
+
with_unbundled_env { Kernel.system(*args) }
|
421
|
+
end
|
422
|
+
|
423
|
+
# Run a `Kernel.exec` to a subcommand with the environment present before Bundler was activated
|
424
|
+
def original_exec(*args)
|
425
|
+
with_original_env { Kernel.exec(*args) }
|
318
426
|
end
|
319
427
|
|
428
|
+
# @deprecated Use `unbundled_exec` instead
|
320
429
|
def clean_exec(*args)
|
321
|
-
|
430
|
+
Bundler::SharedHelpers.major_deprecation(
|
431
|
+
2,
|
432
|
+
"`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
|
433
|
+
"If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`",
|
434
|
+
:print_caller_location => true
|
435
|
+
)
|
436
|
+
|
437
|
+
with_env(unbundled_env) { Kernel.exec(*args) }
|
438
|
+
end
|
439
|
+
|
440
|
+
# Run a `Kernel.exec` to a subcommand in an environment with all bundler related variables removed
|
441
|
+
def unbundled_exec(*args)
|
442
|
+
with_env(unbundled_env) { Kernel.exec(*args) }
|
322
443
|
end
|
323
444
|
|
324
445
|
def local_platform
|
325
|
-
return Gem::Platform::RUBY if settings[:force_ruby_platform]
|
446
|
+
return Gem::Platform::RUBY if settings[:force_ruby_platform] || Gem.platforms == [Gem::Platform::RUBY]
|
326
447
|
Gem::Platform.local
|
327
448
|
end
|
328
449
|
|
@@ -343,10 +464,14 @@ EOF
|
|
343
464
|
# system binaries. If you put '-n foo' in your .gemrc, RubyGems will
|
344
465
|
# install binstubs there instead. Unfortunately, RubyGems doesn't expose
|
345
466
|
# that directory at all, so rather than parse .gemrc ourselves, we allow
|
346
|
-
# the directory to be set as well, via `bundle config bindir foo`.
|
467
|
+
# the directory to be set as well, via `bundle config set --local bindir foo`.
|
347
468
|
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
|
348
469
|
end
|
349
470
|
|
471
|
+
def preferred_gemfile_name
|
472
|
+
Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
|
473
|
+
end
|
474
|
+
|
350
475
|
def use_system_gems?
|
351
476
|
configured_bundle_path.use_system_gems?
|
352
477
|
end
|
@@ -408,7 +533,8 @@ EOF
|
|
408
533
|
Your user account isn't allowed to install to the system RubyGems.
|
409
534
|
You can cancel this installation and run:
|
410
535
|
|
411
|
-
bundle
|
536
|
+
bundle config set --local path 'vendor/bundle'
|
537
|
+
bundle install
|
412
538
|
|
413
539
|
to install the gems into ./vendor/bundle/, or you can enter your password
|
414
540
|
and install the bundled gems to RubyGems using sudo.
|
@@ -484,6 +610,11 @@ EOF
|
|
484
610
|
reset_rubygems!
|
485
611
|
end
|
486
612
|
|
613
|
+
def reset_settings_and_root!
|
614
|
+
@settings = nil
|
615
|
+
@root = nil
|
616
|
+
end
|
617
|
+
|
487
618
|
def reset_paths!
|
488
619
|
@bin_path = nil
|
489
620
|
@bundler_major_version = nil
|
@@ -506,10 +637,16 @@ EOF
|
|
506
637
|
@rubygems = nil
|
507
638
|
end
|
508
639
|
|
509
|
-
|
640
|
+
def configure_gem_home_and_path(path = bundle_path)
|
641
|
+
configure_gem_path
|
642
|
+
configure_gem_home(path)
|
643
|
+
Bundler.rubygems.clear_paths
|
644
|
+
end
|
645
|
+
|
646
|
+
private
|
510
647
|
|
511
648
|
def eval_yaml_gemspec(path, contents)
|
512
|
-
|
649
|
+
require_relative "bundler/psyched_yaml"
|
513
650
|
|
514
651
|
# If the YAML is invalid, Syck raises an ArgumentError, and Psych
|
515
652
|
# raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
|
@@ -523,36 +660,29 @@ EOF
|
|
523
660
|
rescue ScriptError, StandardError => e
|
524
661
|
msg = "There was an error while loading `#{path.basename}`: #{e.message}"
|
525
662
|
|
526
|
-
if e.is_a?(LoadError) && RUBY_VERSION >= "1.9"
|
527
|
-
msg += "\nDoes it try to require a relative path? That's been removed in Ruby 1.9"
|
528
|
-
end
|
529
|
-
|
530
663
|
raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
|
531
664
|
end
|
532
665
|
|
533
|
-
def
|
534
|
-
|
535
|
-
configure_gem_home
|
536
|
-
bundle_path
|
537
|
-
end
|
538
|
-
|
539
|
-
def configure_gem_path(env = ENV)
|
540
|
-
blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
|
541
|
-
if !use_system_gems?
|
666
|
+
def configure_gem_path
|
667
|
+
unless use_system_gems?
|
542
668
|
# this needs to be empty string to cause
|
543
669
|
# PathSupport.split_gem_path to only load up the
|
544
670
|
# Bundler --path setting as the GEM_PATH.
|
545
|
-
|
546
|
-
elsif blank_home
|
547
|
-
possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
|
548
|
-
paths = possibles.flatten.compact.uniq.reject(&:empty?)
|
549
|
-
env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
|
671
|
+
Bundler::SharedHelpers.set_env "GEM_PATH", ""
|
550
672
|
end
|
551
673
|
end
|
552
674
|
|
553
|
-
def configure_gem_home
|
554
|
-
Bundler::SharedHelpers.set_env "GEM_HOME",
|
555
|
-
|
675
|
+
def configure_gem_home(path)
|
676
|
+
Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s
|
677
|
+
end
|
678
|
+
|
679
|
+
def tmp_home_path
|
680
|
+
Kernel.send(:require, "tmpdir")
|
681
|
+
SharedHelpers.filesystem_access(Dir.tmpdir) do
|
682
|
+
path = Bundler.tmp
|
683
|
+
at_exit { Bundler.rm_rf(path) }
|
684
|
+
path
|
685
|
+
end
|
556
686
|
end
|
557
687
|
|
558
688
|
# @param env [Hash]
|