gliffynator 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/gliffynator/activation.rb +37 -0
- data/lib/gliffynator/actor.rb +40 -0
- data/lib/gliffynator/arrow.rb +2 -2
- data/lib/gliffynator/dsl.rb +21 -2
- data/lib/gliffynator/object_timeline.rb +195 -0
- data/lib/gliffynator/use_case.rb +40 -0
- data/lib/gliffynator/version.rb +1 -1
- data/lib/gliffynator.rb +4 -0
- data/spec/diagram_spec.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2659564a556dc6c3e9d08084e5ebbd6f7f021345
|
4
|
+
data.tar.gz: 7eab8db527bf45f5505cd9b63ff7653608f1605e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d628231b3b01156abdd065387152481647b12f4c0a0b09e01d2a74c4081056864c60a33f0d91f4c599391baa78f9318fdbdc4cf1eddd97c3b026240b5b4a8a
|
7
|
+
data.tar.gz: 444fe5b92f59880705a6d79e8609ec52ac30b7ca6e24c132d2b43b7a4f0582ddc3136ceb87dbb510b73eab34584cf28f63ce80168d3e7ec35919aa79b606ff22
|
data/README.md
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
class Gliffynator::Activation < Hash
|
2
|
+
def self.id_usage
|
3
|
+
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.create(id, x, y, width=10, height=100)
|
7
|
+
{
|
8
|
+
x: x,
|
9
|
+
y: y,
|
10
|
+
rotation: 0,
|
11
|
+
id: id,
|
12
|
+
uid: "com.gliffy.shape.uml.uml_v1.default.activation",
|
13
|
+
width: width,
|
14
|
+
height: 100,
|
15
|
+
lockAspectRatio: false,
|
16
|
+
lockShape: false,
|
17
|
+
order: id,
|
18
|
+
graphic: {
|
19
|
+
type: "Shape",
|
20
|
+
Shape: {
|
21
|
+
tid: "com.gliffy.stencil.rectangle.basic_v1",
|
22
|
+
strokeWidth: 1,
|
23
|
+
strokeColor: "#000000",
|
24
|
+
fillColor: "#FFFFFF",
|
25
|
+
gradient: false,
|
26
|
+
dropShadow: false,
|
27
|
+
state: 0,
|
28
|
+
shadowX: 0,
|
29
|
+
shadowY: 0,
|
30
|
+
opacity: 1
|
31
|
+
}
|
32
|
+
},
|
33
|
+
children: nil,
|
34
|
+
linkMap: []
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
class Gliffynator::Actor < Hash
|
2
|
+
|
3
|
+
def self.id_usage
|
4
|
+
1
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.create(id, x, y, width=38, height=59)
|
8
|
+
{
|
9
|
+
x: x,
|
10
|
+
y: y,
|
11
|
+
rotation: 0.0,
|
12
|
+
id: id,
|
13
|
+
width: width,
|
14
|
+
height: height,
|
15
|
+
uid: "com.gliffy.shape.uml.uml_v1.default.actor",
|
16
|
+
order: id,
|
17
|
+
lockAspectRatio: true,
|
18
|
+
lockShape: false,
|
19
|
+
graphic: {
|
20
|
+
type: "Shape",
|
21
|
+
Shape: {
|
22
|
+
tid: "com.gliffy.stencil.actor.uml_v1",
|
23
|
+
strokeWidth: 1,
|
24
|
+
strokeColor: "#000000",
|
25
|
+
fillColor: "#FFFFFF",
|
26
|
+
gradient: false,
|
27
|
+
dropShadow: false,
|
28
|
+
state: 0,
|
29
|
+
opacity: 1,
|
30
|
+
shadowX: 0,
|
31
|
+
shadowY: 0
|
32
|
+
}
|
33
|
+
},
|
34
|
+
linkMap: [],
|
35
|
+
children: [],
|
36
|
+
hidden: false,
|
37
|
+
layerId: "C3WysuhtocNA"
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
data/lib/gliffynator/arrow.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Gliffynator::Arrow < Hash
|
2
2
|
|
3
3
|
def self.id_usage
|
4
|
-
|
4
|
+
3
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.create(id, x, y, length, direction, text=false)
|
@@ -14,7 +14,7 @@ class Gliffynator::Arrow < Hash
|
|
14
14
|
width: 143.5644622626777,
|
15
15
|
height: 100.0,
|
16
16
|
uid: "com.gliffy.shape.uml.uml_v1.default.message",
|
17
|
-
order: id
|
17
|
+
order: id,
|
18
18
|
lockAspectRatio: false,
|
19
19
|
lockShape: false,
|
20
20
|
graphic: {
|
data/lib/gliffynator/dsl.rb
CHANGED
@@ -2,17 +2,36 @@ module Gliffynator
|
|
2
2
|
module DSL
|
3
3
|
def get_id_and_increment(klass)
|
4
4
|
id = self.objects.global_id_counter
|
5
|
-
self.objects.global_id_counter
|
5
|
+
self.objects.global_id_counter += klass.id_usage || 1
|
6
6
|
|
7
7
|
id
|
8
8
|
end
|
9
9
|
|
10
10
|
def add_arrow(*args)
|
11
|
-
id = get_id_and_increment(Arrow)
|
11
|
+
id = get_id_and_increment(Gliffynator::Arrow)
|
12
12
|
self.objects << Gliffynator::Arrow.create(id, *args)
|
13
13
|
end
|
14
14
|
|
15
|
+
def actor(*args)
|
16
|
+
self.objects << Gliffynator::Actor.create(
|
17
|
+
get_id_and_increment(Gliffynator::Actor),
|
18
|
+
*args
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
def method_missing(m, *args, &block)
|
23
|
+
begin
|
24
|
+
class_name = "Gliffynator::" + m.to_s.split("_").collect(&:capitalize).join
|
25
|
+
klass = instance_eval(class_name)
|
15
26
|
|
27
|
+
self.objects << klass.create(
|
28
|
+
get_id_and_increment(klass),
|
29
|
+
*args
|
30
|
+
)
|
31
|
+
rescue NameError
|
32
|
+
raise NoMethodError, "Unknown shape #{class_name}"
|
33
|
+
end
|
34
|
+
end
|
16
35
|
|
17
36
|
end
|
18
37
|
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
class Gliffynator::ObjectTimeline < Hash
|
2
|
+
def self.id_usage
|
3
|
+
4
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.create(id, x, y, width=140, height=100, text="")
|
7
|
+
{
|
8
|
+
x: x,
|
9
|
+
y: y,
|
10
|
+
rotation: 0,
|
11
|
+
id: id,
|
12
|
+
width: width,
|
13
|
+
height: height,
|
14
|
+
uid: "com.gliffy.shape.uml.uml_v1.default.object_timeline",
|
15
|
+
order: id,
|
16
|
+
lockAspectRatio: false,
|
17
|
+
lockShape: false,
|
18
|
+
constraints: {
|
19
|
+
constraints: [
|
20
|
+
{
|
21
|
+
type: "HeightConstraint",
|
22
|
+
HeightConstraint: {
|
23
|
+
isMin: true,
|
24
|
+
heightInfo: [
|
25
|
+
{
|
26
|
+
magnitude: 1,
|
27
|
+
id: id+1
|
28
|
+
}
|
29
|
+
],
|
30
|
+
minHeight: 0,
|
31
|
+
growParent: false,
|
32
|
+
padding: 0
|
33
|
+
}
|
34
|
+
}
|
35
|
+
]
|
36
|
+
},
|
37
|
+
linkMap: [],
|
38
|
+
children: [
|
39
|
+
{
|
40
|
+
x: 0,
|
41
|
+
y: 0,
|
42
|
+
rotation: 0,
|
43
|
+
id: id+1,
|
44
|
+
width: 140,
|
45
|
+
height: 18,
|
46
|
+
uid: nil,
|
47
|
+
order: id+1,
|
48
|
+
lockAspectRatio: false,
|
49
|
+
lockShape: false,
|
50
|
+
constraints: {
|
51
|
+
constraints: [
|
52
|
+
{
|
53
|
+
type: "HeightConstraint",
|
54
|
+
HeightConstraint: {
|
55
|
+
isMin: false,
|
56
|
+
heightInfo: [
|
57
|
+
{
|
58
|
+
magnitude: 1,
|
59
|
+
id: id+2
|
60
|
+
}
|
61
|
+
],
|
62
|
+
minHeight: 0,
|
63
|
+
growParent: true,
|
64
|
+
padding: 0
|
65
|
+
}
|
66
|
+
}
|
67
|
+
]
|
68
|
+
},
|
69
|
+
graphic: {
|
70
|
+
type: "Shape",
|
71
|
+
Shape: {
|
72
|
+
tid: "com.gliffy.stencil.rectangle.basic_v1",
|
73
|
+
strokeWidth: 2,
|
74
|
+
strokeColor: "#999999",
|
75
|
+
fillColor: "#FFF2CC",
|
76
|
+
gradient: false,
|
77
|
+
dashStyle: nil,
|
78
|
+
dropShadow: false,
|
79
|
+
state: 0,
|
80
|
+
opacity: 1.0,
|
81
|
+
shadowX: 4.0,
|
82
|
+
shadowY: 4.0
|
83
|
+
}
|
84
|
+
},
|
85
|
+
children: [
|
86
|
+
{
|
87
|
+
x: 0,
|
88
|
+
y: 0,
|
89
|
+
rotation: 0,
|
90
|
+
id: id+2,
|
91
|
+
width: 140,
|
92
|
+
height: 18,
|
93
|
+
uid: nil,
|
94
|
+
order: id+2,
|
95
|
+
lockAspectRatio: false,
|
96
|
+
lockShape: false,
|
97
|
+
graphic: {
|
98
|
+
type: "Text",
|
99
|
+
Text: {
|
100
|
+
overflow: "none",
|
101
|
+
paddingTop: 2,
|
102
|
+
paddingRight: 2,
|
103
|
+
paddingBottom: 2,
|
104
|
+
paddingLeft: 2,
|
105
|
+
outerPaddingTop: 6,
|
106
|
+
outerPaddingRight: 6,
|
107
|
+
outerPaddingBottom: 2,
|
108
|
+
outerPaddingLeft: 6,
|
109
|
+
type: "fixed",
|
110
|
+
lineTValue: nil,
|
111
|
+
linePerpValue: nil,
|
112
|
+
cardinalityType: nil,
|
113
|
+
html: "<p style=\"text-align:center;\"><span style=\"font-weight:bold;text-decoration:underline;font-family:Arial;font-size:12px;\">"+text+"</span></p>",
|
114
|
+
tid: nil,
|
115
|
+
valign: "top",
|
116
|
+
vposition: "none",
|
117
|
+
hposition: "none"
|
118
|
+
}
|
119
|
+
},
|
120
|
+
hidden: false,
|
121
|
+
layerId: nil
|
122
|
+
}
|
123
|
+
],
|
124
|
+
hidden: false,
|
125
|
+
layerId: nil
|
126
|
+
},
|
127
|
+
{
|
128
|
+
x: 0,
|
129
|
+
y: 18,
|
130
|
+
rotation: 0,
|
131
|
+
id: id+3,
|
132
|
+
width: 140,
|
133
|
+
height: 1282.0,
|
134
|
+
uid: nil,
|
135
|
+
order: id+3,
|
136
|
+
lockAspectRatio: false,
|
137
|
+
lockShape: false,
|
138
|
+
constraints: {
|
139
|
+
constraints: [
|
140
|
+
{
|
141
|
+
type: "HeightConstraint",
|
142
|
+
HeightConstraint: {
|
143
|
+
isMin: false,
|
144
|
+
heightInfo: [
|
145
|
+
{
|
146
|
+
magnitude: 1,
|
147
|
+
id: id
|
148
|
+
},
|
149
|
+
{
|
150
|
+
magnitude: -1,
|
151
|
+
id: id+1
|
152
|
+
}
|
153
|
+
],
|
154
|
+
minHeight: 0,
|
155
|
+
growParent: false,
|
156
|
+
padding: 0
|
157
|
+
}
|
158
|
+
},
|
159
|
+
{
|
160
|
+
type: "PositionConstraint",
|
161
|
+
PositionConstraint: {
|
162
|
+
nodeId: id+1,
|
163
|
+
px: 0,
|
164
|
+
py: 1.0,
|
165
|
+
xOffset: 0,
|
166
|
+
yOffset: 0
|
167
|
+
}
|
168
|
+
}
|
169
|
+
]
|
170
|
+
},
|
171
|
+
graphic: {
|
172
|
+
type: "Shape",
|
173
|
+
Shape: {
|
174
|
+
tid: "com.gliffy.stencil.object_timeline.uml_v1",
|
175
|
+
strokeWidth: 2.0,
|
176
|
+
strokeColor: "#999999",
|
177
|
+
fillColor: "#fff2cc",
|
178
|
+
gradient: false,
|
179
|
+
dashStyle: nil,
|
180
|
+
dropShadow: false,
|
181
|
+
state: 0,
|
182
|
+
opacity: 1.0,
|
183
|
+
shadowX: 4.0,
|
184
|
+
shadowY: 4.0
|
185
|
+
}
|
186
|
+
},
|
187
|
+
hidden: false,
|
188
|
+
layerId: nil
|
189
|
+
}
|
190
|
+
],
|
191
|
+
hidden: false,
|
192
|
+
layerId: "C3WysuhtocNA"
|
193
|
+
}
|
194
|
+
end
|
195
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
class Gliffynator::UseCase < Hash
|
2
|
+
def self.id_usage
|
3
|
+
1
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.create(id, x, y, width=140, height=70)
|
7
|
+
{
|
8
|
+
x: x,
|
9
|
+
y: y,
|
10
|
+
rotation: 0,
|
11
|
+
id: id,
|
12
|
+
width: width,
|
13
|
+
height: height,
|
14
|
+
uid: "com.gliffy.shape.uml.uml_v1.default.use_case",
|
15
|
+
order: id,
|
16
|
+
lockAspectRatio: true,
|
17
|
+
lockShape: false,
|
18
|
+
graphic: {
|
19
|
+
type: "Shape",
|
20
|
+
Shape: {
|
21
|
+
tid: "com.gliffy.stencil.ellipse.basic_v1",
|
22
|
+
strokeWidth: 1.0,
|
23
|
+
strokeColor: "#000000",
|
24
|
+
fillColor: "#FFFFFF",
|
25
|
+
gradient: false,
|
26
|
+
dashStyle: nil,
|
27
|
+
dropShadow: false,
|
28
|
+
state: 0,
|
29
|
+
opacity: 1,
|
30
|
+
shadowX: 0,
|
31
|
+
shadowY: 0
|
32
|
+
}
|
33
|
+
},
|
34
|
+
linkMap: [],
|
35
|
+
children: [],
|
36
|
+
hidden: false,
|
37
|
+
layerId: "C3WysuhtocNA"
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
data/lib/gliffynator/version.rb
CHANGED
data/lib/gliffynator.rb
CHANGED
data/spec/diagram_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gliffynator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Zwolak
|
@@ -57,10 +57,14 @@ files:
|
|
57
57
|
- Rakefile
|
58
58
|
- gliffynator.gemspec
|
59
59
|
- lib/gliffynator.rb
|
60
|
+
- lib/gliffynator/activation.rb
|
61
|
+
- lib/gliffynator/actor.rb
|
60
62
|
- lib/gliffynator/arrow.rb
|
61
63
|
- lib/gliffynator/diagram.rb
|
62
64
|
- lib/gliffynator/dsl.rb
|
65
|
+
- lib/gliffynator/object_timeline.rb
|
63
66
|
- lib/gliffynator/objects.rb
|
67
|
+
- lib/gliffynator/use_case.rb
|
64
68
|
- lib/gliffynator/version.rb
|
65
69
|
- spec/diagram_spec.rb
|
66
70
|
- spec/spec_helper.rb
|