lutaml 0.9.7 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lutaml/version.rb +1 -1
- data/lib/lutaml/xmi/parsers/xml.rb +17 -16
- data/lutaml.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cdc354ae49059f9158e3bfb8d0e7813b6c61d0084fa42ed7071026a9e62d311
|
4
|
+
data.tar.gz: 30c6683d8e22d2e1ded1b8ca53d3d63e5129025049314b036b678efb611f713e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1578a3589e20f92586cf4a60a6585ce5b758262a1112e3e5598e33c3209de72d477bf66b0fefd017e4633bd065ef93ed3fe37e2b55f60aae50a78203f299bcfa
|
7
|
+
data.tar.gz: 72883f24b869448ac32f8724cb05cd5d24acf88ecbaa066bf084724f57ac116567266257f317b0e284e8ab081519eae6d8a2108915fb4e680076990b43339576
|
data/lib/lutaml/version.rb
CHANGED
@@ -20,15 +20,8 @@ module Lutaml
|
|
20
20
|
# @param options [Hash] options for parsing
|
21
21
|
# @return [Lutaml::Uml::Document]
|
22
22
|
def self.parse(xml, _options = {})
|
23
|
-
sparx_root = Xmi::Sparx::SparxRoot
|
24
|
-
xmi_doc = Nokogiri::XML(File.read(xml))
|
25
|
-
namespace = xmi_doc.at_xpath("//xmi:XMI").namespaces
|
26
|
-
if namespace["xmlns:uml"].split("/").last == "20131001"
|
27
|
-
sparx_root = Xmi::Sparx::SparxRoot2013
|
28
|
-
end
|
29
|
-
|
30
23
|
xml_content = File.read(xml)
|
31
|
-
xmi_model =
|
24
|
+
xmi_model = Xmi::Sparx::SparxRoot.parse_xml(xml_content)
|
32
25
|
new.parse(xmi_model)
|
33
26
|
end
|
34
27
|
|
@@ -337,17 +330,26 @@ module Lutaml
|
|
337
330
|
source_or_target = :target
|
338
331
|
end
|
339
332
|
|
340
|
-
member_end = member_end_name(xmi_id, source_or_target)
|
333
|
+
member_end = member_end_name(xmi_id, source_or_target, link.name)
|
341
334
|
[member_end, xmi_id]
|
342
335
|
end
|
343
336
|
|
344
337
|
# @param xmi_id [String]
|
345
338
|
# @param source_or_target [Symbol]
|
346
339
|
# @return [String]
|
347
|
-
def member_end_name(xmi_id, source_or_target)
|
348
|
-
connector_labels(xmi_id, source_or_target)
|
349
|
-
|
350
|
-
|
340
|
+
def member_end_name(xmi_id, source_or_target, link_name)
|
341
|
+
connector_label = connector_labels(xmi_id, source_or_target)
|
342
|
+
entity_name = lookup_entity_name(xmi_id)
|
343
|
+
connector_name = connector_name_by_source_or_target(
|
344
|
+
xmi_id, source_or_target
|
345
|
+
)
|
346
|
+
|
347
|
+
case link_name
|
348
|
+
when "Aggregation"
|
349
|
+
connector_label || entity_name || connector_name
|
350
|
+
else
|
351
|
+
entity_name || connector_name
|
352
|
+
end
|
351
353
|
end
|
352
354
|
|
353
355
|
# @param owner_xmi_id [String]
|
@@ -409,7 +411,7 @@ module Lutaml
|
|
409
411
|
source_or_target = :target
|
410
412
|
end
|
411
413
|
|
412
|
-
member_end = member_end_name(xmi_id, source_or_target)
|
414
|
+
member_end = member_end_name(xmi_id, source_or_target, link.name)
|
413
415
|
|
414
416
|
member_end_cardinality, _member_end_attribute_name =
|
415
417
|
fetch_owned_attribute_node(xmi_id)
|
@@ -621,8 +623,7 @@ module Lutaml
|
|
621
623
|
def select_all_packaged_elements(all_elements, model, type)
|
622
624
|
select_all_items(all_elements, model, type, :packaged_element)
|
623
625
|
all_elements.delete_if do |e|
|
624
|
-
!e.is_a?(Xmi::Uml::PackagedElement)
|
625
|
-
!e.is_a?(Xmi::Uml::PackagedElement2013)
|
626
|
+
!e.is_a?(Xmi::Uml::PackagedElement)
|
626
627
|
end
|
627
628
|
end
|
628
629
|
|
data/lutaml.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_runtime_dependency "parslet", "~> 2.0.0"
|
37
37
|
spec.add_runtime_dependency "ruby-graphviz", "~> 1.2"
|
38
38
|
spec.add_runtime_dependency "thor", "~> 1.0"
|
39
|
-
spec.add_runtime_dependency "xmi", "
|
39
|
+
spec.add_runtime_dependency "xmi", "~> 0.3.10"
|
40
40
|
|
41
41
|
spec.add_development_dependency "byebug"
|
42
42
|
spec.add_development_dependency "equivalent-xml", "~> 0.6.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lutaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: expressir
|
@@ -112,16 +112,16 @@ dependencies:
|
|
112
112
|
name: xmi
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.3.
|
117
|
+
version: 0.3.10
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.3.
|
124
|
+
version: 0.3.10
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: byebug
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|