Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #6884
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bundlerbot and deivid-rodriguez committed Jan 23, 2019
2 parents f5e00a5 + 09e061e commit ab06ed2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler/feature_flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.settings_option(key, &default)
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
Expand Down

0 comments on commit ab06ed2

Please sign in to comment.