lutaml 0.9.37 → 0.9.39
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/lutaml/version.rb +1 -1
- data/lib/lutaml/xmi/liquid_drops/attribute_drop.rb +1 -1
- data/lib/lutaml/xmi/liquid_drops/enum_drop.rb +4 -0
- data/lib/lutaml/xmi/liquid_drops/klass_drop.rb +20 -3
- data/lib/lutaml/xmi/parsers/xmi_base.rb +26 -0
- data/lib/lutaml/xmi/parsers/xml.rb +2 -0
- 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: c2fb018969e853897d9a564b6352677064c33c40aa81127c8085633a07aa6574
|
4
|
+
data.tar.gz: 8b6aef0e65b2ecc29158aaacc4b0b2f53b6101142930f429d3489a839bef557b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09f484c39c25ac9952b09e4c5d0463086823b19d2eb89f5b485a7eaff6582e028fee220d6b82a4215cb3cf2b2620613f4b4a02255799edc34ef910564eff32c1'
|
7
|
+
data.tar.gz: 5ed8da4c25558b31dce1a444ca7bf444549508e612e4d00d3250aecba369eccb72a9e6483c8115926166dae660c0ec84d57ad7be2702f5f3e478477666509c21
|
data/lib/lutaml/version.rb
CHANGED
@@ -25,7 +25,8 @@ module Lutaml
|
|
25
25
|
e.idref == @model.id
|
26
26
|
end
|
27
27
|
|
28
|
-
@
|
28
|
+
@clients_dependencies = select_dependencies_by_supplier(@model.id)
|
29
|
+
@suppliers_dependencies = select_dependencies_by_client(@model.id)
|
29
30
|
|
30
31
|
@inheritance_ids = @matched_element&.links&.map do |link|
|
31
32
|
link.generalization.select do |gen|
|
@@ -83,8 +84,14 @@ module Lutaml
|
|
83
84
|
end.compact
|
84
85
|
end
|
85
86
|
|
86
|
-
def
|
87
|
-
@
|
87
|
+
def suppliers_dependencies
|
88
|
+
@suppliers_dependencies.map do |dependency|
|
89
|
+
::Lutaml::XMI::DependencyDrop.new(dependency, @options)
|
90
|
+
end.compact
|
91
|
+
end
|
92
|
+
|
93
|
+
def clients_dependencies
|
94
|
+
@clients_dependencies.map do |dependency|
|
88
95
|
::Lutaml::XMI::DependencyDrop.new(dependency, @options)
|
89
96
|
end.compact
|
90
97
|
end
|
@@ -172,6 +179,16 @@ module Lutaml
|
|
172
179
|
end
|
173
180
|
end
|
174
181
|
|
182
|
+
def upper_packaged_element
|
183
|
+
if @options[:with_gen]
|
184
|
+
find_upper_level_packaged_element(@model.id)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def subtype_of
|
189
|
+
find_subtype_of(@model.id)
|
190
|
+
end
|
191
|
+
|
175
192
|
def has_guidance?
|
176
193
|
!!@klass_guidance
|
177
194
|
end
|
@@ -297,6 +297,23 @@ module Lutaml
|
|
297
297
|
@upper_level_cache[klass_id]
|
298
298
|
end
|
299
299
|
|
300
|
+
def find_subtype_of(id) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
301
|
+
@pkg_elements_owned_attributes ||= all_packaged_elements.map do |e|
|
302
|
+
{
|
303
|
+
name: e.name,
|
304
|
+
idrefs: e&.owned_attribute&.map do |oa|
|
305
|
+
oa&.uml_type&.idref
|
306
|
+
end || [],
|
307
|
+
}
|
308
|
+
end
|
309
|
+
|
310
|
+
result = @pkg_elements_owned_attributes.find do |e|
|
311
|
+
e[:idrefs].include?(id)
|
312
|
+
end
|
313
|
+
|
314
|
+
result[:name] if result
|
315
|
+
end
|
316
|
+
|
300
317
|
# Build cache once for all packaged elements
|
301
318
|
def build_upper_level_cache
|
302
319
|
@upper_level_cache = {}
|
@@ -396,6 +413,15 @@ module Lutaml
|
|
396
413
|
end
|
397
414
|
end
|
398
415
|
|
416
|
+
# @param supplier_id [String]
|
417
|
+
# @return [Lutaml::Model::Serializable]
|
418
|
+
def select_dependencies_by_client(client_id)
|
419
|
+
all_packaged_elements.select do |e|
|
420
|
+
e.client == client_id &&
|
421
|
+
e.type?("uml:Dependency")
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
399
425
|
# @param name [String]
|
400
426
|
# @return [Lutaml::Model::Serializable]
|
401
427
|
def find_packaged_element_by_name(name)
|
@@ -146,6 +146,7 @@ module Lutaml
|
|
146
146
|
with_gen: true,
|
147
147
|
with_absolute_path: true,
|
148
148
|
}
|
149
|
+
puts "Error: Class not found for name: #{name}!" if klass.nil?
|
149
150
|
::Lutaml::XMI::KlassDrop.new(
|
150
151
|
klass,
|
151
152
|
guidance,
|
@@ -168,6 +169,7 @@ module Lutaml
|
|
168
169
|
with_gen: true,
|
169
170
|
with_absolute_path: true,
|
170
171
|
}
|
172
|
+
puts "Error: Enumeration not found for name: #{name}!" if enum.nil?
|
171
173
|
::Lutaml::XMI::EnumDrop.new(enum, options)
|
172
174
|
end
|
173
175
|
end
|
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.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: expressir
|