xmi 0.3.17 → 0.3.18
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.
- checksums.yaml +4 -4
- data/lib/xmi/add.rb +27 -3
- data/lib/xmi/delete.rb +27 -3
- data/lib/xmi/difference.rb +27 -3
- data/lib/xmi/documentation.rb +95 -9
- data/lib/xmi/ea_root.rb +5 -1
- data/lib/xmi/replace.rb +27 -3
- data/lib/xmi/root.rb +157 -13
- data/lib/xmi/sparx.rb +349 -33
- data/lib/xmi/uml.rb +270 -26
- data/lib/xmi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0f65d9eb942a438cfe5f3063f59ef9163e0bb937176dfe3411918d1c156a71c
|
4
|
+
data.tar.gz: acea74d62c7261f746aeed922bd916c56426a73d9a2a7c3b15238f2fbdc4f3d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad77d81757ba0b783d46f59dab45f426d8a7e7193e3a6639926fd7d352d2810ad9a5e06f856d57383bec9a9c4616f6ecba6289e4da47bf3db3694e57ac61ef41
|
7
|
+
data.tar.gz: 86b6c0c74da9d942c8e7eae62c023be8cda424d8a6041c6471c5b44e88b15617f9e94d5896a1d55e63b9087b6858be4d552686dfee935fd42e77c7bfb9bb6788
|
data/lib/xmi/add.rb
CHANGED
@@ -18,7 +18,7 @@ module Xmi
|
|
18
18
|
attribute :difference, Difference, collection: true
|
19
19
|
attribute :extension, Extension, collection: true
|
20
20
|
|
21
|
-
xml do
|
21
|
+
xml do # rubocop:disable Metrics/BlockLength
|
22
22
|
root "Add"
|
23
23
|
namespace "http://www.omg.org/spec/XMI/20131001", "xmlns"
|
24
24
|
|
@@ -32,8 +32,32 @@ module Xmi
|
|
32
32
|
map_attribute "container", to: :container
|
33
33
|
map_attribute "position", to: :position
|
34
34
|
map_attribute "addition", to: :addition
|
35
|
-
map_element "difference", to: :difference, prefix: nil, namespace: nil
|
36
|
-
|
35
|
+
map_element "difference", to: :difference, prefix: nil, namespace: nil,
|
36
|
+
value_map: {
|
37
|
+
from: {
|
38
|
+
nil: :empty,
|
39
|
+
empty: :empty,
|
40
|
+
omitted: :empty
|
41
|
+
},
|
42
|
+
to: {
|
43
|
+
nil: :empty,
|
44
|
+
empty: :empty,
|
45
|
+
omitted: :empty
|
46
|
+
}
|
47
|
+
}
|
48
|
+
map_element "Extension", to: :extension,
|
49
|
+
value_map: {
|
50
|
+
from: {
|
51
|
+
nil: :empty,
|
52
|
+
empty: :empty,
|
53
|
+
omitted: :empty
|
54
|
+
},
|
55
|
+
to: {
|
56
|
+
nil: :empty,
|
57
|
+
empty: :empty,
|
58
|
+
omitted: :empty
|
59
|
+
}
|
60
|
+
}
|
37
61
|
end
|
38
62
|
end
|
39
63
|
end
|
data/lib/xmi/delete.rb
CHANGED
@@ -16,7 +16,7 @@ module Xmi
|
|
16
16
|
attribute :difference, Difference, collection: true
|
17
17
|
attribute :extension, Extension, collection: true
|
18
18
|
|
19
|
-
xml do
|
19
|
+
xml do # rubocop:disable Metrics/BlockLength
|
20
20
|
root "Delete"
|
21
21
|
namespace "http://www.omg.org/spec/XMI/20131001", "xmlns"
|
22
22
|
|
@@ -28,8 +28,32 @@ module Xmi
|
|
28
28
|
map_attribute "type", to: :type, prefix: "xmlns", namespace: "http://www.omg.org/spec/XMI/20131001"
|
29
29
|
map_attribute "target", to: :target
|
30
30
|
map_attribute "container", to: :container
|
31
|
-
map_element "difference", to: :difference, prefix: nil, namespace: nil
|
32
|
-
|
31
|
+
map_element "difference", to: :difference, prefix: nil, namespace: nil,
|
32
|
+
value_map: {
|
33
|
+
from: {
|
34
|
+
nil: :empty,
|
35
|
+
empty: :empty,
|
36
|
+
omitted: :empty
|
37
|
+
},
|
38
|
+
to: {
|
39
|
+
nil: :empty,
|
40
|
+
empty: :empty,
|
41
|
+
omitted: :empty
|
42
|
+
}
|
43
|
+
}
|
44
|
+
map_element "Extension", to: :extension,
|
45
|
+
value_map: {
|
46
|
+
from: {
|
47
|
+
nil: :empty,
|
48
|
+
empty: :empty,
|
49
|
+
omitted: :empty
|
50
|
+
},
|
51
|
+
to: {
|
52
|
+
nil: :empty,
|
53
|
+
empty: :empty,
|
54
|
+
omitted: :empty
|
55
|
+
}
|
56
|
+
}
|
33
57
|
end
|
34
58
|
end
|
35
59
|
end
|
data/lib/xmi/difference.rb
CHANGED
@@ -15,7 +15,7 @@ module Xmi
|
|
15
15
|
attribute :difference, Difference, collection: true
|
16
16
|
attribute :extension, Extension, collection: true
|
17
17
|
|
18
|
-
xml do
|
18
|
+
xml do # rubocop:disable Metrics/BlockLength
|
19
19
|
root "Difference"
|
20
20
|
namespace "http://www.omg.org/spec/XMI/20131001", "xmlns"
|
21
21
|
|
@@ -27,8 +27,32 @@ module Xmi
|
|
27
27
|
map_attribute "type", to: :type, prefix: "xmlns", namespace: "http://www.omg.org/spec/XMI/20131001"
|
28
28
|
map_attribute "target", to: :target
|
29
29
|
map_attribute "container", to: :container
|
30
|
-
map_element "difference", to: :difference, prefix: nil, namespace: nil
|
31
|
-
|
30
|
+
map_element "difference", to: :difference, prefix: nil, namespace: nil,
|
31
|
+
value_map: {
|
32
|
+
from: {
|
33
|
+
nil: :empty,
|
34
|
+
empty: :empty,
|
35
|
+
omitted: :empty
|
36
|
+
},
|
37
|
+
to: {
|
38
|
+
nil: :empty,
|
39
|
+
empty: :empty,
|
40
|
+
omitted: :empty
|
41
|
+
}
|
42
|
+
}
|
43
|
+
map_element "Extension", to: :extension,
|
44
|
+
value_map: {
|
45
|
+
from: {
|
46
|
+
nil: :empty,
|
47
|
+
empty: :empty,
|
48
|
+
omitted: :empty
|
49
|
+
},
|
50
|
+
to: {
|
51
|
+
nil: :empty,
|
52
|
+
empty: :empty,
|
53
|
+
omitted: :empty
|
54
|
+
}
|
55
|
+
}
|
32
56
|
end
|
33
57
|
end
|
34
58
|
end
|
data/lib/xmi/documentation.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require_relative "extension"
|
4
4
|
|
5
5
|
module Xmi
|
6
|
-
class Documentation < Lutaml::Model::Serializable
|
6
|
+
class Documentation < Lutaml::Model::Serializable # rubocop:disable Metrics/ClassLength
|
7
7
|
attribute :id, :string
|
8
8
|
attribute :label, :string
|
9
9
|
attribute :uuid, :string
|
@@ -21,7 +21,7 @@ module Xmi
|
|
21
21
|
attribute :timestamp, :time, collection: true
|
22
22
|
attribute :extension, Extension, collection: true
|
23
23
|
|
24
|
-
xml do
|
24
|
+
xml do # rubocop:disable Metrics/BlockLength
|
25
25
|
root "Documentation"
|
26
26
|
namespace "http://www.omg.org/spec/XMI/20131001", "xmi"
|
27
27
|
|
@@ -35,13 +35,99 @@ module Xmi
|
|
35
35
|
map_attribute "exporterVersion", to: :exporter_version
|
36
36
|
map_attribute "exporterID", to: :exporter_id
|
37
37
|
|
38
|
-
map_element "contact", to: :contact, prefix: nil, namespace: nil
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
map_element "contact", to: :contact, prefix: nil, namespace: nil,
|
39
|
+
value_map: {
|
40
|
+
from: {
|
41
|
+
nil: :empty,
|
42
|
+
empty: :empty,
|
43
|
+
omitted: :empty
|
44
|
+
},
|
45
|
+
to: {
|
46
|
+
nil: :empty,
|
47
|
+
empty: :empty,
|
48
|
+
omitted: :empty
|
49
|
+
}
|
50
|
+
}
|
51
|
+
map_element "longDescription", to: :long_description, prefix: nil,
|
52
|
+
namespace: nil,
|
53
|
+
value_map: {
|
54
|
+
from: {
|
55
|
+
nil: :empty,
|
56
|
+
empty: :empty,
|
57
|
+
omitted: :empty
|
58
|
+
},
|
59
|
+
to: {
|
60
|
+
nil: :empty,
|
61
|
+
empty: :empty,
|
62
|
+
omitted: :empty
|
63
|
+
}
|
64
|
+
}
|
65
|
+
map_element "shortDescription", to: :short_description, prefix: nil,
|
66
|
+
namespace: nil,
|
67
|
+
value_map: {
|
68
|
+
from: {
|
69
|
+
nil: :empty,
|
70
|
+
empty: :empty,
|
71
|
+
omitted: :empty
|
72
|
+
},
|
73
|
+
to: {
|
74
|
+
nil: :empty,
|
75
|
+
empty: :empty,
|
76
|
+
omitted: :empty
|
77
|
+
}
|
78
|
+
}
|
79
|
+
map_element "notice", to: :notice, prefix: nil, namespace: nil,
|
80
|
+
value_map: {
|
81
|
+
from: {
|
82
|
+
nil: :empty,
|
83
|
+
empty: :empty,
|
84
|
+
omitted: :empty
|
85
|
+
},
|
86
|
+
to: {
|
87
|
+
nil: :empty,
|
88
|
+
empty: :empty,
|
89
|
+
omitted: :empty
|
90
|
+
}
|
91
|
+
}
|
92
|
+
map_element "owner", to: :owner, prefix: nil, namespace: nil,
|
93
|
+
value_map: {
|
94
|
+
from: {
|
95
|
+
nil: :empty,
|
96
|
+
empty: :empty,
|
97
|
+
omitted: :empty
|
98
|
+
},
|
99
|
+
to: {
|
100
|
+
nil: :empty,
|
101
|
+
empty: :empty,
|
102
|
+
omitted: :empty
|
103
|
+
}
|
104
|
+
}
|
105
|
+
map_element "timestamp", to: :timestamp, prefix: nil, namespace: nil,
|
106
|
+
value_map: {
|
107
|
+
from: {
|
108
|
+
nil: :empty,
|
109
|
+
empty: :empty,
|
110
|
+
omitted: :empty
|
111
|
+
},
|
112
|
+
to: {
|
113
|
+
nil: :empty,
|
114
|
+
empty: :empty,
|
115
|
+
omitted: :empty
|
116
|
+
}
|
117
|
+
}
|
118
|
+
map_element "Extension", to: :extension,
|
119
|
+
value_map: {
|
120
|
+
from: {
|
121
|
+
nil: :empty,
|
122
|
+
empty: :empty,
|
123
|
+
omitted: :empty
|
124
|
+
},
|
125
|
+
to: {
|
126
|
+
nil: :empty,
|
127
|
+
empty: :empty,
|
128
|
+
omitted: :empty
|
129
|
+
}
|
130
|
+
}
|
45
131
|
end
|
46
132
|
end
|
47
133
|
end
|
data/lib/xmi/ea_root.rb
CHANGED
@@ -43,7 +43,11 @@ module Xmi
|
|
43
43
|
map_element "#ELEMENT_NAME#",
|
44
44
|
to: :#ELEMENT_METHOD#,
|
45
45
|
namespace: "#NAMESPACE#",
|
46
|
-
prefix: "#PREFIX#"
|
46
|
+
prefix: "#PREFIX#",
|
47
|
+
value_map: {
|
48
|
+
from: { nil: :empty, empty: :empty, omitted: :empty },
|
49
|
+
to: { nil: :empty, empty: :empty, omitted: :empty }
|
50
|
+
}
|
47
51
|
TEXT
|
48
52
|
|
49
53
|
class << self
|
data/lib/xmi/replace.rb
CHANGED
@@ -18,7 +18,7 @@ module Xmi
|
|
18
18
|
attribute :difference, Difference, collection: true
|
19
19
|
attribute :extension, Extension, collection: true
|
20
20
|
|
21
|
-
xml do
|
21
|
+
xml do # rubocop:disable Metrics/BlockLength
|
22
22
|
root "Replace"
|
23
23
|
namespace "http://www.omg.org/spec/XMI/20131001", "xmlns"
|
24
24
|
|
@@ -32,8 +32,32 @@ module Xmi
|
|
32
32
|
map_attribute "container", to: :container
|
33
33
|
map_attribute "position", to: :position
|
34
34
|
map_attribute "replacement", to: :replacement
|
35
|
-
map_element "difference", to: :difference, prefix: nil, namespace: nil
|
36
|
-
|
35
|
+
map_element "difference", to: :difference, prefix: nil, namespace: nil,
|
36
|
+
value_map: {
|
37
|
+
from: {
|
38
|
+
nil: :empty,
|
39
|
+
empty: :empty,
|
40
|
+
omitted: :empty
|
41
|
+
},
|
42
|
+
to: {
|
43
|
+
nil: :empty,
|
44
|
+
empty: :empty,
|
45
|
+
omitted: :empty
|
46
|
+
}
|
47
|
+
}
|
48
|
+
map_element "Extension", to: :extension,
|
49
|
+
value_map: {
|
50
|
+
from: {
|
51
|
+
nil: :empty,
|
52
|
+
empty: :empty,
|
53
|
+
omitted: :empty
|
54
|
+
},
|
55
|
+
to: {
|
56
|
+
nil: :empty,
|
57
|
+
empty: :empty,
|
58
|
+
omitted: :empty
|
59
|
+
}
|
60
|
+
}
|
37
61
|
end
|
38
62
|
end
|
39
63
|
end
|
data/lib/xmi/root.rb
CHANGED
@@ -30,7 +30,7 @@ module Xmi
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
class Root < Lutaml::Model::Serializable
|
33
|
+
class Root < Lutaml::Model::Serializable # rubocop:disable Metrics/ClassLength
|
34
34
|
include RootAttributes
|
35
35
|
attribute :model, Uml::UmlModel
|
36
36
|
|
@@ -51,40 +51,184 @@ module Xmi
|
|
51
51
|
prefix: "uml"
|
52
52
|
map_element "Bibliography", to: :bibliography,
|
53
53
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
54
|
-
prefix: "thecustomprofile"
|
54
|
+
prefix: "thecustomprofile",
|
55
|
+
value_map: {
|
56
|
+
from: {
|
57
|
+
nil: :empty,
|
58
|
+
empty: :empty,
|
59
|
+
omitted: :empty
|
60
|
+
},
|
61
|
+
to: {
|
62
|
+
nil: :empty,
|
63
|
+
empty: :empty,
|
64
|
+
omitted: :empty
|
65
|
+
}
|
66
|
+
}
|
55
67
|
map_element "BasicDoc", to: :basic_doc,
|
56
68
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
57
|
-
prefix: "thecustomprofile"
|
69
|
+
prefix: "thecustomprofile",
|
70
|
+
value_map: {
|
71
|
+
from: {
|
72
|
+
nil: :empty,
|
73
|
+
empty: :empty,
|
74
|
+
omitted: :empty
|
75
|
+
},
|
76
|
+
to: {
|
77
|
+
nil: :empty,
|
78
|
+
empty: :empty,
|
79
|
+
omitted: :empty
|
80
|
+
}
|
81
|
+
}
|
58
82
|
map_element "enumeration", to: :enumeration,
|
59
83
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
60
|
-
prefix: "thecustomprofile"
|
84
|
+
prefix: "thecustomprofile",
|
85
|
+
value_map: {
|
86
|
+
from: {
|
87
|
+
nil: :empty,
|
88
|
+
empty: :empty,
|
89
|
+
omitted: :empty
|
90
|
+
},
|
91
|
+
to: {
|
92
|
+
nil: :empty,
|
93
|
+
empty: :empty,
|
94
|
+
omitted: :empty
|
95
|
+
}
|
96
|
+
}
|
61
97
|
map_element "OCL", to: :ocl,
|
62
98
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
63
|
-
prefix: "thecustomprofile"
|
99
|
+
prefix: "thecustomprofile",
|
100
|
+
value_map: {
|
101
|
+
from: {
|
102
|
+
nil: :empty,
|
103
|
+
empty: :empty,
|
104
|
+
omitted: :empty
|
105
|
+
},
|
106
|
+
to: {
|
107
|
+
nil: :empty,
|
108
|
+
empty: :empty,
|
109
|
+
omitted: :empty
|
110
|
+
}
|
111
|
+
}
|
64
112
|
map_element "invariant", to: :invariant,
|
65
113
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
66
|
-
prefix: "thecustomprofile"
|
114
|
+
prefix: "thecustomprofile",
|
115
|
+
value_map: {
|
116
|
+
from: {
|
117
|
+
nil: :empty,
|
118
|
+
empty: :empty,
|
119
|
+
omitted: :empty
|
120
|
+
},
|
121
|
+
to: {
|
122
|
+
nil: :empty,
|
123
|
+
empty: :empty,
|
124
|
+
omitted: :empty
|
125
|
+
}
|
126
|
+
}
|
67
127
|
map_element "publicationDate", to: :publication_date,
|
68
128
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
69
|
-
prefix: "thecustomprofile"
|
129
|
+
prefix: "thecustomprofile",
|
130
|
+
value_map: {
|
131
|
+
from: {
|
132
|
+
nil: :empty,
|
133
|
+
empty: :empty,
|
134
|
+
omitted: :empty
|
135
|
+
},
|
136
|
+
to: {
|
137
|
+
nil: :empty,
|
138
|
+
empty: :empty,
|
139
|
+
omitted: :empty
|
140
|
+
}
|
141
|
+
}
|
70
142
|
map_element "edition", to: :edition,
|
71
143
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
72
|
-
prefix: "thecustomprofile"
|
144
|
+
prefix: "thecustomprofile",
|
145
|
+
value_map: {
|
146
|
+
from: {
|
147
|
+
nil: :empty,
|
148
|
+
empty: :empty,
|
149
|
+
omitted: :empty
|
150
|
+
},
|
151
|
+
to: {
|
152
|
+
nil: :empty,
|
153
|
+
empty: :empty,
|
154
|
+
omitted: :empty
|
155
|
+
}
|
156
|
+
}
|
73
157
|
map_element "number", to: :number,
|
74
158
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
75
|
-
prefix: "thecustomprofile"
|
159
|
+
prefix: "thecustomprofile",
|
160
|
+
value_map: {
|
161
|
+
from: {
|
162
|
+
nil: :empty,
|
163
|
+
empty: :empty,
|
164
|
+
omitted: :empty
|
165
|
+
},
|
166
|
+
to: {
|
167
|
+
nil: :empty,
|
168
|
+
empty: :empty,
|
169
|
+
omitted: :empty
|
170
|
+
}
|
171
|
+
}
|
76
172
|
map_element "yearVersion", to: :year_version,
|
77
173
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
78
|
-
prefix: "thecustomprofile"
|
174
|
+
prefix: "thecustomprofile",
|
175
|
+
value_map: {
|
176
|
+
from: {
|
177
|
+
nil: :empty,
|
178
|
+
empty: :empty,
|
179
|
+
omitted: :empty
|
180
|
+
},
|
181
|
+
to: {
|
182
|
+
nil: :empty,
|
183
|
+
empty: :empty,
|
184
|
+
omitted: :empty
|
185
|
+
}
|
186
|
+
}
|
79
187
|
map_element "informative", to: :informative,
|
80
188
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
81
|
-
prefix: "thecustomprofile"
|
189
|
+
prefix: "thecustomprofile",
|
190
|
+
value_map: {
|
191
|
+
from: {
|
192
|
+
nil: :empty,
|
193
|
+
empty: :empty,
|
194
|
+
omitted: :empty
|
195
|
+
},
|
196
|
+
to: {
|
197
|
+
nil: :empty,
|
198
|
+
empty: :empty,
|
199
|
+
omitted: :empty
|
200
|
+
}
|
201
|
+
}
|
82
202
|
map_element "persistence", to: :persistence,
|
83
203
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
84
|
-
prefix: "thecustomprofile"
|
204
|
+
prefix: "thecustomprofile",
|
205
|
+
value_map: {
|
206
|
+
from: {
|
207
|
+
nil: :empty,
|
208
|
+
empty: :empty,
|
209
|
+
omitted: :empty
|
210
|
+
},
|
211
|
+
to: {
|
212
|
+
nil: :empty,
|
213
|
+
empty: :empty,
|
214
|
+
omitted: :empty
|
215
|
+
}
|
216
|
+
}
|
85
217
|
map_element "Abstract", to: :abstract,
|
86
218
|
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
87
|
-
prefix: "thecustomprofile"
|
219
|
+
prefix: "thecustomprofile",
|
220
|
+
value_map: {
|
221
|
+
from: {
|
222
|
+
nil: :empty,
|
223
|
+
empty: :empty,
|
224
|
+
omitted: :empty
|
225
|
+
},
|
226
|
+
to: {
|
227
|
+
nil: :empty,
|
228
|
+
empty: :empty,
|
229
|
+
omitted: :empty
|
230
|
+
}
|
231
|
+
}
|
88
232
|
end
|
89
233
|
end
|
90
234
|
end
|