From 1a2e631f16915f2716accf2c474f98bcb018fef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 25 Sep 2018 19:13:06 -0300 Subject: DRY up settings instantiation --- lib/bundler.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/bundler.rb b/lib/bundler.rb index ab293c5f8e..9a96fac11a 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -292,7 +292,7 @@ module Bundler end end - root.join(app_config || ".bundle") + app_config_root.join(app_config || ".bundle") end def app_cache(custom_path = nil) @@ -319,8 +319,6 @@ EOF def settings @settings ||= Settings.new(app_config_path) - rescue GemfileNotFound - @settings = Settings.new(Pathname.new(".bundle").expand_path) end # @return [Hash] Environment present before Bundler was activated @@ -687,5 +685,11 @@ EOF ensure ENV.replace(backup) end + + def app_config_root + root + rescue GemfileNotFound + Pathname.new(".").expand_path + end end end -- cgit v1.2.1