railroady 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ require 'railroady'
2
+ require 'rails'
3
+ module RailRoady
4
+ class Railtie < Rails::Railtie
5
+ railtie_name :railroady
6
+
7
+ rake_tasks do
8
+ f = File.join(File.dirname(__FILE__), '..', '..', 'tasks', 'railroady.rake')
9
+ load f
10
+ # load 'tasks/railroady.rake'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ require 'yaml'
2
+ module RailRoady
3
+ module VERSION #:nodoc:
4
+ if File.exist?('../VERSION.yml')
5
+ config = YAML.load(File.read('../VERSION.yml'))
6
+ MAJOR = config[:major]
7
+ MINOR = config[:minor]
8
+ PATCH = config[:patch]
9
+ else
10
+ MAJOR = MINOR = PATCH = 0
11
+ end
12
+ STRING = [MAJOR, MINOR, PATCH].join('.')
13
+ end
14
+ end
@@ -0,0 +1,62 @@
1
+ # This suite of tasks generate graphical diagrams via code analysis.
2
+ # A UNIX-like environment is required as well as:
3
+ #
4
+ # * The railroady gem. (http://github.com/preston/railroady)
5
+ # * The graphviz package which includes the `dot` and `neato` command-line utilities. MacPorts users can install in via `sudo port install graphviz`.
6
+ # * The `sed` command-line utility, which should already be available on all sane UNIX systems.
7
+ #
8
+ # Author: Preston Lee, http://railroady.prestonlee.com
9
+
10
+ # Returns an absolute path for the following file.
11
+ def full_path(name = 'test.txt')
12
+ f = File.join(Rails.root.to_s, 'doc', name)
13
+ f.to_s
14
+ end
15
+
16
+ namespace :diagram do
17
+
18
+ @MODELS_ALL_SVG = full_path('models_complete.svg').freeze
19
+ @MODELS_BRIEF_SVG = full_path('models_brief.svg').freeze
20
+ @CONTROLLERS_ALL_SVG = full_path('controllers_complete.svg').freeze
21
+ @CONTROLLERS_BRIEF_SVG = full_path('controllers_brief.svg').freeze
22
+
23
+ namespace :models do
24
+
25
+ desc 'Generates an SVG class diagram for all models.'
26
+ task :complete do
27
+ f = @MODELS_ALL_SVG
28
+ puts "Generating #{f}"
29
+ sh "railroady -ilamM | dot -Tsvg > #{f}"
30
+ end
31
+
32
+ desc 'Generates an abbreviated SVG class diagram for all models.'
33
+ task :brief do
34
+ f = @MODELS_BRIEF_SVG
35
+ puts "Generating #{f}"
36
+ sh "railroady -bilamM | dot -Tsvg > #{f}"
37
+ end
38
+
39
+ end
40
+
41
+ namespace :controllers do
42
+
43
+ desc 'Generates an SVG class diagram for all controllers.'
44
+ task :complete do
45
+ f = @CONTROLLERS_ALL_SVG
46
+ puts "Generating #{f}"
47
+ sh "railroady -ilC | neato -Tsvg > #{f}"
48
+ end
49
+
50
+ desc 'Generates an abbreviated SVG class diagram for all controllers.'
51
+ task :brief do
52
+ f = @CONTROLLERS_BRIEF_SVG
53
+ puts "Generating #{f}"
54
+ sh "railroady -bilC | neato -Tsvg > #{f}"
55
+ end
56
+
57
+ end
58
+
59
+ desc 'Generates all SVG class diagrams.'
60
+ task :all => ['diagram:models:complete', 'diagram:models:brief', 'diagram:controllers:complete', 'diagram:controllers:brief']
61
+
62
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: railroady
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 9
8
+ - 0
9
+ version: 0.9.0
10
+ platform: ruby
11
+ authors:
12
+ - Preston Lee
13
+ - Tobias Crawley
14
+ - Peter Hoeg
15
+ - Javier Smaldone
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain: []
19
+
20
+ date: 2010-11-17 00:00:00 -07:00
21
+ default_executable: railroady
22
+ dependencies: []
23
+
24
+ description: A DOT diagram generator for Ruby on Rail applications.
25
+ email:
26
+ - conmotto@gmail.com
27
+ - tcrawley@gmail.com
28
+ - peter@hoeg.com
29
+ - p.hoeg@northwind.sg
30
+ - javier@smaldone.com.ar
31
+ executables:
32
+ - railroady
33
+ extensions: []
34
+
35
+ extra_rdoc_files:
36
+ - AUTHORS.rdoc
37
+ - CHANGELOG.rdoc
38
+ - LICENSE.rdoc
39
+ - README.rdoc
40
+ files:
41
+ - .document
42
+ - AUTHORS.rdoc
43
+ - CHANGELOG.rdoc
44
+ - LICENSE.rdoc
45
+ - README.rdoc
46
+ - Rakefile
47
+ - VERSION.yml
48
+ - bin/railroady
49
+ - lib/railroady.rb
50
+ - lib/railroady/aasm_diagram.rb
51
+ - lib/railroady/app_diagram.rb
52
+ - lib/railroady/controllers_diagram.rb
53
+ - lib/railroady/diagram_graph.rb
54
+ - lib/railroady/models_diagram.rb
55
+ - lib/railroady/options_struct.rb
56
+ - lib/railroady/railtie.rb
57
+ - lib/railroady/version.rb
58
+ - tasks/railroady.rake
59
+ has_rdoc: true
60
+ homepage: http://github.com/preston/railroady
61
+ licenses: []
62
+
63
+ post_install_message:
64
+ rdoc_options: []
65
+
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ segments:
74
+ - 0
75
+ version: "0"
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ requirements: []
85
+
86
+ rubyforge_project:
87
+ rubygems_version: 1.3.7
88
+ signing_key:
89
+ specification_version: 3
90
+ summary: A DOT diagram generator for Ruby on Rail applications.
91
+ test_files: []
92
+