summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-11-19 14:00:58 -0800
committerAndre Arko <andre@arko.net>2014-11-19 14:01:01 -0800
commit2cd59934fb9f25b3521b8d080a40aa4a9b746fe0 (patch)
tree1ce6dd31719df6290b8ad3a165849cbaf386137f
parent9c5d3bd60aa1c6d891d41d368aed90e11c2ecfe3 (diff)
downloadbundler-2cd59934fb9f25b3521b8d080a40aa4a9b746fe0.tar.gz
guarantee Bundler.settings will only parse once
-rw-r--r--lib/bundler.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 1eaf194b8f..69287a3ebf 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -210,11 +210,10 @@ module Bundler
end
def settings
- @settings ||= begin
- Settings.new(app_config_path)
- rescue GemfileNotFound
- Settings.new
- end
+ return @settings if defined?(@settings)
+ @settings = Settings.new(app_config_path)
+ rescue GemfileNotFound
+ @settings = Settings.new
end
def with_original_env