diff options
| author | Max Howell | 2012-03-02 20:28:54 +0000 |
|---|---|---|
| committer | Max Howell | 2012-03-16 21:06:15 +0000 |
| commit | fb13b6a99e48984fc74675784f74cb409a4a7557 (patch) | |
| tree | f873307d6972ce088c9b0302ee7cce3d45573197 /Library/Homebrew/extend | |
| parent | 36ebeb2d04d03290e9721fb0e687532af84c9fb2 (diff) | |
| download | homebrew-fb13b6a99e48984fc74675784f74cb409a4a7557.tar.bz2 | |
`brew tap` and `brew untap`
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 6057c1437..d0ed3108b 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -313,6 +313,17 @@ class Pathname end system '/usr/bin/install-info', '--delete', '--quiet', self.to_s, (self.dirname+'dir').to_s end + + def find_formula pwd = self + children.map{ |child| child.relative_path_from(pwd) }.each do |pn| + yield pn if pn.to_s =~ /.rb$/ + end + children.each do |child| + child.find_formula(pwd) do |pn| + yield pn + end if child.directory? + end + end end # sets $n and $d so you can observe creation of stuff |
