aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorMax Howell2012-03-02 20:28:54 +0000
committerMax Howell2012-03-16 21:06:15 +0000
commitfb13b6a99e48984fc74675784f74cb409a4a7557 (patch)
treef873307d6972ce088c9b0302ee7cce3d45573197 /Library/Homebrew/extend
parent36ebeb2d04d03290e9721fb0e687532af84c9fb2 (diff)
downloadhomebrew-fb13b6a99e48984fc74675784f74cb409a4a7557.tar.bz2
`brew tap` and `brew untap`
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/pathname.rb11
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