aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-06-29 21:35:57 -0500
committerJack Nagel2013-06-29 21:36:04 -0500
commit5b75c73df6ff868136831084b5e016f125e8a981 (patch)
tree554147350b2ded244a2b6a85f2a39ccbdac2f3c5 /Library
parent936f9487b1766c76d39d47cc12d40db6a5b79d31 (diff)
downloadbrew-5b75c73df6ff868136831084b5e016f125e8a981.tar.bz2
Do this in a saner way
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb6
-rw-r--r--Library/Homebrew/formula.rb8
2 files changed, 11 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 480af7b7a..49c9a158c 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -1023,7 +1023,11 @@ def check_for_unlinked_but_not_keg_only
if not rack.directory?
true
elsif not (HOMEBREW_REPOSITORY/"Library/LinkedKegs"/rack.basename).directory?
- Formula.factory(rack.basename.to_s).keg_only? rescue nil
+ begin
+ Formula.factory(rack.basename.to_s).keg_only?
+ rescue FormulaUnavailableError
+ false
+ end
else
true
end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index dbd31fade..0135726ac 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -350,8 +350,12 @@ class Formula
end
def self.installed
- # `rescue nil` is here to skip kegs with no corresponding formulae
- HOMEBREW_CELLAR.children.map{ |rack| factory(rack.basename.to_s) rescue nil }.compact
+ HOMEBREW_CELLAR.children.map do |rack|
+ begin
+ factory(rack.basename.to_s)
+ rescue FormulaUnavailableError
+ end
+ end.compact
end
def self.aliases