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
commit0c7e7ae437900952b9f43f8a94e8b1aa57f3015f (patch)
tree7951cde4085e3d05858715132ca87a9b8b13c099 /Library/Homebrew/extend
parenta42714ce82545047921dc35b41b5fc08d4e9ac43 (diff)
downloadbrew-0c7e7ae437900952b9f43f8a94e8b1aa57f3015f.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