metanorma-plugin-lutaml 0.7.13 → 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: 0270f7d18a587b6569572dc7dc21fffe4e10939e32fe8ffcfa8e86888e1e772d
4
- data.tar.gz: e1a826c03cbb78311eff5143b7ca41b9ce7e4a0ae0c55afd1fb31682ccec02b4
3
+ metadata.gz: fd66711f9da2a1623acfdb2b6b24d2cea272b6d318cf17dbbdc0167cf69738c2
4
+ data.tar.gz: 5bd65ea93f25f27e57902389acc574ceb62105ab68a24ab4a44de22e88a9081d
5
5
  SHA512:
6
- metadata.gz: 12e9e15833fa38b735f7caae2c3e6686c65e42872a38303a866268d74510e16d7a2296107c146f539dff5b6183c65fc35e5bdbca460736594c2653edd7c2abe3
7
- data.tar.gz: b09e732cdde35ab5da7638245480647fe543394509ed416fe8a9d09a2e3fec12620395210975b39428d7b986ad0268f45f7c6dfbe2a33b1d39cee990b052588f
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,7 +415,7 @@ 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
 
397
- * `guidance="/path/to/my_guidance.yml"`specifies the path of
418
+ * `guidance="/path/to/my_guidance.yml"` specifies the path of
398
419
  the yaml file of the guidance. (Optional)
399
420
 
400
421
  The guidance file should be in the following format:
@@ -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.13".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.13
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-11-05 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