summaryrefslogtreecommitdiff
path: root/lib/bundler.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:19:04 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-13 07:54:37 +0900
commit0e60b59d5884edb8f9aea023efd9b24f1ff02049 (patch)
treee52935ce510440872ca5ce6b0e092cbc94f18bc9 /lib/bundler.rb
parent68224651a4d4dc3ce0cea666f5423dd8b6ba6cfc (diff)
Update the bundler version with master branch
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3086
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r--lib/bundler.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index df345539c8..610cc484e3 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -34,9 +34,9 @@ require_relative "bundler/build_metadata"
# of loaded and required modules.
#
module Bundler
- environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
+ environment_preserver = EnvironmentPreserver.from_env
ORIGINAL_ENV = environment_preserver.restore
- ENV.replace(environment_preserver.backup)
+ environment_preserver.replace_with_backup
SUDO_MUTEX = Mutex.new
autoload :Definition, File.expand_path("bundler/definition", __dir__)
@@ -285,7 +285,13 @@ module Bundler
def app_config_path
if app_config = ENV["BUNDLE_APP_CONFIG"]
- Pathname.new(app_config).expand_path(root)
+ app_config_pathname = Pathname.new(app_config)
+
+ if app_config_pathname.absolute?
+ app_config_pathname
+ else
+ app_config_pathname.expand_path(root)
+ end
else
root.join(".bundle")
end
@@ -451,6 +457,10 @@ EOF
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
end
+ def preferred_gemfile_name
+ Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
+ end
+
def use_system_gems?
configured_bundle_path.use_system_gems?
end
@@ -512,7 +522,8 @@ EOF
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
- bundle install --path vendor/bundle
+ bundle config set --local path 'vendor/bundle'
+ bundle install
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.