ucd 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/examples/composite.dot +1 -1
- data/examples/generic.dot +41 -0
- data/examples/generic.png +0 -0
- data/examples/generic.ucd +7 -0
- data/lib/ucd/formatter/graphviz.rb +15 -3
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20a0c5aea325b83fbc5a0f08bb4a45aefe97a399
|
4
|
+
data.tar.gz: a8b2aa083f8f4fdbc5cf0106a0e2b61be3da753c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7436fac89357c2ad5acf494f81608f56396bbbb24d0a8cc0251c4606456ca3afa55478397dc4826d6f3786d30684c99d86d14b9d6bdba8cc3679ee461cc3d72
|
7
|
+
data.tar.gz: 2b71e4c7632308f556b71f9cf835850ddd33e423f24e84dd69e5fe6c73cf416ce198b9bec8f07b65a820197cdad4a0a9802f4e3b75e62680e3c5dbfc6f5b9c90
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/examples/composite.dot
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
digraph G {
|
2
|
+
graph [splines="ortho" rankdir="BT"]
|
3
|
+
edge [color="gray50"]
|
4
|
+
node [shape="plain"]
|
5
|
+
|
6
|
+
ClassAssetT [label=<
|
7
|
+
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
|
8
|
+
<TR>
|
9
|
+
<TD>«abstract»<BR/><I><B>Asset(T)</B></I></TD>
|
10
|
+
</TR>
|
11
|
+
<TR>
|
12
|
+
<TD>
|
13
|
+
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
|
14
|
+
<TR><TD ALIGN="LEFT">+ value : T</TD></TR>
|
15
|
+
</TABLE>
|
16
|
+
</TD>
|
17
|
+
</TR>
|
18
|
+
<TR>
|
19
|
+
<TD></TD>
|
20
|
+
</TR>
|
21
|
+
</TABLE>
|
22
|
+
>]
|
23
|
+
|
24
|
+
ClassTexture [label=<
|
25
|
+
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
|
26
|
+
<TR>
|
27
|
+
<TD><B>Texture</B></TD>
|
28
|
+
</TR>
|
29
|
+
<TR>
|
30
|
+
<TD></TD>
|
31
|
+
</TR>
|
32
|
+
<TR>
|
33
|
+
<TD></TD>
|
34
|
+
</TR>
|
35
|
+
</TABLE>
|
36
|
+
>]
|
37
|
+
|
38
|
+
ClassTexture -> ClassAssetT [arrowhead="onormal"]
|
39
|
+
|
40
|
+
|
41
|
+
}
|
Binary file
|
@@ -89,7 +89,10 @@ module UCD
|
|
89
89
|
attributes["headlabel"] = node.from if node.from
|
90
90
|
attributes["taillabel"] = node.to if node.to
|
91
91
|
|
92
|
-
|
92
|
+
graph_parent_name = generate_graph_name(node.parent.name)
|
93
|
+
graph_node_name = generate_graph_name(node.name)
|
94
|
+
|
95
|
+
%Q{Class#{graph_parent_name} -> Class#{graph_node_name} [#{attributes}]}
|
93
96
|
end
|
94
97
|
|
95
98
|
def format_class_relationship(node)
|
@@ -98,7 +101,10 @@ module UCD
|
|
98
101
|
attributes["arrowhead"] = "onormal"
|
99
102
|
attributes["style"] = "dashed" if node.type == "realizes"
|
100
103
|
|
101
|
-
|
104
|
+
graph_parent_name = generate_graph_name(node.parent.name)
|
105
|
+
graph_node_name = generate_graph_name(node.name)
|
106
|
+
|
107
|
+
%Q{Class#{graph_parent_name} -> Class#{graph_node_name} [#{attributes}]}
|
102
108
|
end
|
103
109
|
|
104
110
|
def format_class(node)
|
@@ -144,8 +150,10 @@ HEREDOC
|
|
144
150
|
|
145
151
|
def format_document(node)
|
146
152
|
classes = node.classes.map do |node|
|
153
|
+
graph_node_name = generate_graph_name(node.name)
|
154
|
+
|
147
155
|
<<-HEREDOC
|
148
|
-
Class#{
|
156
|
+
Class#{graph_node_name} [label=<
|
149
157
|
#{format_class(node)}
|
150
158
|
>]
|
151
159
|
HEREDOC
|
@@ -185,6 +193,10 @@ HEREDOC
|
|
185
193
|
end
|
186
194
|
end
|
187
195
|
|
196
|
+
def generate_graph_name(name)
|
197
|
+
name.gsub(/[^0-9a-zA-Z]/i, '')
|
198
|
+
end
|
199
|
+
|
188
200
|
end
|
189
201
|
end
|
190
202
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Scott Lewis
|
@@ -105,6 +105,9 @@ files:
|
|
105
105
|
- examples/composite.dot
|
106
106
|
- examples/composite.png
|
107
107
|
- examples/composite.ucd
|
108
|
+
- examples/generic.dot
|
109
|
+
- examples/generic.png
|
110
|
+
- examples/generic.ucd
|
108
111
|
- exe/ucd
|
109
112
|
- lib/ucd.rb
|
110
113
|
- lib/ucd/formatter.rb
|