diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler.rb | 6 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 93093f2e32..9cf6924bda 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -286,7 +286,7 @@ module Bundler end end - app_config_root.join(app_config || ".bundle") + current_config_root.join(app_config || ".bundle") end def app_cache(custom_path = nil) @@ -685,5 +685,9 @@ EOF rescue GemfileNotFound Pathname.new(".").expand_path end + + def current_config_root + SharedHelpers.config_root + end end end diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 94e6875f00..529379ba44 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -20,6 +20,12 @@ module Bundler bundle_dir.parent end + def config_root + bundle_dir = default_bundle_dir + + bundle_dir ? bundle_dir.parent : Pathname.pwd + end + def default_gemfile gemfile = find_gemfile raise GemfileNotFound, "Could not locate Gemfile" unless gemfile |