aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-08-10 16:05:30 -0400
committerMax Howell2012-08-13 10:14:59 -0400
commitb0e50ba13d9ce3a9f8c0e61c6ac54c1337e09c5c (patch)
tree70163855f2aa0315e4bbd4a6392a46f0dd09d01c /Library
parent3d657746bb2362d3120ec0b1f003dbec78b4b3c6 (diff)
downloadbrew-b0e50ba13d9ce3a9f8c0e61c6ac54c1337e09c5c.tar.bz2
Formula.select and Formula.installed
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index b61bb999a..2f4562449 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -304,6 +304,16 @@ class Formula
end
end
+ def self.select
+ ff = []
+ each{ |f| ff << f if yield(f) }
+ ff
+ end
+
+ def self.installed
+ HOMEBREW_CELLAR.children.map{ |rack| factory(rack.basename) rescue nil }.compact
+ end
+
def inspect
name
end