Sha256: 702e287325e0f0bf1a67cae55d323b47a11a15f4436d09de9544e81d7d30b813
Contents?: true
Size: 1.37 KB
Versions: 22
Compression:
Stored size: 1.37 KB
Contents
namespace :state_machine do desc 'Draws a set of state machines using GraphViz. Target files to load with FILE=x,y,z; Machine class with CLASS=x,y,z; Font name with FONT=x; Image format with FORMAT=x; Orientation with ORIENTATION=x' task :draw do # Load the library $:.unshift(File.dirname(__FILE__) + '/lib') require 'state_machine' # Build drawing options options = {} options[:file] = ENV['FILE'] if ENV['FILE'] options[:path] = ENV['TARGET'] if ENV['TARGET'] options[:format] = ENV['FORMAT'] if ENV['FORMAT'] options[:font] = ENV['FONT'] if ENV['FONT'] options[:orientation] = ENV['ORIENTATION'] if ENV['ORIENTATION'] StateMachine::Machine.draw(ENV['CLASS'], options) end namespace :draw do desc 'Draws a set of state machines using GraphViz for a Ruby on Rails application. Target class with CLASS=x,y,z; Font name with FONT=x; Image format with FORMAT=x; Orientation with ORIENTATION=x' task :rails => [:environment, 'state_machine:draw'] desc 'Draws a set of state machines using GraphViz for a Merb application. Target class with CLASS=x,y,z; Font name with FONT=x; Image format with FORMAT=x; Orientation with ORIENTATION=x' task :merb => [:merb_env] do # Fix ruby-graphviz being incompatible with Merb's process title $0 = 'rake' Rake::Task['state_machine:draw'].invoke end end end
Version data entries
22 entries across 22 versions & 4 rubygems