metanorma-plugin-lutaml 0.7.32 → 0.7.33
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 +4 -4
- data/lib/metanorma/plugin/lutaml/liquid/custom_filters/file_exist.rb +13 -0
- data/lib/metanorma/plugin/lutaml/liquid_templates/_packages_class.liquid +80 -32
- data/lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb +0 -10
- data/lib/metanorma/plugin/lutaml/utils.rb +1 -0
- data/lib/metanorma/plugin/lutaml/version.rb +1 -1
- data/metanorma-plugin-lutaml.gemspec +3 -3
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 249c6be1ae1a19967a906113b2142e3608e65ffc784e85bb990a7226b4818982
|
4
|
+
data.tar.gz: 405ea5857dab3f2750d0ab8c4a27c9a0abc119f97dccbe0b67f143cfe780e754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3008f74df51c0ed75b44a87acc302ac0fcecf5e4e2501e7c55de8aac6023a7e247df13e088d554b217280c3329049c826768e3d5557cddbd63570810262d7d45
|
7
|
+
data.tar.gz: bf0891bae566ccbeaacd9a98516e2495642d9629c8eed5adc8e9b4025338fe1fcfd7aa2c5555f2f0c4e2795d25a4e7ee98c760b7eaf486c16762efb4318533cb
|
@@ -8,74 +8,122 @@
|
|
8
8
|
[width="100%",cols="a,a,a,a,a,a,a,a"]
|
9
9
|
|===
|
10
10
|
|
11
|
-
h|Name
|
11
|
+
h|Name 7+| {{ klass.name }}
|
12
12
|
|
13
|
-
h|Definition
|
13
|
+
h|Definition 7+| {{ klass.definition | html2adoc }}
|
14
14
|
|
15
|
-
h|Stereotype
|
15
|
+
h|Stereotype 7+| {{ klass.stereotype | default: 'interface' }}
|
16
16
|
|
17
17
|
{% assign inherited = klass.associations | where: "member_end_type", "inheritance" %}
|
18
18
|
{% if inherited.size > 0 %}
|
19
|
-
h|
|
19
|
+
h|Inherits from 7+| {{ inherited | map: 'member_end' | join: ", " }}
|
20
20
|
{% endif %}
|
21
21
|
|
22
22
|
{% assign generalizations = klass.associations | where: "member_end_type", "generalization" %}
|
23
23
|
{% if generalizations.size > 0 %}
|
24
|
-
h|Generalization of
|
24
|
+
h|Generalization of 7+| {{ generalizations | map: 'member_end' | join: ", " }}
|
25
25
|
{% endif %}
|
26
26
|
|
27
|
-
h|Abstract
|
27
|
+
h|Abstract 7+| {% if klass.is_abstract %}True{% else %}False{% endif %}
|
28
28
|
{% assign aggregations = klass.associations | where: "member_end_type", "aggregation" %}
|
29
|
+
|
29
30
|
{% if aggregations.size > 0 %}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
|
31
|
+
|
32
|
+
{% assign associations_colspan = aggregations.size | plus: 1 %}
|
33
|
+
{% for assoc in aggregations %}
|
34
|
+
{% if assoc.connector && assoc.connector.source %}
|
35
|
+
{% assign associations_colspan = associations_colspan | plus: 1 %}
|
36
|
+
{% endif %}
|
37
|
+
{% if assoc.connector && assoc.connector.target %}
|
38
|
+
{% assign associations_colspan = associations_colspan | plus: 1 %}
|
39
|
+
{% endif %}
|
40
|
+
{% endfor %}
|
41
|
+
|
42
|
+
.{{associations_colspan}}+h|Associations
|
43
|
+
2+h| _Name_
|
44
|
+
2+h| _Type_
|
45
|
+
3+h| _Definition_
|
35
46
|
|
36
47
|
{% for assoc in aggregations %}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
48
|
+
|
49
|
+
{% assign member_end_documentation_size = assoc.member_end.definition | size %}
|
50
|
+
{% capture member_end_documentation %}{% if member_end_documentation_size > 0 %}{{ assoc.member_end.definition }}{% else %}(none){% endif %}{% endcapture %}
|
51
|
+
|
52
|
+
2+| {{ assoc.member_end }}
|
53
|
+
2+| {{ assoc.member_end_attribute_name }}
|
54
|
+
3+| {{ member_end_documentation | html2adoc }}
|
55
|
+
|
56
|
+
{% if assoc.connector && assoc.connector.source %}
|
57
|
+
{% assign source_name_size = assoc.connector.source.name | size %}
|
58
|
+
{% capture source_name %}{% if source_name_size > 0 %}{{ assoc.connector.source.name }}{% else %}(self){% endif %}{% endcapture %}
|
59
|
+
{% assign source_documentation_size = assoc.connector.source.documentation | size %}
|
60
|
+
{% capture source_documentation %}{% if source_documentation_size > 0 %}{{ assoc.connector.source.documentation }}{% else %}(none){% endif %}{% endcapture %}
|
61
|
+
{% assign source_multiplicity_size = assoc.connector.source.multiplicity | size %}
|
62
|
+
{% capture source_multiplicity %}{% if source_multiplicity_size > 0 %}[{{ assoc.connector.source.multiplicity }}]{% else %}[none]{% endif %}{% endcapture %}
|
63
|
+
|
64
|
+
2+| source:{{ source_name }} {{ source_multiplicity }}
|
65
|
+
2+| {{ assoc.connector.source.type }}
|
66
|
+
3+| {{ source_documentation | html2adoc }}
|
67
|
+
{% endif %}
|
68
|
+
|
69
|
+
{% if assoc.connector && assoc.connector.target %}
|
70
|
+
{% assign target_name_size = assoc.connector.target.name | size %}
|
71
|
+
{% capture target_name %}{% if target_name_size > 0 %}{{ assoc.connector.target.name }}{% else %}(self){% endif %}{% endcapture %}
|
72
|
+
{% assign target_documentation_size = assoc.connector.target.documentation | size %}
|
73
|
+
{% capture target_documentation %}{% if target_documentation_size > 0 %}{{ assoc.connector.target.documentation }}{% else %}(none){% endif %}{% endcapture %}
|
74
|
+
{% assign target_multiplicity_size = assoc.connector.target.multiplicity | size %}
|
75
|
+
{% capture target_multiplicity %}{% if target_multiplicity_size > 0 %}[{{ assoc.connector.target.multiplicity }}]{% else %}[none]{% endif %}{% endcapture %}
|
76
|
+
|
77
|
+
2+| target:{{ target_name }} {{ target_multiplicity }}
|
78
|
+
2+| {{ assoc.connector.target.type }}
|
79
|
+
3+| {{ target_documentation | html2adoc }}
|
80
|
+
{% endif %}
|
41
81
|
|
42
82
|
{% endfor %}
|
43
83
|
{% else %}
|
44
|
-
h| Associations
|
84
|
+
h| Associations 7+| (none)
|
45
85
|
{% endif %}
|
46
86
|
|
47
87
|
{% if klass.attributes.size > 0 %}
|
48
|
-
.{{klass.attributes.size | plus: 1}}+h|
|
49
|
-
| _Name_
|
50
|
-
2
|
51
|
-
|
|
52
|
-
| _Obligation_
|
53
|
-
| _Maximum occurrence_
|
54
|
-
| _Data type_
|
88
|
+
.{{klass.attributes.size | plus: 1}}+h|Attributes
|
89
|
+
2+h| _Name_
|
90
|
+
2+h| _Type_
|
91
|
+
3+h| _Definition_
|
55
92
|
|
56
93
|
{% for attr in klass.attributes %}
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
94
|
+
{% capture attr_cardinality %}[{{attr.cardinality.min}}..{{attr.cardinality.max}}]{% endcapture %}
|
95
|
+
{% if attr_cardinality == "[*..*]" or attr_cardinality == "[0..*]" %}
|
96
|
+
{% assign attr_cardinality = "[*]" %}
|
97
|
+
{% endif %}
|
98
|
+
{% if attr_cardinality == "[1..1]" %}
|
99
|
+
{% assign attr_cardinality = "[1]" %}
|
100
|
+
{% endif %}
|
101
|
+
{% if attr_cardinality == "[..]" %}
|
102
|
+
{% assign attr_cardinality = "[none]" %}
|
103
|
+
{% endif %}
|
104
|
+
|
105
|
+
{% assign attr_definition_size = attr.definition | size %}
|
106
|
+
{% capture attr_definition %}{% if attr_definition_size > 0 %}{{ attr.definition }}{% else %}(none){% endif %}{% endcapture %}
|
107
|
+
|
108
|
+
2+| {{ attr.name }} {{ attr_cardinality }}
|
109
|
+
2+| {{ attr.type }}
|
110
|
+
3+| {{ attr_definition | html2adoc }}
|
63
111
|
|
64
112
|
{% endfor %}
|
65
113
|
{% else %}
|
66
|
-
h|
|
114
|
+
h| Attributes
|
67
115
|
7+| (none)
|
68
116
|
{% endif %}
|
69
117
|
|
70
118
|
{% if klass.constraints.size > 0 %}
|
71
|
-
.{{ klass.constraints.size }}+h| Constraints
|
119
|
+
.{{ klass.constraints.size }}+h| Constraints
|
72
120
|
{% for constraint in klass.constraints %}
|
73
121
|
7+| `{{ constraint.body }}`: `{{ constraint.definition | replace: '|', '\|' }}`
|
74
122
|
|
75
123
|
{% endfor %}
|
76
124
|
{% else %}
|
77
125
|
|
78
|
-
h|Constraints
|
126
|
+
h|Constraints 7+| (none)
|
79
127
|
{% endif %}
|
80
128
|
|
81
129
|
|===
|
@@ -33,8 +33,6 @@ module Metanorma
|
|
33
33
|
reader.lines)
|
34
34
|
input_lines = r.readlines.to_enum
|
35
35
|
|
36
|
-
has_lutaml_liquid = input_lines.any? { |line| lutaml_liquid?(line) }
|
37
|
-
|
38
36
|
express_indexes = Utils.parse_document_express_indexes(
|
39
37
|
document,
|
40
38
|
input_lines,
|
@@ -46,19 +44,11 @@ module Metanorma
|
|
46
44
|
express_indexes: express_indexes,
|
47
45
|
)
|
48
46
|
|
49
|
-
log(document, result_content) if has_lutaml_liquid
|
50
|
-
|
51
47
|
Asciidoctor::PreprocessorNoIfdefsReader.new(document, result_content)
|
52
48
|
end
|
53
49
|
|
54
50
|
protected
|
55
51
|
|
56
|
-
def log(doc, text)
|
57
|
-
File.open("#{doc.attr('docfile')}.lutaml.log.txt", "w:UTF-8") do |f|
|
58
|
-
f.write(text.join("\n"))
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
52
|
def lutaml_liquid?(line)
|
63
53
|
line.match(EXPRESS_PREPROCESSOR_REGEX)
|
64
54
|
end
|
@@ -7,6 +7,7 @@ require "metanorma/plugin/lutaml/liquid/custom_filters/html2adoc"
|
|
7
7
|
require "metanorma/plugin/lutaml/liquid/custom_filters/values"
|
8
8
|
require "metanorma/plugin/lutaml/liquid/custom_filters/replace_regex"
|
9
9
|
require "metanorma/plugin/lutaml/liquid/custom_filters/loadfile"
|
10
|
+
require "metanorma/plugin/lutaml/liquid/custom_filters/file_exist"
|
10
11
|
|
11
12
|
module Metanorma
|
12
13
|
module Plugin
|
@@ -29,11 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.required_ruby_version = ">= 2.7.0" # rubocop:disable Gemspec/RequiredRubyVersion
|
30
30
|
|
31
31
|
spec.add_dependency "asciidoctor"
|
32
|
-
spec.add_dependency "coradoc", "~> 1.1
|
33
|
-
spec.add_dependency "expressir", "~> 2.1
|
32
|
+
spec.add_dependency "coradoc", "~> 1.1"
|
33
|
+
spec.add_dependency "expressir", "~> 2.1"
|
34
34
|
spec.add_dependency "isodoc"
|
35
35
|
spec.add_dependency "liquid"
|
36
|
-
spec.add_dependency "lutaml", "~> 0.9
|
36
|
+
spec.add_dependency "lutaml", "~> 0.9"
|
37
37
|
spec.add_dependency "ogc-gml", "~>1.0.0"
|
38
38
|
spec.add_dependency "relaton-cli"
|
39
39
|
|
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.
|
4
|
+
version: 0.7.33
|
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-
|
11
|
+
date: 2025-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1
|
33
|
+
version: '1.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.1
|
40
|
+
version: '1.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: expressir
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.1
|
47
|
+
version: '2.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.1
|
54
|
+
version: '2.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: isodoc
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.9
|
89
|
+
version: '0.9'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.9
|
96
|
+
version: '0.9'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: ogc-gml
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- lib/metanorma/plugin/lutaml/file_not_found_error.rb
|
162
162
|
- lib/metanorma/plugin/lutaml/json2_text_preprocessor.rb
|
163
163
|
- lib/metanorma/plugin/lutaml/liquid/custom_blocks/key_iterator.rb
|
164
|
+
- lib/metanorma/plugin/lutaml/liquid/custom_filters/file_exist.rb
|
164
165
|
- lib/metanorma/plugin/lutaml/liquid/custom_filters/html2adoc.rb
|
165
166
|
- lib/metanorma/plugin/lutaml/liquid/custom_filters/loadfile.rb
|
166
167
|
- lib/metanorma/plugin/lutaml/liquid/custom_filters/replace_regex.rb
|