summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-01-23 10:30:51 +0000
committerColby Swandale <me@colby.fyi>2019-04-01 22:15:46 +1100
commit9bca235729444a35c8759dc6be5446d089272fa2 (patch)
tree07df9ecd0cc4dc0e9b94f8ad9895c758feb2e3b0
parentfbab11810635b6c0843446320e7902186c7c715c (diff)
downloadbundler-9bca235729444a35c8759dc6be5446d089272fa2.tar.gz
Merge #6884
6884: Remove unnecessary condition r=hsbt a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that some code in the feature flags implementation seemed uncovered. ### What was your diagnosis of the problem? My diagnosis was that the code should be either covered or removed. ### What is your fix for the problem, implemented in this PR? My fix was to remove the code. ### Why did you choose this fix out of the possible options? I chose this fix because the scenario where that code would get covered is more likely to be unintentional and risk introducing a bug. Defining a feature flag without a default block is the same as don't defining a feature flag and just relying on the default value for the setting. In these circumstances, it's more likely that the developer forgot to include a default block, so letting that case crash would be better, I think. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> (cherry picked from commit ab06ed2e865cb40c75c83bc76bb7161277d6a185)
-rw-r--r--lib/bundler/feature_flag.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index e5b4e84063..7ee1e0d431 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -19,7 +19,7 @@ module Bundler
def self.settings_method(name, key, &default)
define_method(name) do
value = Bundler.settings[key]
- value = instance_eval(&default) if value.nil? && !default.nil?
+ value = instance_eval(&default) if value.nil?
value
end
end