diff options
| author | Markus Reiter | 2016-09-23 22:02:23 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-24 12:24:35 +0200 |
| commit | 58e36c73193befb57d351344cea2a4a33fef850d (patch) | |
| tree | 3d26751835440341e5a42a189cf580e6253785df /Library/Homebrew/formulary.rb | |
| parent | bbc3f1c3a852e6cfd26a7a7c333092fae0520eb4 (diff) | |
| download | brew-58e36c73193befb57d351344cea2a4a33fef850d.tar.bz2 | |
Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/formulary.rb')
| -rw-r--r-- | Library/Homebrew/formulary.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index a6ec45d3c..e3c893fd6 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -314,7 +314,9 @@ class Formulary possible_tap_formulae = tap_paths(ref) if possible_tap_formulae.size > 1 raise TapFormulaAmbiguityError.new(ref, possible_tap_formulae) - elsif possible_tap_formulae.size == 1 + end + + if possible_tap_formulae.size == 1 path = possible_tap_formulae.first.resolved_path name = path.basename(".rb").to_s return FormulaLoader.new(name, path) @@ -336,7 +338,9 @@ class Formulary if possible_tap_newname_formulae.size > 1 raise TapFormulaWithOldnameAmbiguityError.new(ref, possible_tap_newname_formulae) - elsif !possible_tap_newname_formulae.empty? + end + + unless possible_tap_newname_formulae.empty? return TapLoader.new(possible_tap_newname_formulae.first) end @@ -368,7 +372,9 @@ class Formulary possible_pinned_tap_formulae = tap_paths(ref, Dir["#{HOMEBREW_LIBRARY}/PinnedTaps/*/*/"]).map(&:realpath) if possible_pinned_tap_formulae.size > 1 raise TapFormulaAmbiguityError.new(ref, possible_pinned_tap_formulae) - elsif possible_pinned_tap_formulae.size == 1 + end + + if possible_pinned_tap_formulae.size == 1 selected_formula = factory(possible_pinned_tap_formulae.first, spec) if core_path(ref).file? opoo <<-EOS.undent |
