diff options
| author | Max Howell | 2012-08-10 16:05:30 -0400 |
|---|---|---|
| committer | Max Howell | 2012-08-13 10:14:59 -0400 |
| commit | c4152e61b023861d9c629c76c33e3ec10ea73fbb (patch) | |
| tree | 5b311ec70c3ab537bc7b2880325985d364583fc3 /Library | |
| parent | eaef050ab968685f53afa8d3a46b887fedc729e6 (diff) | |
| download | homebrew-c4152e61b023861d9c629c76c33e3ec10ea73fbb.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 |
