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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bded63756cb059b1bf533324437fce70480ef263
4
- data.tar.gz: 3d501486676a8d08b794ee646990935dc7b323fd
3
+ metadata.gz: 20a0c5aea325b83fbc5a0f08bb4a45aefe97a399
4
+ data.tar.gz: a8b2aa083f8f4fdbc5cf0106a0e2b61be3da753c
5
5
  SHA512:
6
- metadata.gz: 2ff41f9774f80876e95ffc19b66d2cda5f3048da368c678ba0f8aa6a19404a4b2c12f5938220369faee913a6672a1cdcf38fef1c369c03a700d104463d325c3c
7
- data.tar.gz: 2f04d70df43b8f5be60acb6098f44b2b78576d0a8e20a6daac7974fd6daa41afb430d5cadac3e3ee4ec5989749ceaa3ba5eb61c92656b82a59736eb9217ca63f
6
+ metadata.gz: a7436fac89357c2ad5acf494f81608f56396bbbb24d0a8cc0251c4606456ca3afa55478397dc4826d6f3786d30684c99d86d14b9d6bdba8cc3679ee461cc3d72
7
+ data.tar.gz: 2b71e4c7632308f556b71f9cf835850ddd33e423f24e84dd69e5fe6c73cf416ce198b9bec8f07b65a820197cdad4a0a9802f4e3b75e62680e3c5dbfc6f5b9c90
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -63,4 +63,4 @@ digraph G {
63
63
  ClassComposite -> ClassComponent [arrowhead="onormal"]
64
64
 
65
65
  ClassComposite -> ClassComponent [dir="back" arrowtail="odiamond" headlabel="*"]
66
- }
66
+ }
@@ -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
@@ -0,0 +1,7 @@
1
+ abstract class Asset(T) {
2
+ field value : T
3
+ }
4
+
5
+ class Texture {
6
+ generalizes Asset(T)
7
+ }
@@ -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
- %Q{Class#{node.parent.name} -> Class#{node.name} [#{attributes}]}
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
- %Q{Class#{node.parent.name} -> Class#{node.name} [#{attributes}]}
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#{node.name} [label=<
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.2
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