diff options
author | Bundlerbot <bot@bundler.io> | 2019-01-23 10:30:51 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-01-23 10:30:51 +0000 |
commit | ab06ed2e865cb40c75c83bc76bb7161277d6a185 (patch) | |
tree | 14b122cfa49c7cecc7af7e2f80f1230765dd88dd | |
parent | f5e00a5867d09da235971db0bec4341db3312b29 (diff) | |
parent | 09e061e5eac32fa0a06ae578499ae16b4cd341a3 (diff) | |
download | bundler-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.rb | 2 |
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 |