metanorma-plugin-lutaml 0.7.12 → 0.7.14

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: '0689b02dd3b4eb11afb1e06d187a5426ef392742efe7b01240d031a3178c136c'
4
- data.tar.gz: 61c1b2d7010f98036cb33bd7b6935a1ff0368ff2a04a0ecc9849a1a853e60c96
3
+ metadata.gz: fd66711f9da2a1623acfdb2b6b24d2cea272b6d318cf17dbbdc0167cf69738c2
4
+ data.tar.gz: 5bd65ea93f25f27e57902389acc574ceb62105ab68a24ab4a44de22e88a9081d
5
5
  SHA512:
6
- metadata.gz: 2a5852495aac28cfa9c034949fee1a4a5b28eefb1ebe10fdd576cfd4e1fa8a4e1a324b9b4cedc85c6db9a1103cedb2f98c3e649156a1e400a6ce0a441bbefe66
7
- data.tar.gz: ca4ec34bebfcc583c22fdeb95504a73dd81fd426768e6b0a0ed22c7f9072344de39e520a94d2c7938be02623cb8ca108b2eafcf1ad77cfdf7195e50a7a4691cd
6
+ metadata.gz: bc2223f766f4edf63c2cbf69a487306f2575d5448960a56a92f53a5b4fdf712d4c8246ca7bfc48d26b72bec4d054c3266c6eb504f181261490a3cc67770a9c6a
7
+ data.tar.gz: 681b2571df350dd559241c0047b0a618a083bfc9d52f9b3dc8adf5dc67925b0ab07b9fdf21aa789ae895325edc14adadae2c83c384ad036f2674864e4315b2aa
data/README.adoc CHANGED
@@ -386,7 +386,28 @@ The command accepts the options listed below:
386
386
 
387
387
  * `/path/to/example.xmi` specifies the path of xmi file.
388
388
 
389
- * `name="NameOfClass"` specifies the name of the Class.
389
+ * `name` option only, `name` option with `package` option or `path` option.
390
+ One of 3 forms of options can be used to specify the name of the class.
391
+
392
+ ** `name="NameOfClass"` specifies the name of the `class`.
393
+ (e.g. `name="Building"`)
394
+ If there are multiple classes with the same name, other form of options
395
+ are recommended to specify the class.
396
+
397
+ ** `package="NameOfPackage"name="NameOfClass"` specifies the name of the
398
+ `class` (specified by `name` option) inside the `package`
399
+ (specified by `package` option).
400
+ The `package` option must be used with the `name` option.
401
+ (e.g. `package="uro",name="_BoundarySurface"`)
402
+
403
+ ** `path="PathOfClass"` specifies the `absolute` path of the `class`
404
+ which is started with `::`
405
+ (e.g. `path="::EA_Model::Conceptual Models::i-UR::Urban Planning ADE 3.
406
+ 1::uro::_BoundarySurface"`)
407
+ or `relative` path of the `class` which is not started with `::`
408
+ (e.g. `path="uro::_BoundarySurface"`).
409
+ The last part of the path separated by `::` is the name of the `class`.
410
+ The other parts of the path are the names of the `packages`.
390
411
 
391
412
  * `template="/path/to/templates/_my_klass_table.liquid"` specifies the path of
392
413
  the liquid template. (Optional)
@@ -394,6 +415,29 @@ The command accepts the options listed below:
394
415
  `lib/metanorma/plugin/lutaml/templates`. This template can be customized by
395
416
  changing the template path in the `template` option.
396
417
 
418
+ * `guidance="/path/to/my_guidance.yml"` specifies the path of
419
+ the yaml file of the guidance. (Optional)
420
+
421
+ The guidance file should be in the following format:
422
+
423
+ [source,yaml]
424
+ ----
425
+ ---
426
+ classes:
427
+ - name: Name Of Class
428
+ attributes:
429
+ - name: Name Of Attribute (e.g. gml:boundedBy)
430
+ used: false
431
+ guidance: |
432
+ Drop guidance message here.
433
+ ...
434
+ ----
435
+
436
+ If you want to define the guidance, you can define the `name` of the class
437
+ under `classes`. Then define which `attributes` you want to add guidance by the
438
+ `name`. Set `used` to show the attribute is used or not. Drop the message of
439
+ guidance in `guidance`.
440
+
397
441
  === Generating UML class and attributes: `lutaml_uml_class`
398
442
 
399
443
  This command allows rendering a definition clause for a UML class.
@@ -853,6 +897,19 @@ By:
853
897
  ...
854
898
  -----
855
899
 
900
+ You can define guidance in the configuration file as well. The configuration
901
+ file will looks like:
902
+
903
+ [source,yaml]
904
+ -----
905
+ packages:
906
+ - my_package
907
+ guidance: "path/to/guidance.yaml"
908
+ -----
909
+
910
+ Please refer to `lutaml_klass_table` section for how to configure the guidance
911
+ yaml file.
912
+
856
913
  == Documentation
857
914
 
858
915
  Please refer to https://www.metanorma.org.
@@ -28,8 +28,16 @@ module Metanorma
28
28
  )
29
29
  end
30
30
 
31
+ path = if !attrs["path"].nil?
32
+ attrs["path"]
33
+ elsif !attrs["package"].nil? && !attrs["name"].nil?
34
+ "#{attrs['package']}::#{attrs['name']}"
35
+ else
36
+ attrs["name"]
37
+ end
38
+
31
39
  klass = ::Lutaml::XMI::Parsers::XML.serialize_generalization_by_name(
32
- xmi_path, attrs["name"], attrs["guidance"]
40
+ xmi_path, path, attrs["guidance"]
33
41
  )
34
42
 
35
43
  render(klass, parent, attrs)
@@ -1,7 +1,7 @@
1
1
  module Metanorma
2
2
  module Plugin
3
3
  module Lutaml
4
- VERSION = "0.7.12".freeze
4
+ VERSION = "0.7.14".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plugin-lutaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12
4
+ version: 0.7.14
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-10-22 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor