ea 0.6.154 → 0.6.155
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/ea/cli/app.rb +8 -2
- data/lib/ea/cli/command/base.rb +1 -3
- data/lib/ea/cli/command/convert.rb +2 -2
- data/lib/ea/cli/command/diagrams.rb +4 -4
- data/lib/ea/cli/command/export.rb +1 -1
- data/lib/ea/cli/command/info.rb +1 -1
- data/lib/ea/cli/command/list.rb +2 -2
- data/lib/ea/cli/command/render.rb +1 -2
- data/lib/ea/cli/command/svg.rb +1 -1
- data/lib/ea/cli/command/validate.rb +1 -3
- data/lib/ea/cli/error.rb +1 -1
- data/lib/ea/cli/output.rb +1 -1
- data/lib/ea/diagram/display_config.rb +1 -1
- data/lib/ea/export/json/generator.rb +5 -5
- data/lib/ea/export/json_schema/generator.rb +2 -2
- data/lib/ea/export/plantuml/generator.rb +2 -2
- data/lib/ea/fonts/metrics.rb +3 -4
- data/lib/ea/lint/rules/cyclic_generalization.rb +1 -1
- data/lib/ea/lint/rules/duplicate_name.rb +1 -1
- data/lib/ea/lint/rules/missing_stereotype.rb +4 -3
- data/lib/ea/lint/rules/naming_convention.rb +11 -11
- data/lib/ea/lint/rules/orphan_element.rb +6 -6
- data/lib/ea/mdg/document.rb +0 -1
- data/lib/ea/mdg/loader.rb +0 -1
- data/lib/ea/mdg/xml/technology.rb +1 -1
- data/lib/ea/mdg/xml.rb +0 -1
- data/lib/ea/mdg.rb +0 -1
- data/lib/ea/model/document.rb +2 -2
- data/lib/ea/model/ghost_label.rb +0 -1
- data/lib/ea/model/legend.rb +1 -1
- data/lib/ea/model/property.rb +1 -1
- data/lib/ea/qea/benchmark.rb +9 -13
- data/lib/ea/qea/database.rb +26 -28
- data/lib/ea/qea/factory/association_builder.rb +5 -5
- data/lib/ea/qea/factory/association_transformer.rb +3 -6
- data/lib/ea/qea/factory/attribute_transformer.rb +3 -3
- data/lib/ea/qea/factory/base_transformer.rb +4 -4
- data/lib/ea/qea/factory/class_transformer.rb +5 -5
- data/lib/ea/qea/factory/constraint_transformer.rb +2 -2
- data/lib/ea/qea/factory/data_type_transformer.rb +5 -7
- data/lib/ea/qea/factory/diagram_transformer.rb +3 -7
- data/lib/ea/qea/factory/document_builder.rb +33 -37
- data/lib/ea/qea/factory/ea_to_uml_factory.rb +12 -18
- data/lib/ea/qea/factory/enum_transformer.rb +1 -2
- data/lib/ea/qea/factory/generalization_builder.rb +9 -9
- data/lib/ea/qea/factory/generalization_transformer.rb +3 -5
- data/lib/ea/qea/factory/instance_transformer.rb +3 -8
- data/lib/ea/qea/factory/operation_transformer.rb +2 -4
- data/lib/ea/qea/factory/package_transformer.rb +3 -3
- data/lib/ea/qea/factory/reference_resolver.rb +1 -1
- data/lib/ea/qea/factory/stereotype_loader.rb +1 -5
- data/lib/ea/qea/file_detector.rb +6 -12
- data/lib/ea/qea/infrastructure/database_connection.rb +1 -3
- data/lib/ea/qea/infrastructure/schema_reader.rb +4 -4
- data/lib/ea/qea/infrastructure/table_reader.rb +1 -1
- data/lib/ea/qea/models/ea_attribute.rb +1 -2
- data/lib/ea/qea/models/ea_attribute_tag.rb +1 -2
- data/lib/ea/qea/models/ea_author.rb +1 -1
- data/lib/ea/qea/models/ea_diagram_link.rb +4 -8
- data/lib/ea/qea/models/ea_diagram_object.rb +3 -4
- data/lib/ea/qea/models/ea_document.rb +4 -5
- data/lib/ea/qea/models/ea_glossary.rb +1 -1
- data/lib/ea/qea/models/ea_list.rb +1 -1
- data/lib/ea/qea/models/ea_object.rb +2 -2
- data/lib/ea/qea/models/ea_object_constraint.rb +1 -2
- data/lib/ea/qea/models/ea_object_property.rb +1 -2
- data/lib/ea/qea/models/ea_operation.rb +1 -2
- data/lib/ea/qea/models/ea_phase.rb +1 -1
- data/lib/ea/qea/models/ea_script.rb +5 -6
- data/lib/ea/qea/models/ea_tagged_value.rb +2 -3
- data/lib/ea/qea/models/ea_version.rb +1 -1
- data/lib/ea/qea/models/ea_xref.rb +6 -7
- data/lib/ea/qea/repositories/base_repository.rb +1 -1
- data/lib/ea/qea/services/database_loader.rb +2 -4
- data/lib/ea/qea/validation/association_validator.rb +12 -12
- data/lib/ea/qea/validation/attribute_validator.rb +25 -26
- data/lib/ea/qea/validation/base_validator.rb +5 -5
- data/lib/ea/qea/validation/class_validator.rb +34 -34
- data/lib/ea/qea/validation/database/circular_reference_validator.rb +7 -7
- data/lib/ea/qea/validation/database/ocl_constraint_validator.rb +3 -3
- data/lib/ea/qea/validation/database/orphan_validator.rb +5 -7
- data/lib/ea/qea/validation/database/referential_integrity_validator.rb +39 -39
- data/lib/ea/qea/validation/diagram_validator.rb +39 -39
- data/lib/ea/qea/validation/formatters/json_formatter.rb +16 -16
- data/lib/ea/qea/validation/formatters/text_formatter.rb +10 -10
- data/lib/ea/qea/validation/operation_validator.rb +13 -14
- data/lib/ea/qea/validation/package_validator.rb +18 -18
- data/lib/ea/qea/validation/validation_engine.rb +5 -5
- data/lib/ea/qea/validation/validation_message.rb +56 -73
- data/lib/ea/qea/validation/validation_result.rb +6 -6
- data/lib/ea/qea/verification/comparison_result.rb +13 -21
- data/lib/ea/qea/verification/document_normalizer.rb +6 -12
- data/lib/ea/qea/verification/document_verifier.rb +39 -39
- data/lib/ea/qea/verification/element_comparator.rb +27 -31
- data/lib/ea/qea/verification/structure_matcher.rb +10 -10
- data/lib/ea/qea.rb +5 -7
- data/lib/ea/query/builder.rb +3 -3
- data/lib/ea/render/image_converter.rb +5 -3
- data/lib/ea/shapescript/parser.rb +4 -4
- data/lib/ea/sources/qea/classifier_builder.rb +7 -3
- data/lib/ea/sources/qea/context_diagram_support.rb +2 -2
- data/lib/ea/sources/qea/diagram_builder/routing.rb +4 -4
- data/lib/ea/sources/qea/diagram_builder.rb +80 -51
- data/lib/ea/sources/qea/id_normalizer.rb +0 -1
- data/lib/ea/sources/qea/instance_builder.rb +2 -2
- data/lib/ea/sources/qea/legend_builder.rb +1 -1
- data/lib/ea/sources/qea/note_builder.rb +4 -4
- data/lib/ea/sources/xmi/diagram_builder/stereotype_profiles.rb +1 -1
- data/lib/ea/sources/xmi/extension_style_parser.rb +2 -2
- data/lib/ea/sources/xmi/property_builder.rb +10 -2
- data/lib/ea/sources/xmi/relationship_builder.rb +10 -2
- data/lib/ea/sources/xmi/relationship_type_map.rb +1 -1
- data/lib/ea/sources/xmi/tag_builder.rb +1 -1
- data/lib/ea/sources/xmi/type_classifier_map.rb +1 -1
- data/lib/ea/spa/configuration.rb +2 -4
- data/lib/ea/spa/generator.rb +3 -3
- data/lib/ea/spa/output/strategy.rb +7 -5
- data/lib/ea/spa/projector.rb +21 -17
- data/lib/ea/svg/connector_router.rb +5 -3
- data/lib/ea/svg/ea_emitter/background.rb +0 -1
- data/lib/ea/svg/ea_emitter/bounds_calculator.rb +8 -10
- data/lib/ea/svg/ea_emitter/canvas.rb +1 -1
- data/lib/ea/svg/ea_emitter/color_resolver.rb +1 -1
- data/lib/ea/svg/ea_emitter/compartment/note_body.rb +1 -1
- data/lib/ea/svg/ea_emitter/connector_redock.rb +6 -3
- data/lib/ea/svg/ea_emitter/diagram_frame.rb +2 -2
- data/lib/ea/svg/ea_emitter/document.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/attribute_renderer.rb +2 -4
- data/lib/ea/svg/ea_emitter/element/compartment_geometry.rb +18 -14
- data/lib/ea/svg/ea_emitter/element/header_line_pipeline.rb +6 -5
- data/lib/ea/svg/ea_emitter/element/header_line_provider/name.rb +1 -3
- data/lib/ea/svg/ea_emitter/element/header_line_provider/stereotype_label.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/icon_renderer.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/legend_renderer.rb +1 -1
- data/lib/ea/svg/ea_emitter/element/note_shape_renderer.rb +5 -5
- data/lib/ea/svg/ea_emitter/element/operation_renderer.rb +2 -3
- data/lib/ea/svg/ea_emitter/element/package_shape_renderer.rb +3 -4
- data/lib/ea/svg/ea_emitter/element/stereotype_icon_renderer.rb +1 -1
- data/lib/ea/svg/ea_emitter/elements.rb +64 -63
- data/lib/ea/svg/ea_emitter/ghost_labels.rb +0 -1
- data/lib/ea/svg/ea_emitter/label/end_label.rb +7 -7
- data/lib/ea/svg/ea_emitter/labels.rb +1 -1
- data/lib/ea/svg/ea_emitter/layer_sequencer.rb +5 -5
- data/lib/ea/svg/ea_emitter/marker/arrow_path.rb +4 -2
- data/lib/ea/svg/ea_emitter/marker/open_triangle.rb +4 -4
- data/lib/ea/svg/ea_emitter/markers.rb +3 -1
- data/lib/ea/svg/ea_emitter/render_context.rb +1 -1
- data/lib/ea/svg/ea_emitter/text_renderer.rb +15 -4
- data/lib/ea/theme/definition.rb +17 -17
- data/lib/ea/transformers/qea_to_xmi/context.rb +1 -1
- data/lib/ea/transformers/qea_to_xmi/run_state.rb +1 -1
- data/lib/ea/transformers/qea_to_xmi/transformer.rb +44 -44
- data/lib/ea/transformers/qea_to_xmi/visibility.rb +3 -3
- data/lib/ea/version.rb +1 -1
- data/lib/ea/xmi/liquid_drops/connector_drop.rb +2 -2
- data/lib/ea/xmi/liquid_drops/enum_drop.rb +4 -4
- data/lib/ea/xmi/liquid_drops/generalization_attribute_drop.rb +2 -8
- data/lib/ea/xmi/liquid_drops/generalization_drop.rb +3 -3
- data/lib/ea/xmi/liquid_drops/package_drop.rb +9 -9
- data/lib/ea/xmi/liquid_drops/root_drop.rb +1 -1
- data/lib/ea/xmi/loader.rb +5 -11
- data/lib/ea/xmi/parser.rb +75 -81
- data/lib/ea/xmi/slicer.rb +16 -12
- data/lib/ea/xref_format/legend_definition.rb +31 -0
- data/lib/ea/xref_format/parser.rb +146 -0
- data/lib/ea/xref_format/property_definition.rb +25 -0
- data/lib/ea/xref_format/record.rb +37 -0
- data/lib/ea/xref_format/stereotype_application.rb +33 -0
- data/lib/ea/xref_format.rb +36 -0
- data/lib/ea.rb +1 -0
- metadata +26 -25
- data/lib/ea/sources/qea/xref/legend_definition.rb +0 -35
- data/lib/ea/sources/qea/xref/parser.rb +0 -150
- data/lib/ea/sources/qea/xref/property_definition.rb +0 -29
- data/lib/ea/sources/qea/xref/record.rb +0 -41
- data/lib/ea/sources/qea/xref/stereotype_application.rb +0 -37
|
@@ -21,7 +21,7 @@ module Ea
|
|
|
21
21
|
# @param xmi_path [String] Path to XMI file
|
|
22
22
|
# @param qea_path [String] Path to QEA file
|
|
23
23
|
# @return [ComparisonResult] Verification result
|
|
24
|
-
def verify(xmi_path, qea_path)
|
|
24
|
+
def verify(xmi_path, qea_path)
|
|
25
25
|
# Parse documents
|
|
26
26
|
xmi_doc = parse_xmi(xmi_path)
|
|
27
27
|
qea_doc = parse_qea(qea_path)
|
|
@@ -87,7 +87,7 @@ module Ea
|
|
|
87
87
|
qea_enums = count_all_enums(qea_doc)
|
|
88
88
|
if qea_enums < xmi_enums
|
|
89
89
|
result.add_difference(
|
|
90
|
-
"Enums: #{xmi_enums} (XMI) vs #{qea_enums} (QEA) - QEA has fewer"
|
|
90
|
+
"Enums: #{xmi_enums} (XMI) vs #{qea_enums} (QEA) - QEA has fewer"
|
|
91
91
|
)
|
|
92
92
|
end
|
|
93
93
|
|
|
@@ -96,7 +96,7 @@ module Ea
|
|
|
96
96
|
qea_dt = count_all_data_types(qea_doc)
|
|
97
97
|
if qea_dt < xmi_dt
|
|
98
98
|
result.add_difference(
|
|
99
|
-
"Data types: #{xmi_dt} (XMI) vs #{qea_dt} (QEA) - QEA has fewer"
|
|
99
|
+
"Data types: #{xmi_dt} (XMI) vs #{qea_dt} (QEA) - QEA has fewer"
|
|
100
100
|
)
|
|
101
101
|
end
|
|
102
102
|
|
|
@@ -104,12 +104,12 @@ module Ea
|
|
|
104
104
|
xmi_assocs = count_all_associations(xmi_doc)
|
|
105
105
|
qea_assocs = count_all_associations(qea_doc)
|
|
106
106
|
result.add_matches(:associations, [xmi_assocs, qea_assocs].min)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
)
|
|
112
|
-
|
|
107
|
+
return unless qea_assocs < xmi_assocs
|
|
108
|
+
|
|
109
|
+
result.add_difference(
|
|
110
|
+
"Associations: #{xmi_assocs} (XMI) " \
|
|
111
|
+
"vs #{qea_assocs} (QEA) - QEA has fewer"
|
|
112
|
+
)
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
# Verify element names are preserved
|
|
@@ -230,7 +230,7 @@ module Ea
|
|
|
230
230
|
end
|
|
231
231
|
|
|
232
232
|
# Verify class properties
|
|
233
|
-
def verify_class_properties(matches) # rubocop:disable Metrics/AbcSize,Metrics/
|
|
233
|
+
def verify_class_properties(matches) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
234
234
|
attr_count = 0
|
|
235
235
|
op_count = 0
|
|
236
236
|
|
|
@@ -244,7 +244,7 @@ module Ea
|
|
|
244
244
|
result.add_property_difference(
|
|
245
245
|
:class,
|
|
246
246
|
qualified_name,
|
|
247
|
-
comparison[:differences]
|
|
247
|
+
comparison[:differences]
|
|
248
248
|
)
|
|
249
249
|
end
|
|
250
250
|
|
|
@@ -255,15 +255,15 @@ module Ea
|
|
|
255
255
|
attr_matches[:matches].each do |attr_name, attr_pair|
|
|
256
256
|
attr_comparison = comparator.compare_attributes(
|
|
257
257
|
attr_pair[:xmi],
|
|
258
|
-
attr_pair[:qea]
|
|
258
|
+
attr_pair[:qea]
|
|
259
|
+
)
|
|
260
|
+
next if attr_comparison[:equal]
|
|
261
|
+
|
|
262
|
+
result.add_property_difference(
|
|
263
|
+
:attribute,
|
|
264
|
+
"#{qualified_name}.#{attr_name}",
|
|
265
|
+
attr_comparison[:differences]
|
|
259
266
|
)
|
|
260
|
-
unless attr_comparison[:equal]
|
|
261
|
-
result.add_property_difference(
|
|
262
|
-
:attribute,
|
|
263
|
-
"#{qualified_name}.#{attr_name}",
|
|
264
|
-
attr_comparison[:differences],
|
|
265
|
-
)
|
|
266
|
-
end
|
|
267
267
|
end
|
|
268
268
|
|
|
269
269
|
# Compare operations
|
|
@@ -273,15 +273,15 @@ module Ea
|
|
|
273
273
|
op_matches[:matches].each do |op_sig, op_pair|
|
|
274
274
|
op_comparison = comparator.compare_operations(
|
|
275
275
|
op_pair[:xmi],
|
|
276
|
-
op_pair[:qea]
|
|
276
|
+
op_pair[:qea]
|
|
277
|
+
)
|
|
278
|
+
next if op_comparison[:equal]
|
|
279
|
+
|
|
280
|
+
result.add_property_difference(
|
|
281
|
+
:operation,
|
|
282
|
+
"#{qualified_name}.#{op_sig}",
|
|
283
|
+
op_comparison[:differences]
|
|
277
284
|
)
|
|
278
|
-
unless op_comparison[:equal]
|
|
279
|
-
result.add_property_difference(
|
|
280
|
-
:operation,
|
|
281
|
-
"#{qualified_name}.#{op_sig}",
|
|
282
|
-
op_comparison[:differences],
|
|
283
|
-
)
|
|
284
|
-
end
|
|
285
285
|
end
|
|
286
286
|
end
|
|
287
287
|
|
|
@@ -293,13 +293,13 @@ module Ea
|
|
|
293
293
|
def verify_package_properties(matches)
|
|
294
294
|
matches.each do |qualified_path, pair|
|
|
295
295
|
comparison = comparator.compare_packages(pair[:xmi], pair[:qea])
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
296
|
+
next if comparison[:equal]
|
|
297
|
+
|
|
298
|
+
result.add_property_difference(
|
|
299
|
+
:package,
|
|
300
|
+
qualified_path,
|
|
301
|
+
comparison[:differences]
|
|
302
|
+
)
|
|
303
303
|
end
|
|
304
304
|
end
|
|
305
305
|
|
|
@@ -310,11 +310,11 @@ module Ea
|
|
|
310
310
|
xmi_assocs = count_all_associations(xmi_doc)
|
|
311
311
|
qea_assocs = count_all_associations(qea_doc)
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
313
|
+
return unless qea_assocs < xmi_assocs
|
|
314
|
+
|
|
315
|
+
result.add_difference(
|
|
316
|
+
"Missing #{xmi_assocs - qea_assocs} associations in QEA"
|
|
317
|
+
)
|
|
318
318
|
end
|
|
319
319
|
end
|
|
320
320
|
end
|
|
@@ -14,9 +14,7 @@ module Ea
|
|
|
14
14
|
differences = []
|
|
15
15
|
|
|
16
16
|
# Compare basic properties
|
|
17
|
-
unless names_equal?(xmi_pkg.name, qea_pkg.name)
|
|
18
|
-
differences << "Name: '#{xmi_pkg.name}' vs '#{qea_pkg.name}'"
|
|
19
|
-
end
|
|
17
|
+
differences << "Name: '#{xmi_pkg.name}' vs '#{qea_pkg.name}'" unless names_equal?(xmi_pkg.name, qea_pkg.name)
|
|
20
18
|
|
|
21
19
|
# Compare collection counts
|
|
22
20
|
compare_collection_count(
|
|
@@ -34,7 +32,7 @@ module Ea
|
|
|
34
32
|
|
|
35
33
|
{
|
|
36
34
|
equal: differences.empty?,
|
|
37
|
-
differences: differences
|
|
35
|
+
differences: differences
|
|
38
36
|
}
|
|
39
37
|
end
|
|
40
38
|
|
|
@@ -43,7 +41,7 @@ module Ea
|
|
|
43
41
|
# @param xmi_class [Lutaml::Uml::UmlClass] XMI class
|
|
44
42
|
# @param qea_class [Lutaml::Uml::UmlClass] QEA class
|
|
45
43
|
# @return [Hash] Comparison result with :equal and :differences
|
|
46
|
-
def compare_classes(xmi_class, qea_class) # rubocop:disable Metrics/AbcSize,Metrics/
|
|
44
|
+
def compare_classes(xmi_class, qea_class) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
47
45
|
differences = []
|
|
48
46
|
|
|
49
47
|
# Compare name
|
|
@@ -64,7 +62,7 @@ module Ea
|
|
|
64
62
|
|
|
65
63
|
# Compare modifier
|
|
66
64
|
if normalize_value(xmi_class.modifier) !=
|
|
67
|
-
|
|
65
|
+
normalize_value(qea_class.modifier)
|
|
68
66
|
differences << "modifier: '#{xmi_class.modifier}' " \
|
|
69
67
|
"vs '#{qea_class.modifier}'"
|
|
70
68
|
end
|
|
@@ -81,7 +79,7 @@ module Ea
|
|
|
81
79
|
|
|
82
80
|
{
|
|
83
81
|
equal: differences.empty?,
|
|
84
|
-
differences: differences
|
|
82
|
+
differences: differences
|
|
85
83
|
}
|
|
86
84
|
end
|
|
87
85
|
|
|
@@ -100,13 +98,13 @@ module Ea
|
|
|
100
98
|
|
|
101
99
|
# Compare type
|
|
102
100
|
if normalize_value(xmi_attr.type) !=
|
|
103
|
-
|
|
101
|
+
normalize_value(qea_attr.type)
|
|
104
102
|
differences << "type: '#{xmi_attr.type}' vs '#{qea_attr.type}'"
|
|
105
103
|
end
|
|
106
104
|
|
|
107
105
|
# Compare visibility
|
|
108
106
|
if normalize_value(xmi_attr.visibility) !=
|
|
109
|
-
|
|
107
|
+
normalize_value(qea_attr.visibility)
|
|
110
108
|
differences << "visibility: '#{xmi_attr.visibility}' " \
|
|
111
109
|
"vs '#{qea_attr.visibility}'"
|
|
112
110
|
end
|
|
@@ -128,7 +126,7 @@ module Ea
|
|
|
128
126
|
|
|
129
127
|
{
|
|
130
128
|
equal: differences.empty?,
|
|
131
|
-
differences: differences
|
|
129
|
+
differences: differences
|
|
132
130
|
}
|
|
133
131
|
end
|
|
134
132
|
|
|
@@ -137,24 +135,22 @@ module Ea
|
|
|
137
135
|
# @param xmi_op [Lutaml::Uml::Operation] XMI operation
|
|
138
136
|
# @param qea_op [Lutaml::Uml::Operation] QEA operation
|
|
139
137
|
# @return [Hash] Comparison result with :equal and :differences
|
|
140
|
-
def compare_operations(xmi_op, qea_op) # rubocop:disable Metrics/AbcSize,Metrics/
|
|
138
|
+
def compare_operations(xmi_op, qea_op) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
141
139
|
differences = []
|
|
142
140
|
|
|
143
141
|
# Compare name
|
|
144
|
-
unless names_equal?(xmi_op.name, qea_op.name)
|
|
145
|
-
differences << "Name: '#{xmi_op.name}' vs '#{qea_op.name}'"
|
|
146
|
-
end
|
|
142
|
+
differences << "Name: '#{xmi_op.name}' vs '#{qea_op.name}'" unless names_equal?(xmi_op.name, qea_op.name)
|
|
147
143
|
|
|
148
144
|
# Compare return type
|
|
149
145
|
if normalize_value(xmi_op.return_type) !=
|
|
150
|
-
|
|
146
|
+
normalize_value(qea_op.return_type)
|
|
151
147
|
differences << "return_type: '#{xmi_op.return_type}' " \
|
|
152
148
|
"vs '#{qea_op.return_type}'"
|
|
153
149
|
end
|
|
154
150
|
|
|
155
151
|
# Compare visibility
|
|
156
152
|
if normalize_value(xmi_op.visibility) !=
|
|
157
|
-
|
|
153
|
+
normalize_value(qea_op.visibility)
|
|
158
154
|
differences << "visibility: '#{xmi_op.visibility}' " \
|
|
159
155
|
"vs '#{qea_op.visibility}'"
|
|
160
156
|
end
|
|
@@ -166,7 +162,7 @@ module Ea
|
|
|
166
162
|
|
|
167
163
|
{
|
|
168
164
|
equal: differences.empty?,
|
|
169
|
-
differences: differences
|
|
165
|
+
differences: differences
|
|
170
166
|
}
|
|
171
167
|
end
|
|
172
168
|
|
|
@@ -180,25 +176,25 @@ module Ea
|
|
|
180
176
|
|
|
181
177
|
# Compare owner end
|
|
182
178
|
unless normalize_value(xmi_assoc.owner_end) ==
|
|
183
|
-
|
|
179
|
+
normalize_value(qea_assoc.owner_end)
|
|
184
180
|
differences << "owner_end: '#{xmi_assoc.owner_end}' " \
|
|
185
181
|
"vs '#{qea_assoc.owner_end}'"
|
|
186
182
|
end
|
|
187
183
|
|
|
188
184
|
# Compare member end
|
|
189
185
|
unless normalize_value(xmi_assoc.member_end) ==
|
|
190
|
-
|
|
186
|
+
normalize_value(qea_assoc.member_end)
|
|
191
187
|
differences << "member_end: '#{xmi_assoc.member_end}' " \
|
|
192
188
|
"vs '#{qea_assoc.member_end}'"
|
|
193
189
|
end
|
|
194
190
|
|
|
195
191
|
# Compare owner end cardinality
|
|
196
192
|
if xmi_assoc.owner_end_cardinality &&
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
qea_assoc.owner_end_cardinality &&
|
|
194
|
+
!cardinalities_equal?(
|
|
195
|
+
xmi_assoc.owner_end_cardinality,
|
|
196
|
+
qea_assoc.owner_end_cardinality
|
|
197
|
+
)
|
|
202
198
|
differences << "owner_end_cardinality: " \
|
|
203
199
|
"#{format_cardinality(xmi_assoc
|
|
204
200
|
.owner_end_cardinality)} " \
|
|
@@ -208,11 +204,11 @@ module Ea
|
|
|
208
204
|
|
|
209
205
|
# Compare member end cardinality
|
|
210
206
|
if xmi_assoc.member_end_cardinality &&
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
207
|
+
qea_assoc.member_end_cardinality &&
|
|
208
|
+
!cardinalities_equal?(
|
|
209
|
+
xmi_assoc.member_end_cardinality,
|
|
210
|
+
qea_assoc.member_end_cardinality
|
|
211
|
+
)
|
|
216
212
|
differences << "member_end_cardinality: " \
|
|
217
213
|
"#{format_cardinality(xmi_assoc
|
|
218
214
|
.member_end_cardinality)} " \
|
|
@@ -222,7 +218,7 @@ module Ea
|
|
|
222
218
|
|
|
223
219
|
{
|
|
224
220
|
equal: differences.empty?,
|
|
225
|
-
differences: differences
|
|
221
|
+
differences: differences
|
|
226
222
|
}
|
|
227
223
|
end
|
|
228
224
|
|
|
@@ -242,7 +238,7 @@ module Ea
|
|
|
242
238
|
end
|
|
243
239
|
|
|
244
240
|
# Compare collection counts
|
|
245
|
-
def compare_collection_count(xmi_coll, qea_coll, name, differences)
|
|
241
|
+
def compare_collection_count(xmi_coll, qea_coll, name, differences)
|
|
246
242
|
xmi_count = xmi_coll&.size || 0
|
|
247
243
|
qea_count = qea_coll&.size || 0
|
|
248
244
|
|
|
@@ -63,14 +63,14 @@ module Ea
|
|
|
63
63
|
packages: build_package_index(document.packages),
|
|
64
64
|
classes: build_class_index(document),
|
|
65
65
|
enums: build_enum_index(document),
|
|
66
|
-
data_types: build_data_type_index(document)
|
|
66
|
+
data_types: build_data_type_index(document)
|
|
67
67
|
}
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
private
|
|
71
71
|
|
|
72
72
|
# Build package index with qualified paths
|
|
73
|
-
def build_package_index(packages, parent_path = "")
|
|
73
|
+
def build_package_index(packages, parent_path = "")
|
|
74
74
|
index = {}
|
|
75
75
|
return index unless packages
|
|
76
76
|
|
|
@@ -89,7 +89,7 @@ module Ea
|
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
# Build class index from document and packages
|
|
92
|
-
def build_class_index(document)
|
|
92
|
+
def build_class_index(document)
|
|
93
93
|
index = {}
|
|
94
94
|
|
|
95
95
|
# Index top-level classes
|
|
@@ -109,7 +109,7 @@ module Ea
|
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
# Recursively index classes in packages
|
|
112
|
-
def index_classes_in_packages(packages, parent_path, index) # rubocop:disable Metrics/
|
|
112
|
+
def index_classes_in_packages(packages, parent_path, index) # rubocop:disable Metrics/MethodLength
|
|
113
113
|
return unless packages
|
|
114
114
|
|
|
115
115
|
packages.each do |package|
|
|
@@ -130,7 +130,7 @@ module Ea
|
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
# Build enum index from document and packages
|
|
133
|
-
def build_enum_index(document)
|
|
133
|
+
def build_enum_index(document)
|
|
134
134
|
index = {}
|
|
135
135
|
|
|
136
136
|
# Index top-level enums
|
|
@@ -150,7 +150,7 @@ module Ea
|
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
# Recursively index enums in packages
|
|
153
|
-
def index_enums_in_packages(packages, parent_path, index) # rubocop:disable Metrics/
|
|
153
|
+
def index_enums_in_packages(packages, parent_path, index) # rubocop:disable Metrics/MethodLength
|
|
154
154
|
return unless packages
|
|
155
155
|
|
|
156
156
|
packages.each do |package|
|
|
@@ -171,7 +171,7 @@ module Ea
|
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
# Build data type index from document and packages
|
|
174
|
-
def build_data_type_index(document)
|
|
174
|
+
def build_data_type_index(document)
|
|
175
175
|
index = {}
|
|
176
176
|
|
|
177
177
|
# Index top-level data types
|
|
@@ -191,7 +191,7 @@ module Ea
|
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
# Recursively index data types in packages
|
|
194
|
-
def index_data_types_in_packages(packages, parent_path, index) # rubocop:disable Metrics/
|
|
194
|
+
def index_data_types_in_packages(packages, parent_path, index) # rubocop:disable Metrics/MethodLength
|
|
195
195
|
return unless packages
|
|
196
196
|
|
|
197
197
|
packages.each do |package|
|
|
@@ -263,7 +263,7 @@ module Ea
|
|
|
263
263
|
if qea_index.key?(key)
|
|
264
264
|
matches[key] = {
|
|
265
265
|
xmi: xmi_element,
|
|
266
|
-
qea: qea_index[key]
|
|
266
|
+
qea: qea_index[key]
|
|
267
267
|
}
|
|
268
268
|
else
|
|
269
269
|
xmi_only << key
|
|
@@ -278,7 +278,7 @@ module Ea
|
|
|
278
278
|
{
|
|
279
279
|
matches: matches,
|
|
280
280
|
xmi_only: xmi_only.sort,
|
|
281
|
-
qea_only: qea_only.sort
|
|
281
|
+
qea_only: qea_only.sort
|
|
282
282
|
}
|
|
283
283
|
end
|
|
284
284
|
end
|
data/lib/ea/qea.rb
CHANGED
|
@@ -24,9 +24,7 @@ module Ea
|
|
|
24
24
|
# Set a custom configuration
|
|
25
25
|
#
|
|
26
26
|
# @param config [Services::Configuration] The configuration to use
|
|
27
|
-
|
|
28
|
-
@configuration = config
|
|
29
|
-
end
|
|
27
|
+
attr_writer :configuration
|
|
30
28
|
|
|
31
29
|
# Reload configuration from file
|
|
32
30
|
#
|
|
@@ -66,7 +64,7 @@ module Ea
|
|
|
66
64
|
reader = Infrastructure::SchemaReader.new(db)
|
|
67
65
|
{
|
|
68
66
|
tables: reader.tables,
|
|
69
|
-
statistics: reader.statistics
|
|
67
|
+
statistics: reader.statistics
|
|
70
68
|
}
|
|
71
69
|
end
|
|
72
70
|
ensure
|
|
@@ -127,7 +125,7 @@ module Ea
|
|
|
127
125
|
# @return [Lutaml::Uml::Document, Hash] Document, or hash with
|
|
128
126
|
# :document and :validation_result
|
|
129
127
|
# @raise [Ea::Error] if lutaml-uml is not available
|
|
130
|
-
def parse(qea_path, options = {}) # rubocop:disable Metrics/
|
|
128
|
+
def parse(qea_path, options = {}) # rubocop:disable Metrics/MethodLength
|
|
131
129
|
require_uml!
|
|
132
130
|
config = options.delete(:config)
|
|
133
131
|
validate = options.delete(:validate)
|
|
@@ -143,13 +141,13 @@ module Ea
|
|
|
143
141
|
engine = Validation::ValidationEngine.new(
|
|
144
142
|
document,
|
|
145
143
|
database: ea_database,
|
|
146
|
-
**options
|
|
144
|
+
**options
|
|
147
145
|
)
|
|
148
146
|
validation_result = engine.validate
|
|
149
147
|
|
|
150
148
|
{
|
|
151
149
|
document: document,
|
|
152
|
-
validation_result: validation_result
|
|
150
|
+
validation_result: validation_result
|
|
153
151
|
}
|
|
154
152
|
else
|
|
155
153
|
document
|
data/lib/ea/query/builder.rb
CHANGED
|
@@ -103,9 +103,9 @@ module Ea
|
|
|
103
103
|
|
|
104
104
|
xrefs.select do |xr|
|
|
105
105
|
xr.client == object.ea_guid && xr.description&.include?("@STEREO")
|
|
106
|
-
end.
|
|
107
|
-
xr.description
|
|
108
|
-
end
|
|
106
|
+
end.filter_map do |xr|
|
|
107
|
+
Ea::XrefFormat.stereotype_name(xr.description)
|
|
108
|
+
end
|
|
109
109
|
end
|
|
110
110
|
private :stereotype_names_for
|
|
111
111
|
|
|
@@ -51,9 +51,11 @@ module Ea
|
|
|
51
51
|
|
|
52
52
|
def convert(svg_path, target)
|
|
53
53
|
converter = self.class.available_converter
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
unless converter
|
|
55
|
+
raise Ea::Cli::Error,
|
|
56
|
+
"No SVG→#{target.upcase} converter available. " \
|
|
57
|
+
"Install rsvg-convert (librsvg) or ImageMagick."
|
|
58
|
+
end
|
|
57
59
|
|
|
58
60
|
with_tempfile(".#{target}") do |out_path|
|
|
59
61
|
run_converter(converter, svg_path, out_path, target)
|
|
@@ -43,8 +43,8 @@ module Ea
|
|
|
43
43
|
|
|
44
44
|
def tokenize(source)
|
|
45
45
|
clean = source.gsub(%r{//[^\n]*}, "")
|
|
46
|
-
.gsub(
|
|
47
|
-
clean.scan(
|
|
46
|
+
.gsub(%r{/\*.*?\*/}m, "")
|
|
47
|
+
clean.scan(%r{[A-Za-z_][A-Za-z0-9_]*|-?\d+\.?\d*|"[^"]*"|'[^']*'|[{}(),;=+\-*/]})
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
# Consume statements until matching close brace or end.
|
|
@@ -99,7 +99,7 @@ module Ea
|
|
|
99
99
|
Shape.new(kind: kind, params: params)
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
def consume_label(tokens,
|
|
102
|
+
def consume_label(tokens, _env)
|
|
103
103
|
tokens.shift # "("
|
|
104
104
|
text = tokens.shift
|
|
105
105
|
text = text.to_s.gsub(/\A["']|["']\z/, "")
|
|
@@ -111,7 +111,7 @@ module Ea
|
|
|
111
111
|
|
|
112
112
|
def consume_var_decl(tokens, env)
|
|
113
113
|
name = tokens.shift
|
|
114
|
-
|
|
114
|
+
tokens.shift # "="
|
|
115
115
|
value = resolve_expr(tokens.shift, tokens, env)
|
|
116
116
|
consume_semicolon(tokens)
|
|
117
117
|
env[name] = value if value.is_a?(Numeric) || value.is_a?(String)
|
|
@@ -103,8 +103,8 @@ module Ea
|
|
|
103
103
|
operations: OperationBuilder.new(database).build_all_for(object),
|
|
104
104
|
stereotype_refs: stereotype_refs_for(object),
|
|
105
105
|
tagged_values: TaggedValueBuilder.new(database)
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
.for_object(object.ea_guid,
|
|
107
|
+
ea_object_id: object.ea_object_id),
|
|
108
108
|
constraints: constraints_for(object),
|
|
109
109
|
annotations: AnnotationBuilder.from_note(object.note, object.ea_guid,
|
|
110
110
|
kind: "documentation")
|
|
@@ -188,7 +188,11 @@ module Ea
|
|
|
188
188
|
|
|
189
189
|
s = card_str.to_s
|
|
190
190
|
parts = s.split("..")
|
|
191
|
-
val = bound == :lower
|
|
191
|
+
val = if bound == :lower
|
|
192
|
+
parts.first
|
|
193
|
+
else
|
|
194
|
+
(parts.size > 1 ? parts.last : parts.first)
|
|
195
|
+
end
|
|
192
196
|
val = val.to_s.strip
|
|
193
197
|
return -1 if val == "*"
|
|
194
198
|
|
|
@@ -135,8 +135,8 @@ module Ea
|
|
|
135
135
|
|
|
136
136
|
def focal_element_id(diagram_row, database, placed_ids)
|
|
137
137
|
focal_name = diagram_row.name.to_s
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
.sub(/\AContext [Dd]iagram:\s*/, "")
|
|
139
|
+
.strip
|
|
140
140
|
focal = (database.diagram_objects_for(diagram_row.diagram_id) || [])
|
|
141
141
|
.select do |placement|
|
|
142
142
|
obj = database.find_object(placement.ea_object_id.to_i)
|
|
@@ -1292,17 +1292,17 @@ module Ea
|
|
|
1292
1292
|
v_gap = v_dir = h_gap = h_dir = nil
|
|
1293
1293
|
if src.y >= tgt.y + tgt.height
|
|
1294
1294
|
v_gap = src.y - (tgt.y + tgt.height)
|
|
1295
|
-
v_dir = [
|
|
1295
|
+
v_dir = %i[t b]
|
|
1296
1296
|
elsif tgt.y >= src.y + src.height
|
|
1297
1297
|
v_gap = tgt.y - (src.y + src.height)
|
|
1298
|
-
v_dir = [
|
|
1298
|
+
v_dir = %i[b t]
|
|
1299
1299
|
end
|
|
1300
1300
|
if src.x >= tgt.x + tgt.width
|
|
1301
1301
|
h_gap = src.x - (tgt.x + tgt.width)
|
|
1302
|
-
h_dir = [
|
|
1302
|
+
h_dir = %i[l r]
|
|
1303
1303
|
elsif tgt.x >= src.x + src.width
|
|
1304
1304
|
h_gap = tgt.x - (tgt.x + tgt.width)
|
|
1305
|
-
h_dir = [
|
|
1305
|
+
h_dir = %i[r l]
|
|
1306
1306
|
end
|
|
1307
1307
|
return points if v_gap.nil? && h_gap.nil?
|
|
1308
1308
|
|