aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-depstree.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Contributions/examples/brew-depstree.rb b/Library/Contributions/examples/brew-depstree.rb
new file mode 100755
index 000000000..f8d6989b1
--- /dev/null
+++ b/Library/Contributions/examples/brew-depstree.rb
@@ -0,0 +1,21 @@
+require 'formula'
+
+module Homebrew extend self
+ def depstree
+ ARGV.formulae.each do |f|
+ puts f
+ recursive_deps_tree(f, 1)
+ puts
+ end
+ end
+
+private
+ def recursive_deps_tree(formula, level)
+ formula.deps.each do |dep|
+ puts "> "*level+dep
+ recursive_deps_tree(Formula.factory(dep), level+1)
+ end
+ end
+end
+
+Homebrew.depstree