lutaml 0.9.25 → 0.9.26

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: d137d5be60e06ea2c41de5764075acf098b35a1904971368c8354712be92fe8c
4
- data.tar.gz: d1f6ed60c34193f7cbf0a086fb9cd9546dce0c7764452c001c31f60ae3aaee88
3
+ metadata.gz: 63135b601a74ae7525807e9b57974a2db686e49f6e6992918e7d209bdbf27460
4
+ data.tar.gz: 529878c2d79c6f35130ef8c34eb5223d16c46a10f96cf470e43c8563457491a8
5
5
  SHA512:
6
- metadata.gz: d6d543f0b65233b2e87c6285a55b3fc44812a1cb71387fd23212ee24338c1cc2e6b8e8c1f39d5458dc644c8d00b3ad07e87d378eac591fe2a0aad0fbfa021db8
7
- data.tar.gz: a6f1a7f760d9db443d9a8e317e7e83b1b66c1a5209758927803a3a3027d7eeb9260ecc0a73852a51bc9b1ae26a33aeb698891baecdf3a32ed5d449d20595ae8b
6
+ metadata.gz: e70e2318f24f4a6c6beccdd8c6db99f8674ab92b7763a398ffc3b2617b6a44b2ef2b431fa039d5cabe58719d7660c96f2bde96c3dc8ecfc9fd904de7ac025cc9
7
+ data.tar.gz: 61f20ab2448dfaf836a698b1596ec0685f3d90380bcf2829e08ebda2f7b39dffddb9b0913609ccb682df77a66d2ada3f69e90071556a422a973eda5784942732
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.9.25".freeze
2
+ VERSION = "0.9.26".freeze
3
3
  end
@@ -18,6 +18,14 @@ module Lutaml
18
18
  def definition
19
19
  @model[:definition]
20
20
  end
21
+
22
+ def package_id
23
+ @model[:package_id]
24
+ end
25
+
26
+ def package_name
27
+ @model[:package_name]
28
+ end
21
29
  end
22
30
  end
23
31
  end
@@ -154,7 +154,7 @@ module Lutaml
154
154
  absolute_path = "#{absolute_path}::#{model.name}"
155
155
  end
156
156
 
157
- packages.map do |package|
157
+ packages.map do |package| # rubocop:disable Metrics/BlockLength
158
158
  h = {
159
159
  xmi_id: package.id,
160
160
  name: get_package_name(package),
@@ -166,7 +166,10 @@ module Lutaml
166
166
  ),
167
167
  enums: serialize_model_enums(package),
168
168
  data_types: serialize_model_data_types(package),
169
- diagrams: serialize_model_diagrams(package.id),
169
+ diagrams: serialize_model_diagrams(
170
+ package.id,
171
+ with_package: with_gen,
172
+ ),
170
173
  packages: serialize_model_packages(
171
174
  package,
172
175
  with_gen: with_gen,
@@ -508,17 +511,25 @@ module Lutaml
508
511
  # @param node_id [String]
509
512
  # @return [Array<Hash>]
510
513
  # @note xpath %(//diagrams/diagram/model[@package="#{node['xmi:id']}"])
511
- def serialize_model_diagrams(node_id)
514
+ def serialize_model_diagrams(node_id, with_package: false) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
512
515
  diagrams = @xmi_root_model.extension.diagrams.diagram.select do |d|
513
516
  d.model.package == node_id
514
517
  end
515
518
 
516
519
  diagrams.map do |diagram|
517
- {
520
+ h = {
518
521
  xmi_id: diagram.id,
519
522
  name: diagram.properties.name,
520
523
  definition: diagram.properties.documentation,
521
524
  }
525
+
526
+ if with_package
527
+ package_id = diagram.model.package
528
+ h[:package_id] = package_id
529
+ h[:package_name] = find_packaged_element_by_id(package_id)&.name
530
+ end
531
+
532
+ h
522
533
  end
523
534
  end
524
535
 
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.25
4
+ version: 0.9.26
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: 2024-11-21 00:00:00.000000000 Z
11
+ date: 2025-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expressir
@@ -411,7 +411,7 @@ metadata:
411
411
  source_code_uri: https://github.com/lutaml/lutaml
412
412
  changelog_uri: https://github.com/lutaml/lutaml/releases
413
413
  rubygems_mfa_required: 'true'
414
- post_install_message:
414
+ post_install_message:
415
415
  rdoc_options: []
416
416
  require_paths:
417
417
  - lib
@@ -427,7 +427,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
427
427
  version: '0'
428
428
  requirements: []
429
429
  rubygems_version: 3.3.27
430
- signing_key:
430
+ signing_key:
431
431
  specification_version: 4
432
432
  summary: 'LutaML: data models in textual form'
433
433
  test_files: []