Permalink
Browse files

added rake :graph task

generates and opens (os x) a dependency graph via the rubydeps gem.
  • Loading branch information...
1 parent 5c10c9f commit 9541a2f69762446c8a5c4657aa6ef3e334f80106 @rubiii rubiii committed Jul 14, 2013
Showing with 32 additions and 11 deletions.
  1. +1 −0 .gitignore
  2. +12 −11 Gemfile
  3. +14 −0 Rakefile
  4. +5 −0 spec/spec_helper.rb
View
@@ -2,6 +2,7 @@
.DS_Store
doc
coverage
+graph
pkg
*~
*.rbc
View
23 Gemfile
@@ -1,17 +1,18 @@
source 'https://rubygems.org'
gemspec
-group :development do
- # profiling
- #gem 'method_profiler', require: false
- #gem 'ruby-prof', require: false # does not work on jruby!
+# profiling
+#gem 'method_profiler', require: false
+#gem 'ruby-prof', require: false # does not work on jruby!
- # coverage
- gem 'simplecov', require: false
- gem 'coveralls', require: false
+# coverage
+gem 'simplecov', require: false
+gem 'coveralls', require: false
- # debugging
- #gem 'debugger', require: false # don't install on travis!
+# dependencies
+gem 'rubydeps', require: false
- gem 'fuubar'
-end
+# debugging
+#gem 'debugger', require: false # don't install on travis!
+
+gem 'fuubar'
View
@@ -3,5 +3,19 @@ require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
+desc 'Generate a dependency graph'
+task :graph do
+ system <<-BASH
+ rm -rf graph
+ mkdir graph
+ GRAPH=true rspec
+ mv rubydeps.dump graph
+ cd graph
+ rubydeps --path_filter='lib/savon'
+ dot -Tsvg rubydeps.dot > rubydeps.svg
+ open -a 'Google Chrome' rubydeps.svg
+ BASH
+end
+
task default: :spec
task test: :spec
View
@@ -19,6 +19,11 @@
logger.level = :debug
end
+if ENV['GRAPH']
+ require 'rubydeps'
+ Rubydeps.start
+end
+
require 'equivalent-xml'
support_files = File.expand_path('spec/support/**/*.rb')

0 comments on commit 9541a2f

Please sign in to comment.