From 51bec382b03574d71797d18a03a035f7bdc55f80 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 1 Mar 2014 17:49:57 -0600 Subject: [PATCH] Make conditional more obvious --- Library/Homebrew/formula.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index c632fba2e7..1a7b0dc696 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -394,9 +394,12 @@ class Formula if name =~ %r{(.+)/(.+)/(.+)} tap_name = "#$1-#$2".downcase tapd = Pathname.new("#{HOMEBREW_LIBRARY}/Taps/#{tap_name}") - tapd.find_formula do |relative_pathname| - return "#{tapd}/#{relative_pathname}" if relative_pathname.stem.to_s == $3 - end if tapd.directory? + + if tapd.directory? + tapd.find_formula do |relative_pathname| + return "#{tapd}/#{relative_pathname}" if relative_pathname.stem.to_s == $3 + end + end end # Otherwise don't resolve paths or URLs return name