summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-09-25 19:13:06 -0300
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2020-03-09 18:25:09 +0100
commit1a2e631f16915f2716accf2c474f98bcb018fef8 (patch)
tree94737a1cb89b46518c32aa5c3ba6bd4910d3ca61
parent5c6868d925939c5681c2966350987f64e5bf1733 (diff)
downloadbundler-1a2e631f16915f2716accf2c474f98bcb018fef8.tar.gz
DRY up settings instantiation
-rw-r--r--lib/bundler.rb10
1 files 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