model_graph 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +0 -0
- data/README +78 -0
- data/Rakefile +101 -0
- data/bin/model_graph +483 -0
- data/doc/classes/ModelGraph/Graph.html +313 -0
- data/doc/classes/ModelGraph/Graph.src/M000003.html +20 -0
- data/doc/classes/ModelGraph/Graph.src/M000004.html +18 -0
- data/doc/classes/ModelGraph/Graph.src/M000005.html +20 -0
- data/doc/classes/ModelGraph/Graph.src/M000006.html +35 -0
- data/doc/classes/ModelGraph/Graph.src/M000007.html +31 -0
- data/doc/classes/ModelGraph.html +341 -0
- data/doc/classes/ModelGraph.src/M000001.html +18 -0
- data/doc/classes/ModelGraph.src/M000002.html +120 -0
- data/doc/created.rid +1 -0
- data/doc/dot/f_0.dot +39 -0
- data/doc/dot/f_0.png +0 -0
- data/doc/dot/m_0_0.dot +39 -0
- data/doc/dot/m_0_0.png +0 -0
- data/doc/files/model_graph_rb.html +224 -0
- data/doc/fr_class_index.html +28 -0
- data/doc/fr_file_index.html +27 -0
- data/doc/fr_method_index.html +33 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/examples/badblog.rb +17 -0
- data/examples/blog.rb +35 -0
- data/examples/goodblog.rb +17 -0
- data/examples/hello.rb +6 -0
- data/examples/magazine.rb +36 -0
- data/examples/radiant.rb +41 -0
- data/lib/model_graph/version.rb +9 -0
- data/lib/model_graph.rb +1 -0
- data/test/model_graph_test.rb +13 -0
- data/test/test_helper.rb +5 -0
- metadata +97 -0
@@ -0,0 +1,341 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: ModelGraph</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ModelGraph</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/model_graph_rb.html">
|
59
|
+
model_graph.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000002">do_graph</a>
|
84
|
+
<a href="#M000001">posers</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
<div id="class-list">
|
96
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
97
|
+
|
98
|
+
Class <a href="ModelGraph/Graph.html" class="link">ModelGraph::Graph</a><br />
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<div id="constants-list">
|
103
|
+
<h3 class="section-bar">Constants</h3>
|
104
|
+
|
105
|
+
<div class="name-list">
|
106
|
+
<table summary="Constants">
|
107
|
+
<tr class="top-aligned-row context-row">
|
108
|
+
<td class="context-item-name">ARROW_FOR</td>
|
109
|
+
<td>=</td>
|
110
|
+
<td class="context-item-value">{ :belongs_to => 'tee', :has_many => 'crowodot', :has_one => 'odottee', :has_and_belongs_to_many => 'crowodot'</td>
|
111
|
+
<td width="3em"> </td>
|
112
|
+
<td class="context-item-desc">
|
113
|
+
Should :belongs_to differ when paired with :has_one versus :has_many?
|
114
|
+
|
115
|
+
<p>
|
116
|
+
Should :has_one be ‘teetee’ if required? (i.e., not null)
|
117
|
+
</p>
|
118
|
+
</td>
|
119
|
+
</tr>
|
120
|
+
</table>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<!-- if method_list -->
|
130
|
+
<div id="methods">
|
131
|
+
<h3 class="section-bar">Public Class methods</h3>
|
132
|
+
|
133
|
+
<div id="method-M000002" class="method-detail">
|
134
|
+
<a name="M000002"></a>
|
135
|
+
|
136
|
+
<div class="method-heading">
|
137
|
+
<a href="#M000002" class="method-signature">
|
138
|
+
<span class="method-name">do_graph</span><span class="method-args">(options)</span>
|
139
|
+
</a>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
<p>
|
144
|
+
Examines the models and constructs a DOT formatted graph description based
|
145
|
+
on the ActiveRecord associations that are discovered.
|
146
|
+
</p>
|
147
|
+
<p>
|
148
|
+
If called with:
|
149
|
+
</p>
|
150
|
+
<pre>
|
151
|
+
rake model_graph EDGES=Author-Book
|
152
|
+
</pre>
|
153
|
+
<p>
|
154
|
+
will cause an edge between, for example, Author and Book which can alter
|
155
|
+
the relative hierarchical rank of the two nodes (placing the first above
|
156
|
+
the second). This can often make a dramatic improvement in the overall
|
157
|
+
layout of the graph. Unless overridden with a normally discovered edge, the
|
158
|
+
plain arrow will be used to connect the two nodes (so a misspelt node is
|
159
|
+
more easily detected). Additional edges can be separated by ’/’
|
160
|
+
as in <tt>EDGES=Author-Book/Book-Chapter</tt>
|
161
|
+
</p>
|
162
|
+
<p>
|
163
|
+
If called with:
|
164
|
+
</p>
|
165
|
+
<pre>
|
166
|
+
rake model_graph NODES=Author
|
167
|
+
</pre>
|
168
|
+
<p>
|
169
|
+
will cause a node to be placed into the output early. This tends to make a
|
170
|
+
node appear further to the left in the resulting graph and can be used to
|
171
|
+
improve the overall layout. Typically, nodes are not specified, but are
|
172
|
+
left to be positioned based on their edges with other nodes. Additional
|
173
|
+
nodes can be separated by ’/’ as in <tt>NODES=Author/Book</tt>.
|
174
|
+
</p>
|
175
|
+
<h5>Options</h5>
|
176
|
+
<table>
|
177
|
+
<tr><td valign="top"><tt>NAME</tt>:</td><td>Change the name of the file into which the graph is written and the
|
178
|
+
internal name that is assigned.
|
179
|
+
|
180
|
+
</td></tr>
|
181
|
+
<tr><td valign="top"><tt>DEBUG</tt>:</td><td>When set to <em>any</em> value, causes comments describing the ActiveRecord
|
182
|
+
models to be included in the DOT output.
|
183
|
+
|
184
|
+
</td></tr>
|
185
|
+
<tr><td valign="top"><tt>EDGES</tt>:</td><td>With a value of <tt>N1-N2</tt> [<em>/N3-N4</em>…] adds a relationship
|
186
|
+
between <tt>N1</tt> and <tt>N2</tt> (and <tt>N3</tt> and <tt>N4</tt>, etc.)
|
187
|
+
as described above.
|
188
|
+
|
189
|
+
</td></tr>
|
190
|
+
<tr><td valign="top"><tt>NODES</tt>:</td><td>Adds extra <tt>nodes</tt> early in the DOT output to influence placement.
|
191
|
+
|
192
|
+
</td></tr>
|
193
|
+
<tr><td valign="top"><tt>TEST</tt>:</td><td>Graphs an internal set of model classes rather than what’s in
|
194
|
+
<tt>app/models/*.rb</tt>
|
195
|
+
|
196
|
+
</td></tr>
|
197
|
+
<tr><td valign="top"><tt>SHAPE</tt>:</td><td>Changes the default shape of the nodes in the graph (any [valid DOT <a
|
198
|
+
href="http://www.graphviz.org/doc/info/shapes.html">value}</a> is
|
199
|
+
acceptable, try <tt>rectangle</tt>)
|
200
|
+
|
201
|
+
</td></tr>
|
202
|
+
</table>
|
203
|
+
<p><a class="source-toggle" href="#"
|
204
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
205
|
+
<div class="method-source-code" id="M000002-source">
|
206
|
+
<pre>
|
207
|
+
<span class="ruby-comment cmt"># File model_graph.rb, line 231</span>
|
208
|
+
231: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">do_graph</span>(<span class="ruby-identifier">options</span>)
|
209
|
+
232: <span class="ruby-identifier">output</span> = <span class="ruby-value str">""</span>
|
210
|
+
233: <span class="ruby-identifier">graph</span> = <span class="ruby-constant">Graph</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">name</span>)
|
211
|
+
234:
|
212
|
+
235: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">edges</span>
|
213
|
+
236: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">edges</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(\w+)-(\w+)/?}</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span>,<span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
214
|
+
237: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_edge</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">t</span>, <span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'solid'</span>)
|
215
|
+
238: <span class="ruby-keyword kw">end</span>
|
216
|
+
239: <span class="ruby-keyword kw">end</span>
|
217
|
+
240:
|
218
|
+
241: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">nodes</span>
|
219
|
+
242: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(\w+)/?}</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
|
220
|
+
243: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">n</span>)
|
221
|
+
244: <span class="ruby-keyword kw">end</span>
|
222
|
+
245: <span class="ruby-keyword kw">end</span>
|
223
|
+
246:
|
224
|
+
247: <span class="ruby-identifier">version</span> = <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">current_version</span>
|
225
|
+
248: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
226
|
+
249: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"// Schema version: #{version}\n"</span>
|
227
|
+
250: <span class="ruby-keyword kw">end</span>
|
228
|
+
251:
|
229
|
+
252: <span class="ruby-comment cmt"># except that I'm spitting out the debugging, this could certainly go right</span>
|
230
|
+
253: <span class="ruby-comment cmt"># before the Graph.edges part:</span>
|
231
|
+
254: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"digraph #{graph.name} {\n"</span>
|
232
|
+
255: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" graph [overlap=scale, nodesep=0.5, ranksep=0.5, separation=0.25]\n"</span>
|
233
|
+
256: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" node [shape=#{ENV['SHAPE'].downcase}]\n"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'SHAPE'</span>].<span class="ruby-identifier">nil?</span>
|
234
|
+
257:
|
235
|
+
258: <span class="ruby-identifier">nodes</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> }
|
236
|
+
259:
|
237
|
+
260: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">klass</span> <span class="ruby-keyword kw">in</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:subclasses</span>)
|
238
|
+
261: <span class="ruby-comment cmt"># unless klass.name =~ /::/</span>
|
239
|
+
262: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">posers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
|
240
|
+
263:
|
241
|
+
264: <span class="ruby-comment cmt"># node</span>
|
242
|
+
265: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">debug</span>
|
243
|
+
266: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"// #{klass.name}"</span>
|
244
|
+
267: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" (#{klass.class_name})"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class_name</span>
|
245
|
+
268: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span>
|
246
|
+
269: <span class="ruby-keyword kw">end</span>
|
247
|
+
270:
|
248
|
+
271: <span class="ruby-identifier">standalone</span> = <span class="ruby-keyword kw">true</span>
|
249
|
+
272: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">a</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">reflect_on_all_associations</span>
|
250
|
+
273: <span class="ruby-comment cmt"># edge</span>
|
251
|
+
274: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">debug</span>
|
252
|
+
275: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" //"</span>
|
253
|
+
276: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" through #{a.through_reflection.class_name}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">through_reflection</span>
|
254
|
+
277: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{a.macro} #{a.class_name}"</span>
|
255
|
+
278: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" as #{a.options[:as].to_s.camelize.singularize}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:as</span>]
|
256
|
+
279: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span>
|
257
|
+
280: <span class="ruby-keyword kw">end</span>
|
258
|
+
281:
|
259
|
+
282: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">class_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelize</span>.<span class="ruby-identifier">singularize</span>
|
260
|
+
283:
|
261
|
+
284: <span class="ruby-identifier">opts</span> = { <span class="ruby-value str">'label'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">macro</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value str">'arrow'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">ARROW_FOR</span>[<span class="ruby-identifier">a</span>.<span class="ruby-identifier">macro</span>] }
|
262
|
+
285: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'dotted'</span>, <span class="ruby-value str">'constraint'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'false'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">through_reflection</span>
|
263
|
+
286: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'dashed'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:as</span>]
|
264
|
+
287: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'bold'</span>, <span class="ruby-value str">'color'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'blue'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:polymorphic</span>]
|
265
|
+
288:
|
266
|
+
289: <span class="ruby-identifier">fromnodename</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span>
|
267
|
+
290: <span class="ruby-identifier">tonodename</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelize</span>.<span class="ruby-identifier">singularize</span>
|
268
|
+
291:
|
269
|
+
292: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">macro</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:has_and_belongs_to_many</span>
|
270
|
+
293: <span class="ruby-identifier">tonodename</span> = [<span class="ruby-identifier">fromnodename</span>, <span class="ruby-identifier">tonodename</span>].<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'_'</span>)
|
271
|
+
294: <span class="ruby-identifier">myopts</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-value str">'arrow'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">ARROW_FOR</span>[<span class="ruby-identifier">:belongs_to</span>])
|
272
|
+
295: <span class="ruby-identifier">myopts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'constraint'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'false'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tonodename</span> <span class="ruby-operator">></span> <span class="ruby-identifier">fromnodename</span>
|
273
|
+
296: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">tonodename</span>, <span class="ruby-value str">%{[shape=diamond, label="", height=0.2, width=0.3]}</span>)
|
274
|
+
297: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_edge</span>(<span class="ruby-identifier">tonodename</span>, <span class="ruby-identifier">fromnodename</span>, <span class="ruby-identifier">myopts</span>)
|
275
|
+
298: <span class="ruby-identifier">standalone</span> = <span class="ruby-keyword kw">false</span>
|
276
|
+
299: <span class="ruby-keyword kw">end</span>
|
277
|
+
300: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class_name</span>
|
278
|
+
301: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_edge</span>(<span class="ruby-identifier">fromnodename</span>, <span class="ruby-identifier">tonodename</span>, <span class="ruby-identifier">opts</span>)
|
279
|
+
302: <span class="ruby-identifier">standalone</span> = <span class="ruby-keyword kw">false</span>
|
280
|
+
303: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">debug</span>
|
281
|
+
304: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" // !! skipping edge #{fromnodename} -> #{tonodename} #{opts.inspect}\n"</span>
|
282
|
+
305: <span class="ruby-keyword kw">end</span>
|
283
|
+
306: <span class="ruby-keyword kw">end</span>
|
284
|
+
307: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value str">%{[color=red]}</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">standalone</span>
|
285
|
+
308: <span class="ruby-keyword kw">end</span>
|
286
|
+
309:
|
287
|
+
310: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">nodes</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> }
|
288
|
+
311:
|
289
|
+
312: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">edges</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">to_h</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">e</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> }
|
290
|
+
313:
|
291
|
+
314: <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"}\n"</span>
|
292
|
+
315:
|
293
|
+
316: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'tmp'</span>, <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">name</span><span class="ruby-operator">+</span><span class="ruby-value str">'.dot'</span>), <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
294
|
+
317: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">output</span>
|
295
|
+
318: <span class="ruby-keyword kw">end</span>
|
296
|
+
319: <span class="ruby-keyword kw">end</span>
|
297
|
+
</pre>
|
298
|
+
</div>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
<div id="method-M000001" class="method-detail">
|
303
|
+
<a name="M000001"></a>
|
304
|
+
|
305
|
+
<div class="method-heading">
|
306
|
+
<a href="#M000001" class="method-signature">
|
307
|
+
<span class="method-name">posers</span><span class="method-args">()</span>
|
308
|
+
</a>
|
309
|
+
</div>
|
310
|
+
|
311
|
+
<div class="method-description">
|
312
|
+
<p>
|
313
|
+
classes that should not be graphed, but are subclasses of
|
314
|
+
ActiveRecord::Base
|
315
|
+
</p>
|
316
|
+
<p><a class="source-toggle" href="#"
|
317
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
318
|
+
<div class="method-source-code" id="M000001-source">
|
319
|
+
<pre>
|
320
|
+
<span class="ruby-comment cmt"># File model_graph.rb, line 181</span>
|
321
|
+
181: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">posers</span>
|
322
|
+
182: [<span class="ruby-constant">CGI</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span><span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecordStore</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>]
|
323
|
+
183: <span class="ruby-keyword kw">end</span>
|
324
|
+
</pre>
|
325
|
+
</div>
|
326
|
+
</div>
|
327
|
+
</div>
|
328
|
+
|
329
|
+
|
330
|
+
</div>
|
331
|
+
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
|
336
|
+
<div id="validator-badges">
|
337
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
338
|
+
</div>
|
339
|
+
|
340
|
+
</body>
|
341
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>posers (ModelGraph)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/model_graph.rb, line 186</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">posers</span>
|
15
|
+
[<span class="ruby-constant">CGI</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span><span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecordStore</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>]
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,120 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>do_graph (ModelGraph)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/model_graph.rb, line 194</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">do_graph</span>
|
15
|
+
<span class="ruby-identifier">output</span> = <span class="ruby-value str">""</span>
|
16
|
+
<span class="ruby-identifier">graph</span> = <span class="ruby-constant">Graph</span>.<span class="ruby-identifier">new</span>
|
17
|
+
|
18
|
+
|
19
|
+
<span class="ruby-comment cmt"># If called with:</span>
|
20
|
+
<span class="ruby-comment cmt">#</span>
|
21
|
+
<span class="ruby-comment cmt"># +rake model_graph EDGES=Author-Book+</span>
|
22
|
+
<span class="ruby-comment cmt">#</span>
|
23
|
+
<span class="ruby-comment cmt"># will cause an edge between, for example, Author and Book which can alter</span>
|
24
|
+
<span class="ruby-comment cmt"># the relative hierarchical rank of the two nodes (placing the first above</span>
|
25
|
+
<span class="ruby-comment cmt"># the second). This can often make a dramatic improvement in the overall</span>
|
26
|
+
<span class="ruby-comment cmt"># layout of the graph. Unless overridden with a normally discovered edge,</span>
|
27
|
+
<span class="ruby-comment cmt"># the plain arrow will be used to connect the two nodes (so a misspelt</span>
|
28
|
+
<span class="ruby-comment cmt"># node is more easily detected). Additional edges can be separated by '/'</span>
|
29
|
+
<span class="ruby-comment cmt"># as in +EDGES=Author-Book/Book-Chapter+</span>
|
30
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forced_edges</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'EDGES'</span>]
|
31
|
+
<span class="ruby-identifier">forced_edges</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(\w+)-(\w+)/?}</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span>,<span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
32
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_edge</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">t</span>, <span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'solid'</span>)
|
33
|
+
<span class="ruby-keyword kw">end</span>
|
34
|
+
<span class="ruby-keyword kw">end</span>
|
35
|
+
|
36
|
+
<span class="ruby-comment cmt"># If called with:</span>
|
37
|
+
<span class="ruby-comment cmt">#</span>
|
38
|
+
<span class="ruby-comment cmt"># +rake model_graph NODES=Author+</span>
|
39
|
+
<span class="ruby-comment cmt">#</span>
|
40
|
+
<span class="ruby-comment cmt"># will cause a node to be placed into the output early. This tends to</span>
|
41
|
+
<span class="ruby-comment cmt"># make a node appear further to the left in the resulting graph and can be</span>
|
42
|
+
<span class="ruby-comment cmt"># used to improve the overall layout. Typically, nodes are not specified,</span>
|
43
|
+
<span class="ruby-comment cmt"># but are left to be positioned based on their edges with other nodes.</span>
|
44
|
+
<span class="ruby-comment cmt"># Additional nodes can be separated by '/' as in +NODES=Author/Book+</span>
|
45
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forced_nodes</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'NODES'</span>]
|
46
|
+
<span class="ruby-identifier">forced_nodes</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(\w+)/?}</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
|
47
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">n</span>)
|
48
|
+
<span class="ruby-keyword kw">end</span>
|
49
|
+
<span class="ruby-keyword kw">end</span>
|
50
|
+
|
51
|
+
<span class="ruby-identifier">version</span> = <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Migrator</span>.<span class="ruby-identifier">current_version</span>
|
52
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
53
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"// Schema version: #{version}\n"</span>
|
54
|
+
<span class="ruby-keyword kw">end</span>
|
55
|
+
|
56
|
+
<span class="ruby-comment cmt"># except that I'm spitting out the debugging, this could certainly go right</span>
|
57
|
+
<span class="ruby-comment cmt"># before the Graph.edges part:</span>
|
58
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"digraph #{graph.name} {\n"</span>
|
59
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" graph [overlap=scale, nodesep=0.5, ranksep=0.5, separation=0.25]\n"</span>
|
60
|
+
|
61
|
+
<span class="ruby-identifier">sep</span> = <span class="ruby-value str">"//"</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">'-'</span> <span class="ruby-operator">*</span> <span class="ruby-value">20</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span>
|
62
|
+
|
63
|
+
<span class="ruby-identifier">nodes</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> }
|
64
|
+
|
65
|
+
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">klass</span> <span class="ruby-keyword kw">in</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:subclasses</span>)
|
66
|
+
<span class="ruby-comment cmt"># unless klass.name =~ /::/</span>
|
67
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">posers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
|
68
|
+
|
69
|
+
<span class="ruby-comment cmt"># node</span>
|
70
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">DEBUGGING</span>
|
71
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">"// #{klass.name}"</span>
|
72
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">" (#{klass.class_name})"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class_name</span>
|
73
|
+
<span class="ruby-identifier">print</span> <span class="ruby-value str">"\n"</span>
|
74
|
+
<span class="ruby-keyword kw">end</span>
|
75
|
+
|
76
|
+
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">a</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">reflect_on_all_associations</span>
|
77
|
+
<span class="ruby-comment cmt"># edge</span>
|
78
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">DEBUGGING</span>
|
79
|
+
<span class="ruby-identifier">print</span> <span class="ruby-value str">" //"</span>
|
80
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">" through #{a.through_reflection.class_name}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">through_reflection</span>
|
81
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">" #{a.macro} #{a.class_name}"</span>
|
82
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">" as #{a.options[:as].to_s.camelize.singularize}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:as</span>]
|
83
|
+
<span class="ruby-identifier">print</span> <span class="ruby-value str">"\n"</span>
|
84
|
+
<span class="ruby-keyword kw">end</span>
|
85
|
+
|
86
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">class_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelize</span>.<span class="ruby-identifier">singularize</span>
|
87
|
+
|
88
|
+
<span class="ruby-identifier">opts</span> = { <span class="ruby-value str">'label'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">macro</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value str">'arrow'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">ARROW_FOR</span>[<span class="ruby-identifier">a</span>.<span class="ruby-identifier">macro</span>] }
|
89
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'dotted'</span>, <span class="ruby-value str">'constraint'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'false'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">through_reflection</span>
|
90
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'dashed'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:as</span>]
|
91
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'style'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'bold'</span>, <span class="ruby-value str">'color'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'blue'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:polymorphic</span>]
|
92
|
+
|
93
|
+
<span class="ruby-identifier">fromnodename</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span>
|
94
|
+
<span class="ruby-identifier">tonodename</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelize</span>.<span class="ruby-identifier">singularize</span>
|
95
|
+
|
96
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">macro</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:has_and_belongs_to_many</span>
|
97
|
+
<span class="ruby-identifier">tonodename</span> = [<span class="ruby-identifier">fromnodename</span>, <span class="ruby-identifier">tonodename</span>].<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'_'</span>)
|
98
|
+
<span class="ruby-identifier">myopts</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-value str">'arrow'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">ARROW_FOR</span>[<span class="ruby-identifier">:belongs_to</span>])
|
99
|
+
<span class="ruby-identifier">myopts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-value str">'constraint'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'false'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tonodename</span> <span class="ruby-operator">></span> <span class="ruby-identifier">fromnodename</span>
|
100
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">tonodename</span>, <span class="ruby-value str">%{[shape=diamond, label="", height=0.2, width=0.3]}</span>)
|
101
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_edge</span>(<span class="ruby-identifier">tonodename</span>, <span class="ruby-identifier">fromnodename</span>, <span class="ruby-identifier">myopts</span>)
|
102
|
+
<span class="ruby-keyword kw">end</span>
|
103
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">add_edge</span>(<span class="ruby-identifier">fromnodename</span>, <span class="ruby-identifier">tonodename</span>, <span class="ruby-identifier">opts</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class_name</span>
|
104
|
+
|
105
|
+
<span class="ruby-keyword kw">end</span>
|
106
|
+
<span class="ruby-keyword kw">end</span>
|
107
|
+
|
108
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">nodes</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> }
|
109
|
+
|
110
|
+
<span class="ruby-identifier">constraints_first</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/--through-first/</span> }
|
111
|
+
<span class="ruby-identifier">graph</span>.<span class="ruby-identifier">edges</span>(<span class="ruby-identifier">constraints_first</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">e</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> }
|
112
|
+
|
113
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"}\n"</span>
|
114
|
+
|
115
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'tmp'</span>, <span class="ruby-value str">'model.dot'</span>), <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
116
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">output</span>
|
117
|
+
<span class="ruby-keyword kw">end</span>
|
118
|
+
<span class="ruby-keyword kw">end</span></pre>
|
119
|
+
</body>
|
120
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Mon Sep 18 00:45:07 EDT 2006
|
data/doc/dot/f_0.dot
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
digraph TopLevel {
|
2
|
+
compound = true
|
3
|
+
bgcolor = lightcyan1
|
4
|
+
fontname = Arial
|
5
|
+
fontsize = 8
|
6
|
+
label = "lib/model_graph.rb"
|
7
|
+
node [
|
8
|
+
fontname = Arial,
|
9
|
+
fontsize = 8,
|
10
|
+
color = black
|
11
|
+
]
|
12
|
+
|
13
|
+
subgraph cluster_ModelGraph {
|
14
|
+
fillcolor = palegreen1
|
15
|
+
URL = "classes/ModelGraph.html"
|
16
|
+
fontname = Arial
|
17
|
+
color = blue
|
18
|
+
label = "ModelGraph"
|
19
|
+
style = filled
|
20
|
+
ModelGraph [
|
21
|
+
shape = plaintext,
|
22
|
+
height = 0.01,
|
23
|
+
width = 0.01,
|
24
|
+
label = ""
|
25
|
+
]
|
26
|
+
|
27
|
+
ModelGraph__Graph [
|
28
|
+
fontcolor = black,
|
29
|
+
URL = "classes/ModelGraph/Graph.html",
|
30
|
+
shape = ellipse,
|
31
|
+
color = palegoldenrod,
|
32
|
+
style = filled,
|
33
|
+
label = "Graph"
|
34
|
+
]
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
}
|
39
|
+
|
data/doc/dot/f_0.png
ADDED
Binary file
|
data/doc/dot/m_0_0.dot
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
digraph TopLevel {
|
2
|
+
compound = true
|
3
|
+
bgcolor = lightcyan1
|
4
|
+
fontname = Arial
|
5
|
+
fontsize = 8
|
6
|
+
label = "TopLevel"
|
7
|
+
node [
|
8
|
+
fontname = Arial,
|
9
|
+
fontsize = 8,
|
10
|
+
color = black
|
11
|
+
]
|
12
|
+
|
13
|
+
subgraph cluster_ModelGraph {
|
14
|
+
fillcolor = palegreen1
|
15
|
+
URL = "classes/ModelGraph.html"
|
16
|
+
fontname = Arial
|
17
|
+
color = blue
|
18
|
+
label = "ModelGraph"
|
19
|
+
style = filled
|
20
|
+
ModelGraph [
|
21
|
+
shape = plaintext,
|
22
|
+
height = 0.01,
|
23
|
+
width = 0.01,
|
24
|
+
label = ""
|
25
|
+
]
|
26
|
+
|
27
|
+
ModelGraph__Graph [
|
28
|
+
fontcolor = black,
|
29
|
+
URL = "classes/ModelGraph/Graph.html",
|
30
|
+
shape = ellipse,
|
31
|
+
color = palegoldenrod,
|
32
|
+
style = filled,
|
33
|
+
label = "Graph"
|
34
|
+
]
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
}
|
39
|
+
|
data/doc/dot/m_0_0.png
ADDED
Binary file
|