xmi 0.3.11 → 0.3.13
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/Gemfile +0 -6
- data/README.adoc +89 -0
- data/lib/xmi/add.rb +11 -13
- data/lib/xmi/delete.rb +9 -11
- data/lib/xmi/difference.rb +9 -11
- data/lib/xmi/documentation.rb +16 -18
- data/lib/xmi/ea_root.rb +18 -17
- data/lib/xmi/extension.rb +9 -11
- data/lib/xmi/extensions/eauml.rb +2 -2
- data/lib/xmi/extensions/gml.rb +37 -35
- data/lib/xmi/replace.rb +11 -13
- data/lib/xmi/root.rb +57 -10
- data/lib/xmi/sparx.rb +301 -288
- data/lib/xmi/the_custom_profile.rb +149 -0
- data/lib/xmi/uml.rb +135 -136
- data/lib/xmi/version.rb +1 -1
- data/lib/xmi.rb +15 -9
- data/xmi.gemspec +1 -1
- metadata +8 -7
data/lib/xmi/uml.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Xmi
|
4
4
|
module Uml
|
5
|
-
class AnnotatedElement <
|
6
|
-
attribute :idref,
|
5
|
+
class AnnotatedElement < Lutaml::Model::Serializable
|
6
|
+
attribute :idref, :string
|
7
7
|
|
8
8
|
xml do
|
9
9
|
root "annotatedElement"
|
@@ -12,9 +12,9 @@ module Xmi
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
class Type <
|
16
|
-
attribute :idref,
|
17
|
-
attribute :href,
|
15
|
+
class Type < Lutaml::Model::Serializable
|
16
|
+
attribute :idref, :string
|
17
|
+
attribute :href, :string
|
18
18
|
|
19
19
|
xml do
|
20
20
|
root "type"
|
@@ -24,8 +24,8 @@ module Xmi
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
class MemberEnd <
|
28
|
-
attribute :idref,
|
27
|
+
class MemberEnd < Lutaml::Model::Serializable
|
28
|
+
attribute :idref, :string
|
29
29
|
|
30
30
|
xml do
|
31
31
|
root "memberEnd"
|
@@ -37,20 +37,20 @@ module Xmi
|
|
37
37
|
module OwnedEndAttributes
|
38
38
|
def self.included(klass) # rubocop:disable Metrics/MethodLength
|
39
39
|
klass.class_eval do
|
40
|
-
attribute :type,
|
41
|
-
attribute :id,
|
42
|
-
attribute :association,
|
43
|
-
attribute :name,
|
40
|
+
attribute :type, :string
|
41
|
+
attribute :id, :string
|
42
|
+
attribute :association, :string
|
43
|
+
attribute :name, :string
|
44
44
|
attribute :uml_type, Uml::Type
|
45
45
|
attribute :member_end, MemberEnd
|
46
|
-
attribute :lower,
|
47
|
-
attribute :upper,
|
48
|
-
attribute :is_composite,
|
46
|
+
attribute :lower, :integer
|
47
|
+
attribute :upper, :integer
|
48
|
+
attribute :is_composite, :boolean
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
class OwnedEnd <
|
53
|
+
class OwnedEnd < Lutaml::Model::Serializable
|
54
54
|
include OwnedEndAttributes
|
55
55
|
|
56
56
|
xml do
|
@@ -68,10 +68,10 @@ module Xmi
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
class DefaultValue <
|
72
|
-
attribute :type,
|
73
|
-
attribute :id,
|
74
|
-
attribute :value,
|
71
|
+
class DefaultValue < Lutaml::Model::Serializable
|
72
|
+
attribute :type, :string
|
73
|
+
attribute :id, :string
|
74
|
+
attribute :value, :string
|
75
75
|
|
76
76
|
xml do
|
77
77
|
root "defaultValue"
|
@@ -102,10 +102,10 @@ module Xmi
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
class OwnedLiteral <
|
106
|
-
attribute :type,
|
107
|
-
attribute :id,
|
108
|
-
attribute :name,
|
105
|
+
class OwnedLiteral < Lutaml::Model::Serializable
|
106
|
+
attribute :type, :string
|
107
|
+
attribute :id, :string
|
108
|
+
attribute :name, :string
|
109
109
|
attribute :uml_type, Uml::Type
|
110
110
|
|
111
111
|
xml do
|
@@ -115,18 +115,18 @@ module Xmi
|
|
115
115
|
map_attribute "id", to: :id, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
116
116
|
map_attribute "name", to: :name
|
117
117
|
|
118
|
-
map_element "type", to: :uml_type
|
118
|
+
map_element "type", to: :uml_type, namespace: nil, prefix: nil
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
122
|
module OwnedAttributeAttributes
|
123
123
|
def self.included(klass)
|
124
124
|
klass.class_eval do
|
125
|
-
attribute :type,
|
126
|
-
attribute :id,
|
127
|
-
attribute :association,
|
128
|
-
attribute :name,
|
129
|
-
attribute :is_derived,
|
125
|
+
attribute :type, :string
|
126
|
+
attribute :id, :string
|
127
|
+
attribute :association, :string
|
128
|
+
attribute :name, :string
|
129
|
+
attribute :is_derived, :string
|
130
130
|
attribute :uml_type, Uml::Type
|
131
131
|
attribute :upper_value, UpperValue
|
132
132
|
attribute :lower_value, LowerValue
|
@@ -134,7 +134,7 @@ module Xmi
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
-
class OwnedAttribute <
|
137
|
+
class OwnedAttribute < Lutaml::Model::Serializable
|
138
138
|
include OwnedAttributeAttributes
|
139
139
|
|
140
140
|
xml do
|
@@ -146,17 +146,17 @@ module Xmi
|
|
146
146
|
map_attribute "name", to: :name
|
147
147
|
map_attribute "isDerived", to: :is_derived
|
148
148
|
|
149
|
-
map_element "type", to: :uml_type
|
150
|
-
map_element "upperValue", to: :upper_value
|
151
|
-
map_element "lowerValue", to: :lower_value
|
149
|
+
map_element "type", to: :uml_type, namespace: nil, prefix: nil
|
150
|
+
map_element "upperValue", to: :upper_value, namespace: nil, prefix: nil
|
151
|
+
map_element "lowerValue", to: :lower_value, namespace: nil, prefix: nil
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
-
class OwnedParameter <
|
156
|
-
attribute :id,
|
157
|
-
attribute :name,
|
158
|
-
attribute :type,
|
159
|
-
attribute :direction,
|
155
|
+
class OwnedParameter < Lutaml::Model::Serializable
|
156
|
+
attribute :id, :string
|
157
|
+
attribute :name, :string
|
158
|
+
attribute :type, :string
|
159
|
+
attribute :direction, :string
|
160
160
|
attribute :upper_value, UpperValue
|
161
161
|
attribute :lower_value, LowerValue
|
162
162
|
attribute :default_value, DefaultValue
|
@@ -169,16 +169,16 @@ module Xmi
|
|
169
169
|
map_attribute "type", to: :type, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
170
170
|
map_attribute "direction", to: :direction
|
171
171
|
|
172
|
-
map_element "upperValue", to: :upper_value
|
173
|
-
map_element "lowerValue", to: :lower_value
|
174
|
-
map_element "defaultValue", to: :default_value
|
172
|
+
map_element "upperValue", to: :upper_value, namespace: nil, prefix: nil
|
173
|
+
map_element "lowerValue", to: :lower_value, namespace: nil, prefix: nil
|
174
|
+
map_element "defaultValue", to: :default_value, namespace: nil, prefix: nil
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
|
-
class Specification <
|
179
|
-
attribute :id,
|
180
|
-
attribute :type,
|
181
|
-
attribute :language,
|
178
|
+
class Specification < Lutaml::Model::Serializable
|
179
|
+
attribute :id, :string
|
180
|
+
attribute :type, :string
|
181
|
+
attribute :language, :string
|
182
182
|
|
183
183
|
xml do
|
184
184
|
root "specification"
|
@@ -188,10 +188,10 @@ module Xmi
|
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
191
|
-
class Precondition <
|
192
|
-
attribute :id,
|
193
|
-
attribute :name,
|
194
|
-
attribute :type,
|
191
|
+
class Precondition < Lutaml::Model::Serializable
|
192
|
+
attribute :id, :string
|
193
|
+
attribute :name, :string
|
194
|
+
attribute :type, :string
|
195
195
|
attribute :specification, Specification
|
196
196
|
|
197
197
|
xml do
|
@@ -199,13 +199,13 @@ module Xmi
|
|
199
199
|
map_attribute "id", to: :id, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
200
200
|
map_attribute "name", to: :name
|
201
201
|
map_attribute "type", to: :type, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
202
|
-
map_element "specification", to: :specification
|
202
|
+
map_element "specification", to: :specification, namespace: nil, prefix: nil
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
206
|
-
class OwnedOperation <
|
207
|
-
attribute :id,
|
208
|
-
attribute :name,
|
206
|
+
class OwnedOperation < Lutaml::Model::Serializable
|
207
|
+
attribute :id, :string
|
208
|
+
attribute :name, :string
|
209
209
|
attribute :owned_parameter, OwnedParameter, collection: true
|
210
210
|
attribute :precondition, Precondition
|
211
211
|
attribute :uml_type, Uml::Type, collection: true
|
@@ -214,55 +214,54 @@ module Xmi
|
|
214
214
|
root "ownedOperation"
|
215
215
|
map_attribute "id", to: :id, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
216
216
|
map_attribute "name", to: :name
|
217
|
-
map_element "ownedParameter", to: :owned_parameter
|
218
|
-
map_element "precondition", to: :precondition
|
219
|
-
map_element "type", to: :uml_type
|
217
|
+
map_element "ownedParameter", to: :owned_parameter, namespace: nil, prefix: nil
|
218
|
+
map_element "precondition", to: :precondition, namespace: nil, prefix: nil
|
219
|
+
map_element "type", to: :uml_type, namespace: nil, prefix: nil
|
220
220
|
end
|
221
221
|
end
|
222
222
|
|
223
223
|
module OwnedCommentAttributes
|
224
224
|
def self.included(klass)
|
225
225
|
klass.class_eval do
|
226
|
-
attribute :type,
|
227
|
-
attribute :id,
|
228
|
-
attribute :
|
229
|
-
attribute :
|
230
|
-
attribute :
|
226
|
+
attribute :type, :string
|
227
|
+
attribute :id, :string
|
228
|
+
attribute :name, :string
|
229
|
+
attribute :body_element, :string
|
230
|
+
attribute :body_attribute, :string
|
231
|
+
attribute :annotated_attribute, :string
|
231
232
|
attribute :annotated_element, AnnotatedElement
|
232
233
|
end
|
233
234
|
end
|
234
235
|
end
|
235
236
|
|
236
|
-
class OwnedComment <
|
237
|
+
class OwnedComment < Lutaml::Model::Serializable
|
237
238
|
include OwnedCommentAttributes
|
238
239
|
|
239
240
|
xml do
|
240
241
|
root "ownedComment"
|
241
242
|
|
242
243
|
map_attribute "type", to: :type, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
243
|
-
map_attribute "type", to: :type, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
244
|
-
map_attribute "id", to: :id, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
245
244
|
map_attribute "id", to: :id, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
246
245
|
map_attribute "name", to: :name
|
247
246
|
map_attribute "body", to: :body_attribute
|
248
247
|
map_attribute "annotatedElement", to: :annotated_attribute
|
249
248
|
|
250
249
|
map_element "annotatedElement", to: :annotated_element, prefix: nil, namespace: nil
|
251
|
-
map_element "body", to: :body_element
|
250
|
+
map_element "body", to: :body_element, namespace: nil, prefix: nil
|
252
251
|
end
|
253
252
|
end
|
254
253
|
|
255
254
|
module AssociationGeneralizationAttributes
|
256
255
|
def self.included(klass)
|
257
256
|
klass.class_eval do
|
258
|
-
attribute :type,
|
259
|
-
attribute :id,
|
260
|
-
attribute :general,
|
257
|
+
attribute :type, :string
|
258
|
+
attribute :id, :string
|
259
|
+
attribute :general, :string
|
261
260
|
end
|
262
261
|
end
|
263
262
|
end
|
264
263
|
|
265
|
-
class AssociationGeneralization <
|
264
|
+
class AssociationGeneralization < Lutaml::Model::Serializable
|
266
265
|
include AssociationGeneralizationAttributes
|
267
266
|
|
268
267
|
xml do
|
@@ -277,22 +276,22 @@ module Xmi
|
|
277
276
|
module PackagedElementAttributes
|
278
277
|
def self.included(klass) # rubocop:disable Metrics/MethodLength
|
279
278
|
klass.class_eval do
|
280
|
-
attribute :type,
|
281
|
-
attribute :id,
|
282
|
-
attribute :name,
|
283
|
-
attribute :member_end,
|
279
|
+
attribute :type, :string
|
280
|
+
attribute :id, :string
|
281
|
+
attribute :name, :string
|
282
|
+
attribute :member_end, :string
|
284
283
|
attribute :member_ends, MemberEnd, collection: true
|
285
284
|
attribute :owned_literal, OwnedLiteral, collection: true
|
286
285
|
attribute :owned_operation, OwnedOperation, collection: true
|
287
286
|
|
288
287
|
# EA specific
|
289
|
-
attribute :supplier,
|
290
|
-
attribute :client,
|
288
|
+
attribute :supplier, :string
|
289
|
+
attribute :client, :string
|
291
290
|
end
|
292
291
|
end
|
293
292
|
end
|
294
293
|
|
295
|
-
class PackagedElement <
|
294
|
+
class PackagedElement < Lutaml::Model::Serializable
|
296
295
|
include PackagedElementAttributes
|
297
296
|
attribute :packaged_element, PackagedElement, collection: true
|
298
297
|
attribute :owned_end, OwnedEnd, collection: true
|
@@ -312,24 +311,24 @@ module Xmi
|
|
312
311
|
map_attribute "supplier", to: :supplier
|
313
312
|
map_attribute "client", to: :client
|
314
313
|
|
315
|
-
map_element "generalization", to: :generalization
|
316
|
-
map_element "ownedComment", to: :owned_comment
|
317
|
-
map_element "ownedEnd", to: :owned_end
|
318
|
-
map_element "ownedLiteral", to: :owned_literal
|
319
|
-
map_element "ownedAttribute", to: :owned_attribute
|
320
|
-
map_element "ownedOperation", to: :owned_operation
|
321
|
-
map_element "packagedElement", to: :packaged_element
|
322
|
-
map_element "memberEnd", to: :member_ends
|
314
|
+
map_element "generalization", to: :generalization, namespace: nil, prefix: nil
|
315
|
+
map_element "ownedComment", to: :owned_comment, namespace: nil, prefix: nil
|
316
|
+
map_element "ownedEnd", to: :owned_end, namespace: nil, prefix: nil
|
317
|
+
map_element "ownedLiteral", to: :owned_literal, namespace: nil, prefix: nil
|
318
|
+
map_element "ownedAttribute", to: :owned_attribute, namespace: nil, prefix: nil
|
319
|
+
map_element "ownedOperation", to: :owned_operation, namespace: nil, prefix: nil
|
320
|
+
map_element "packagedElement", to: :packaged_element, namespace: nil, prefix: nil
|
321
|
+
map_element "memberEnd", to: :member_ends, namespace: nil, prefix: nil
|
323
322
|
end
|
324
323
|
end
|
325
324
|
|
326
|
-
class Bounds <
|
327
|
-
attribute :type,
|
328
|
-
attribute :id,
|
329
|
-
attribute :x,
|
330
|
-
attribute :y,
|
331
|
-
attribute :height,
|
332
|
-
attribute :width,
|
325
|
+
class Bounds < Lutaml::Model::Serializable
|
326
|
+
attribute :type, :string
|
327
|
+
attribute :id, :string
|
328
|
+
attribute :x, :integer
|
329
|
+
attribute :y, :integer
|
330
|
+
attribute :height, :integer
|
331
|
+
attribute :width, :integer
|
333
332
|
|
334
333
|
xml do
|
335
334
|
root "bounds"
|
@@ -343,11 +342,11 @@ module Xmi
|
|
343
342
|
end
|
344
343
|
end
|
345
344
|
|
346
|
-
class Waypoint <
|
347
|
-
attribute :type,
|
348
|
-
attribute :id,
|
349
|
-
attribute :x,
|
350
|
-
attribute :y,
|
345
|
+
class Waypoint < Lutaml::Model::Serializable
|
346
|
+
attribute :type, :string
|
347
|
+
attribute :id, :string
|
348
|
+
attribute :x, :integer
|
349
|
+
attribute :y, :integer
|
351
350
|
|
352
351
|
xml do
|
353
352
|
root "waypoint"
|
@@ -359,15 +358,15 @@ module Xmi
|
|
359
358
|
end
|
360
359
|
end
|
361
360
|
|
362
|
-
class OwnedElement <
|
363
|
-
attribute :type,
|
364
|
-
attribute :id,
|
365
|
-
attribute :text,
|
366
|
-
attribute :model_element,
|
361
|
+
class OwnedElement < Lutaml::Model::Serializable
|
362
|
+
attribute :type, :string
|
363
|
+
attribute :id, :string
|
364
|
+
attribute :text, :string
|
365
|
+
attribute :model_element, :string
|
367
366
|
attribute :owned_element, OwnedElement, collection: true
|
368
367
|
attribute :bounds, Bounds, collection: true
|
369
|
-
attribute :source,
|
370
|
-
attribute :target,
|
368
|
+
attribute :source, :string
|
369
|
+
attribute :target, :string
|
371
370
|
attribute :waypoint, Waypoint
|
372
371
|
|
373
372
|
xml do
|
@@ -378,27 +377,27 @@ module Xmi
|
|
378
377
|
map_attribute "text", to: :text
|
379
378
|
map_attribute "modelElement", to: :model_element
|
380
379
|
|
381
|
-
map_element "ownedElement", to: :owned_element
|
382
|
-
map_element "bounds", to: :bounds
|
383
|
-
map_element "source", to: :source
|
384
|
-
map_element "target", to: :target
|
385
|
-
map_element "waypoint", to: :waypoint
|
380
|
+
map_element "ownedElement", to: :owned_element, namespace: nil, prefix: nil
|
381
|
+
map_element "bounds", to: :bounds, namespace: nil, prefix: nil
|
382
|
+
map_element "source", to: :source, namespace: nil, prefix: nil
|
383
|
+
map_element "target", to: :target, namespace: nil, prefix: nil
|
384
|
+
map_element "waypoint", to: :waypoint, namespace: nil, prefix: nil
|
386
385
|
end
|
387
386
|
end
|
388
387
|
|
389
388
|
module DiagramAttributes
|
390
389
|
def self.included(klass)
|
391
390
|
klass.class_eval do
|
392
|
-
attribute :type,
|
393
|
-
attribute :id,
|
394
|
-
attribute :is_frame,
|
395
|
-
attribute :model_element,
|
391
|
+
attribute :type, :string
|
392
|
+
attribute :id, :string
|
393
|
+
attribute :is_frame, :boolean
|
394
|
+
attribute :model_element, :string
|
396
395
|
attribute :owned_element, OwnedElement, collection: true
|
397
396
|
end
|
398
397
|
end
|
399
398
|
end
|
400
399
|
|
401
|
-
class Diagram <
|
400
|
+
class Diagram < Lutaml::Model::Serializable
|
402
401
|
include DiagramAttributes
|
403
402
|
|
404
403
|
xml do
|
@@ -414,9 +413,9 @@ module Xmi
|
|
414
413
|
end
|
415
414
|
end
|
416
415
|
|
417
|
-
class ProfileApplicationAppliedProfile <
|
418
|
-
attribute :type,
|
419
|
-
attribute :href,
|
416
|
+
class ProfileApplicationAppliedProfile < Lutaml::Model::Serializable
|
417
|
+
attribute :type, :string
|
418
|
+
attribute :href, :string
|
420
419
|
|
421
420
|
xml do
|
422
421
|
root "appliedProfile"
|
@@ -426,9 +425,9 @@ module Xmi
|
|
426
425
|
end
|
427
426
|
end
|
428
427
|
|
429
|
-
class ProfileApplication <
|
430
|
-
attribute :type,
|
431
|
-
attribute :id,
|
428
|
+
class ProfileApplication < Lutaml::Model::Serializable
|
429
|
+
attribute :type, :string
|
430
|
+
attribute :id, :string
|
432
431
|
attribute :applied_profile, ProfileApplicationAppliedProfile
|
433
432
|
|
434
433
|
xml do
|
@@ -437,12 +436,12 @@ module Xmi
|
|
437
436
|
map_attribute "type", to: :type, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
438
437
|
map_attribute "id", to: :id, namespace: "http://www.omg.org/spec/XMI/20131001", prefix: "xmi"
|
439
438
|
|
440
|
-
map_element "appliedProfile", to: :applied_profile
|
439
|
+
map_element "appliedProfile", to: :applied_profile, namespace: nil, prefix: nil
|
441
440
|
end
|
442
441
|
end
|
443
442
|
|
444
|
-
class ImportedPackage <
|
445
|
-
attribute :href,
|
443
|
+
class ImportedPackage < Lutaml::Model::Serializable
|
444
|
+
attribute :href, :string
|
446
445
|
|
447
446
|
xml do
|
448
447
|
root "importedPackage"
|
@@ -454,13 +453,13 @@ module Xmi
|
|
454
453
|
module PackageImportAttributes
|
455
454
|
def self.included(klass)
|
456
455
|
klass.class_eval do
|
457
|
-
attribute :id,
|
456
|
+
attribute :id, :string
|
458
457
|
attribute :imported_package, ImportedPackage
|
459
458
|
end
|
460
459
|
end
|
461
460
|
end
|
462
461
|
|
463
|
-
class PackageImport <
|
462
|
+
class PackageImport < Lutaml::Model::Serializable
|
464
463
|
include PackageImportAttributes
|
465
464
|
|
466
465
|
xml do
|
@@ -476,14 +475,14 @@ module Xmi
|
|
476
475
|
module UmlModelAttributes
|
477
476
|
def self.included(klass)
|
478
477
|
klass.class_eval do
|
479
|
-
attribute :type,
|
480
|
-
attribute :name,
|
478
|
+
attribute :type, :string
|
479
|
+
attribute :name, :string
|
481
480
|
attribute :profile_application, ProfileApplication, collection: true
|
482
481
|
end
|
483
482
|
end
|
484
483
|
end
|
485
484
|
|
486
|
-
class UmlModel <
|
485
|
+
class UmlModel < Lutaml::Model::Serializable
|
487
486
|
include UmlModelAttributes
|
488
487
|
attribute :packaged_element, PackagedElement, collection: true
|
489
488
|
attribute :package_import, PackageImport, collection: true
|
@@ -509,19 +508,19 @@ module Xmi
|
|
509
508
|
klass.class_eval do
|
510
509
|
attribute :packaged_element, PackagedElement, collection: true
|
511
510
|
attribute :package_import, PackageImport, collection: true
|
512
|
-
attribute :id,
|
513
|
-
attribute :name,
|
514
|
-
# attribute :xmi,
|
515
|
-
# attribute :uml,
|
516
|
-
attribute :ns_prefix,
|
511
|
+
attribute :id, :string
|
512
|
+
attribute :name, :string
|
513
|
+
# attribute :xmi, :string
|
514
|
+
# attribute :uml, :string
|
515
|
+
attribute :ns_prefix, :string
|
517
516
|
|
518
517
|
# Is this an EA thing?
|
519
|
-
attribute :metamodel_reference,
|
518
|
+
attribute :metamodel_reference, :string
|
520
519
|
end
|
521
520
|
end
|
522
521
|
end
|
523
522
|
|
524
|
-
class Profile <
|
523
|
+
class Profile < Lutaml::Model::Serializable
|
525
524
|
include ProfileAttributes
|
526
525
|
attribute :owned_comment, OwnedComment, collection: true
|
527
526
|
|
@@ -533,9 +532,9 @@ module Xmi
|
|
533
532
|
map_attribute "metamodelReference", to: :metamodel_reference
|
534
533
|
map_attribute "nsPrefix", to: :ns_prefix
|
535
534
|
|
536
|
-
map_element "ownedComment", to: :owned_comment
|
535
|
+
map_element "ownedComment", to: :owned_comment, namespace: nil, prefix: nil
|
537
536
|
map_element "packageImport", to: :package_import, namespace: nil, prefix: nil
|
538
|
-
map_element "packagedElement", to: :packaged_element
|
537
|
+
map_element "packagedElement", to: :packaged_element, namespace: nil, prefix: nil
|
539
538
|
end
|
540
539
|
end
|
541
540
|
end
|
data/lib/xmi/version.rb
CHANGED
data/lib/xmi.rb
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "lutaml/model"
|
4
|
+
require "lutaml/model/xml_adapter/nokogiri_adapter"
|
5
|
+
# require "lutaml/model/json_adapter/standard_json_adapter"
|
6
|
+
# require "lutaml/model/yaml_adapter/standard_yaml_adapter"
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
+
Lutaml::Model::Config.configure do |config|
|
9
|
+
config.xml_adapter = Lutaml::Model::XmlAdapter::NokogiriAdapter
|
10
|
+
# config.yaml_adapter = Lutaml::Model::YamlAdapter::StandardYamlAdapter
|
11
|
+
# config.json_adapter = Lutaml::Model::JsonAdapter::StandardJsonAdapter
|
8
12
|
end
|
9
13
|
|
10
|
-
|
11
|
-
module
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
module Lutaml
|
15
|
+
module Model
|
16
|
+
class Serializable
|
17
|
+
def type?(test_type)
|
18
|
+
!!type ? type == test_type : false
|
19
|
+
end
|
15
20
|
end
|
16
21
|
end
|
17
22
|
end
|
@@ -31,5 +36,6 @@ require_relative "xmi/extension"
|
|
31
36
|
require_relative "xmi/replace"
|
32
37
|
require_relative "xmi/ea_root"
|
33
38
|
require_relative "xmi/uml"
|
39
|
+
require_relative "xmi/the_custom_profile"
|
34
40
|
require_relative "xmi/root"
|
35
41
|
require_relative "xmi/sparx"
|
data/xmi.gemspec
CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
|
32
32
|
spec.required_ruby_version = ">= 3.0.0"
|
33
33
|
|
34
|
+
spec.add_runtime_dependency "lutaml-model"
|
34
35
|
spec.add_runtime_dependency "nokogiri"
|
35
|
-
spec.add_runtime_dependency "shale"
|
36
36
|
|
37
37
|
spec.add_development_dependency "pry", "~> 0.12.2"
|
38
38
|
spec.add_development_dependency "rake", "~> 13.0"
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: lutaml-model
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/xmi/replace.rb
|
138
138
|
- lib/xmi/root.rb
|
139
139
|
- lib/xmi/sparx.rb
|
140
|
+
- lib/xmi/the_custom_profile.rb
|
140
141
|
- lib/xmi/uml.rb
|
141
142
|
- lib/xmi/version.rb
|
142
143
|
- sig/xmi.rbs
|
@@ -148,7 +149,7 @@ metadata:
|
|
148
149
|
homepage_uri: https://github.com/lutaml/xmi
|
149
150
|
source_code_uri: https://github.com/lutaml/xmi
|
150
151
|
changelog_uri: https://github.com/lutaml/xmi/releases
|
151
|
-
post_install_message:
|
152
|
+
post_install_message:
|
152
153
|
rdoc_options: []
|
153
154
|
require_paths:
|
154
155
|
- lib
|
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
165
|
version: '0'
|
165
166
|
requirements: []
|
166
167
|
rubygems_version: 3.3.27
|
167
|
-
signing_key:
|
168
|
+
signing_key:
|
168
169
|
specification_version: 4
|
169
170
|
summary: XMI data model parser
|
170
171
|
test_files: []
|