summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-01-23 10:30:51 +0000
committerBundlerbot <bot@bundler.io>2019-01-23 10:30:51 +0000
commitab06ed2e865cb40c75c83bc76bb7161277d6a185 (patch)
tree14b122cfa49c7cecc7af7e2f80f1230765dd88dd
parentf5e00a5867d09da235971db0bec4341db3312b29 (diff)
parent09e061e5eac32fa0a06ae578499ae16b4cd341a3 (diff)
downloadbundler-ab06ed2e865cb40c75c83bc76bb7161277d6a185.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>
-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 249170c4b2..0adbd9190f 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