metanorma-plugin-lutaml 0.7.28 → 0.7.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54d77b60de59ac664edec38812678d7ebd0c994afaf9f7d4ef60a7bad36046bf
4
- data.tar.gz: fd77fded1a6aae8ecfcf2b3b15b0389e3ee74e785a5f181050e027c4b5720f37
3
+ metadata.gz: 3dd121eb5e209d2e11649e523ca637ec20c13776fc487a06b0f6f5c1bd0a6cfd
4
+ data.tar.gz: f6116b75a333054a2e5a9a39dbdafc558d8a4da566810dd75f9fe573beba56fc
5
5
  SHA512:
6
- metadata.gz: ebfe9b260d0a4630bbf8a3c41ca70b998f5c23be260e494f53adc02e0ec29521cf4fcb18e436147823b4854a1a8a2c6020b9ca1116be22086b55855e95d44b38
7
- data.tar.gz: 73404de51765b8f5190de28ede422d3f9c398029d49f43071b1e5ec53c297a7f06ce3adecfaa6b7050529da677cef5e38d51488f11a63d07f5f13ae733c251f4
6
+ metadata.gz: e4ee32d5341f80f1c8792cc35e43c6f0d77a5eda123edf4ee4e7f5ba42ca68151213c7d5142549cf0bc681750f136f3a1b2821881653a99c69b1cf3da430ee2b
7
+ data.tar.gz: c361d3764d7895dde4d9bb545d7d3adc4ea3651892690424fff8a38945ccaaec41961cb207282ae76eef1d3d007e2ac624253b2659e242cbe3f204200f176069
@@ -48,23 +48,6 @@ module Metanorma
48
48
  doc
49
49
  end
50
50
 
51
- def get_path_from_index(parent, index_name) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
52
- lutaml_xmi_index = parent.document
53
- .attributes["lutaml_xmi_index"][index_name]
54
-
55
- if lutaml_xmi_index.nil? || lutaml_xmi_index[:path].nil?
56
- ::Metanorma::Util.log(
57
- "[metanorma-plugin-lutaml] lutaml_xmi_index error: " \
58
- "XMI index #{index_name} path not found!",
59
- :error,
60
- )
61
-
62
- return nil
63
- end
64
-
65
- lutaml_xmi_index[:path]
66
- end
67
-
68
51
  def img_src_path(document, attrs, diagram)
69
52
  base_path = attrs["base_path"]
70
53
  format = attrs["format"] || "png"
@@ -85,6 +85,29 @@ module Metanorma
85
85
  )
86
86
  end
87
87
 
88
+ def get_xmi_path(parent, target, attrs)
89
+ return get_path_from_index(parent, attrs["index"]) if attrs["index"]
90
+
91
+ Utils.relative_file_path(parent.document, target)
92
+ end
93
+
94
+ def get_path_from_index(parent, index_name) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
95
+ lutaml_xmi_index = parent.document
96
+ .attributes["lutaml_xmi_index"][index_name]
97
+
98
+ if lutaml_xmi_index.nil? || lutaml_xmi_index[:path].nil?
99
+ ::Metanorma::Util.log(
100
+ "[metanorma-plugin-lutaml] lutaml_xmi_index error: " \
101
+ "XMI index #{index_name} path not found!",
102
+ :error,
103
+ )
104
+
105
+ return nil
106
+ end
107
+
108
+ lutaml_xmi_index[:path]
109
+ end
110
+
88
111
  def processed_lines(document, input_lines)
89
112
  result = []
90
113
  loop do
@@ -97,7 +120,7 @@ module Metanorma
97
120
  self.class.const_get(:MACRO_REGEXP)
98
121
  end
99
122
 
100
- def process_xmi_index_lines(document, line)
123
+ def process_xmi_index_lines(document, line) # rubocop:disable Metrics/AbcSize
101
124
  block_match = line.match(XMI_INDEX_REGEXP)
102
125
 
103
126
  return if block_match.nil?
@@ -15,8 +15,8 @@ module Metanorma
15
15
  use_dsl
16
16
  named :lutaml_klass_table
17
17
 
18
- def process(parent, target, attrs)
19
- xmi_path = Utils.relative_file_path(parent.document, target)
18
+ def process(parent, target, attrs) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
19
+ xmi_path = get_xmi_path(parent, target, attrs)
20
20
 
21
21
  if attrs["template"]
22
22
  attrs["template"] = Utils.relative_file_path(
@@ -1,7 +1,7 @@
1
1
  module Metanorma
2
2
  module Plugin
3
3
  module Lutaml
4
- VERSION = "0.7.28".freeze
4
+ VERSION = "0.7.29".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.28
4
+ version: 0.7.29
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-04-30 00:00:00.000000000 Z
11
+ date: 2025-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor