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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4db5dffc542b1571b200b43d83253caafa1f90cd67aec5ece16af26a31ac5f8b
4
- data.tar.gz: 9e12f4317fb3a5690d5475ebec249cbafa92de81d1f813845438062dfd51083d
3
+ metadata.gz: 6cdc354ae49059f9158e3bfb8d0e7813b6c61d0084fa42ed7071026a9e62d311
4
+ data.tar.gz: 30c6683d8e22d2e1ded1b8ca53d3d63e5129025049314b036b678efb611f713e
5
5
  SHA512:
6
- metadata.gz: 2e15272b553e564a0432e758d56e00cae2c79a8c8e166615812ad5e05004b9c5fe2e33a667d6910ffd6fc1156365fed895d1aa2c4412da4892511edd324c0785
7
- data.tar.gz: 16281e22ee7b86fba771f7eee75455bfcd175c0ac4af02ecdda5538bd75a63ecaaa71cbdfde4e5815f5d5a15db1bbf11be5d129fd71285d3219cc4702d9c4561
6
+ metadata.gz: 1578a3589e20f92586cf4a60a6585ce5b758262a1112e3e5598e33c3209de72d477bf66b0fefd017e4633bd065ef93ed3fe37e2b55f60aae50a78203f299bcfa
7
+ data.tar.gz: 72883f24b869448ac32f8724cb05cd5d24acf88ecbaa066bf084724f57ac116567266257f317b0e284e8ab081519eae6d8a2108915fb4e680076990b43339576
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.9.7".freeze
2
+ VERSION = "0.9.9".freeze
3
3
  end
@@ -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 = sparx_root.from_xml(xml_content)
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
- lookup_entity_name(xmi_id) ||
350
- connector_name_by_source_or_target(xmi_id, source_or_target)
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", ">= 0.3.8"
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.7
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-07-19 00:00:00.000000000 Z
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.8
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.8
124
+ version: 0.3.10
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: byebug
127
127
  requirement: !ruby/object:Gem::Requirement