metanorma-plugin-lutaml 0.6.4 → 0.6.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 701c14675ce78bd6ddc3f3302679709c852e5572da0779c8f26964c6cac866a3
|
4
|
+
data.tar.gz: 43d6abe93a90748e2b7a6163d396a43d1f09a8a36f8d0d2e43be34c7492a8daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d45281405302619caf401c6f319c4a217c30c34826e466ef874e661b3cfa3c11c9fa2691638de4590d22c68491bbc70abebea078135706d8cfcca86ec927d1f
|
7
|
+
data.tar.gz: 84b31a07da65105d1640613359e24ba60921c4c8c4ecc467cbdd200fee817a5e009b21d0533e90897151ddf260a6c2c48b68006818e5606e633a64197a2ec0bf
|
@@ -67,7 +67,7 @@ module Metanorma
|
|
67
67
|
entity_name = match[2]
|
68
68
|
options = parse_options_to_hash(match[3])
|
69
69
|
|
70
|
-
result.push(*
|
70
|
+
result.push(*parse_macro(lutaml_path, entity_name, document,
|
71
71
|
options))
|
72
72
|
else
|
73
73
|
result.push(line)
|
@@ -75,7 +75,7 @@ module Metanorma
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
78
|
+
def parse_macro(lutaml_path, entity_name, document, options)
|
79
79
|
lutaml_document = lutaml_document_from_file(document, lutaml_path)
|
80
80
|
.serialized_document
|
81
81
|
entities = [lutaml_document["classes"], lutaml_document["enums"]]
|
@@ -120,18 +120,30 @@ module Metanorma
|
|
120
120
|
::Lutaml::Parser.parse(files)
|
121
121
|
end
|
122
122
|
|
123
|
+
# TODO: Refactor this using Suma::SchemaConfig
|
123
124
|
def load_express_from_index(document, path)
|
124
125
|
yaml_content = YAML.safe_load(File.read(path))
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
126
|
+
schema_yaml_base_path = Pathname.new(File.dirname(path))
|
127
|
+
|
128
|
+
# If there is a global root path set, all subsequent paths are
|
129
|
+
# relative to it.
|
130
|
+
if yaml_content['path']
|
131
|
+
root_schema_path = Pathname.new(yaml_content['path'])
|
132
|
+
schema_yaml_base_path = schema_yaml_base_path + root_schema_path
|
130
133
|
end
|
131
134
|
|
132
|
-
files_to_load =
|
133
|
-
|
134
|
-
|
135
|
+
files_to_load = yaml_content["schemas"].map do |key, value|
|
136
|
+
|
137
|
+
# If there is no path: set for a schema, we assume it uses the
|
138
|
+
# schema name as the #{filename}.exp.
|
139
|
+
schema_path = if value['path']
|
140
|
+
Pathname.new(value['path'])
|
141
|
+
else
|
142
|
+
Pathname.new("#{key}.exp")
|
143
|
+
end
|
144
|
+
|
145
|
+
real_schema_path = schema_yaml_base_path + schema_path
|
146
|
+
File.new(real_schema_path.cleanpath.to_s, encoding: "UTF-8")
|
135
147
|
end
|
136
148
|
|
137
149
|
::Lutaml::Parser.parse(files_to_load)
|
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.6.
|
4
|
+
version: 0.6.5
|
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-05-
|
11
|
+
date: 2024-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|