From 58a47f9b557644b5a83b265b40129111c06be215 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 30 Jul 2008 18:16:54 -0700 Subject: [PATCH] Add task to create a graph of rake dependencies. --- .gitignore | 2 +- rakelib/graph.rake | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 rakelib/graph.rake diff --git a/.gitignore b/.gitignore index 06a6728dce..83cc61a340 100644 --- a/.gitignore +++ b/.gitignore @@ -41,8 +41,8 @@ shotgun/lib/subtend/*.d \#* .\#* *.dSYM +/rubinius_tasks.dot -/vm/.deps /vm/log attic/externals/syd-parser/pkg diff --git a/rakelib/graph.rake b/rakelib/graph.rake new file mode 100644 index 0000000000..0ba362eee4 --- /dev/null +++ b/rakelib/graph.rake @@ -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 +