aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-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