diff options
| author | Max Howell | 2012-08-10 16:05:30 -0400 |
|---|---|---|
| committer | Max Howell | 2012-08-13 10:14:59 -0400 |
| commit | b0e50ba13d9ce3a9f8c0e61c6ac54c1337e09c5c (patch) | |
| tree | 70163855f2aa0315e4bbd4a6392a46f0dd09d01c /Library | |
| parent | 3d657746bb2362d3120ec0b1f003dbec78b4b3c6 (diff) | |
| download | brew-b0e50ba13d9ce3a9f8c0e61c6ac54c1337e09c5c.tar.bz2 | |
Formula.select and Formula.installed
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 |
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 |
