Permalink
Browse files

Add task to create a graph of rake dependencies.

  • Loading branch information...
drbrain committed Jul 31, 2008
1 parent 3197850 commit 58a47f9b557644b5a83b265b40129111c06be215
Showing with 20 additions and 1 deletion.
  1. +1 −1 .gitignore
  2. +19 −0 rakelib/graph.rake
View
@@ -41,8 +41,8 @@ shotgun/lib/subtend/*.d
\#*
.\#*
*.dSYM
+/rubinius_tasks.dot
-/vm/.deps
/vm/log
attic/externals/syd-parser/pkg
View
@@ -0,0 +1,19 @@
+task :graph, :exclude do |_, args|
+ begin
+ require 'graph'
+ rescue LoadError
+ abort 'install ZenHacks'
+ end
+
+ exclude = /#{args[:exclude]}/ if args[:exclude]
+
+ graph = Graph.new
+
+ Rake::Task.tasks.each do |task|
+ next if exclude and task.name =~ exclude
+ graph[task.name] = task.prerequisites
+ end
+
+ open 'rubinius_tasks.dot', 'w' do |io| io << graph end
+end
+

0 comments on commit 58a47f9

Please sign in to comment.