railroady 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = RailRoady
2
2
 
3
- RailRoady generates Rails 3 model and controller UML diagrams as cross-platform .svg files, as well as in the DOT language.
3
+ RailRoady generates Rails 3 model (AcitveRecord, Mongoid) and controller UML diagrams as cross-platform .svg files, as well as in the DOT language.
4
4
 
5
5
  Code is based on the original "railroad" gem, patched and maintained over the years. Lineage can be traced via GitHub.
6
6
 
@@ -141,7 +141,7 @@ As of Preston Lee's Rails 3 modifications, including RailRoady as a project deve
141
141
  RailRoady has been tested with the following Ruby and Rails versions
142
142
 
143
143
  == Ruby
144
- * 1.9.2
144
+ * 1.9.2+
145
145
 
146
146
  == Rails
147
147
  * 3.0.3+
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 0
4
- :patch: 5
4
+ :patch: 6
5
5
  :build:
@@ -6,27 +6,6 @@
6
6
 
7
7
  require 'railroady/diagram_graph'
8
8
 
9
- # camelize and constantize methods brought over from active_support
10
- class String
11
- def camelize(first_letter = :upper)
12
- if first_letter == :upper
13
- self.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
14
- else
15
- self.to_s[0].chr.downcase + self.camelize[1..-1]
16
- end
17
- end
18
- def constantize
19
- names = self.split('::')
20
- names.shift if names.empty? || names.first.empty?
21
-
22
- constant = Object
23
- names.each do |name|
24
- constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
25
- end
26
- constant
27
- end
28
- end
29
-
30
9
  # Root class for RailRoady diagrams
31
10
  class AppDiagram
32
11
 
@@ -108,13 +108,15 @@ class DiagramGraph
108
108
  # Build a DOT graph edge
109
109
  def dot_edge(type, from, to, name = '')
110
110
  options = name != '' ? "label=\"#{name}\", " : ''
111
+ edge_color = '"#%02X%02X%02X"' % [rand(255), rand(255), rand(255)]
112
+ suffix = ", dir=both color=#{edge_color}"
111
113
  case type
112
114
  when 'one-one'
113
- options += 'arrowtail=odot, arrowhead=dot, dir=both'
115
+ options += "arrowtail=odot, arrowhead=dot" + suffix
114
116
  when 'one-many'
115
- options += 'arrowtail=odot, arrowhead=crow, dir=both'
117
+ options += "arrowtail=odot, arrowhead=crow" + suffix
116
118
  when 'many-many'
117
- options += 'arrowtail=crow, arrowhead=crow, dir=both'
119
+ options += "arrowtail=crow, arrowhead=crow" + suffix
118
120
  when 'is-a'
119
121
  options += 'arrowhead="none", arrowtail="onormal"'
120
122
  when 'event'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railroady
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 5
10
- version: 1.0.5
9
+ - 6
10
+ version: 1.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Preston Lee
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-01-17 00:00:00 +05:30
21
+ date: 2012-02-03 00:00:00 +05:30
22
22
  default_executable: railroady
23
23
  dependencies: []
24
24