Skip to content

Commit

Permalink
added rake :graph task
Browse files Browse the repository at this point in the history
generates and opens (os x) a dependency graph via the rubydeps gem.
  • Loading branch information
rubiii committed Jul 14, 2013
1 parent 5c10c9f commit 9541a2f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@
.DS_Store
doc
coverage
graph
pkg
*~
*.rbc
Expand Down
23 changes: 12 additions & 11 deletions 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'
14 changes: 14 additions & 0 deletions Rakefile
Expand Up @@ -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
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -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')
Expand Down

0 comments on commit 9541a2f

Please sign in to comment.