From b241c53d1782745d694545000a7f4c251b243a1b Mon Sep 17 00:00:00 2001 From: Greg Werbin Date: Sun, 10 Sep 2017 20:30:43 -0400 Subject: Allow the user to set alternative to ~/.bundle Recognize new environment variables, with the following fallbacks: $BUNDLE_USER_HOME -> $HOME/.bundle $BUNDLE_USER_CACHE -> $BUNDLE_USER_HOME/cache $BUNDLE_USER_CONFIG -> $BUNDLE_USER_HOME/config $BUNDLE_USER_PLUGIN -> $BUNDLE_USER_HOME/plugin TODOs: - Error handling in Bundler.user_bundle_path when an invalid option is passed - Add tests (see https://github.com/bundler/bundler/pull/5787/commits/47fbe99387fea73fa652ad6692349b24cad6fe2e) - Draft PR with reference to GitHub issue numbers (not linked here as per contributing guidelines) + Issue: 4333 + Pull request: 5787 --- lib/bundler/plugin.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/bundler/plugin.rb') diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb index 99c9a867b0..7db159c593 100644 --- a/lib/bundler/plugin.rb +++ b/lib/bundler/plugin.rb @@ -80,8 +80,8 @@ module Bundler # The directory root for all plugin related data # - # Points to root in app_config_path if ran in an app else points to the one - # in user_bundle_path + # If run in an app, points to local root, in app_config_path + # Otherwise, points to global root, in Bundler.user_bundle_path("plugin") def root @root ||= if SharedHelpers.in_bundle? local_root @@ -96,7 +96,7 @@ module Bundler # The global directory root for all plugin related data def global_root - Bundler.user_bundle_path.join("plugin") + Bundler.user_bundle_path("plugin") end # The cache directory for plugin stuffs -- cgit v1.2.1