metanorma-plugin-lutaml 0.4.10 → 0.4.11

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: 241b12b07d457ea48176e22ce2cacc4a533c2ffc5435465637d51d37d6da1e80
4
- data.tar.gz: 2a2bd1fe63f4febdae9ce40679f525cfe476f2a773ab15c5de9622145dbdbd7f
3
+ metadata.gz: c3ac25c64f997af2bb3228af3816a9aafe2ea0b62a8c80eaa58f598cba8085e2
4
+ data.tar.gz: 824ab598854889b1a7079d872d96f515757719436eba95850eb7a85d924e23fc
5
5
  SHA512:
6
- metadata.gz: 33ef546ecbc2929104ccda434021ef50afbd067d5f466b7d07181aea92415a15aaad67fdf3848b4bd0cf93878e032b007b437a630b1d5ea87398396b446b622f
7
- data.tar.gz: 7373d126f78af6063dbfea6076018712f4185a6c0e75e50309befc23bf1e34beeec86ab80d8b36f9c73eb7e5ae238b0522e85ec307ee434538222790cc05d8c3
6
+ metadata.gz: 68246a6140b1a29548a77c10e7949058652c4be9e1ec2ee150d698f777e0bb91c2c4d75abaac3f69b8d09089f945cc24fff150a9ac83acf6ff36c521bd8c1c97
7
+ data.tar.gz: a8c60e3c539d000334fafa9b43d3e89a144dd327f9c212445aae35a547f1dd6ce0214df15b3223d8306829d3e3f938318331b1581c9220ff330e8cfd5817f0fb
@@ -135,7 +135,7 @@ None.
135
135
  {% assign non_unions = package.data_types | where: "stereotype", "DataType" %}
136
136
  {% if non_unions.size > 0 %}
137
137
  {% for data_type in non_unions %}
138
- {% capture generalizations %}{% assign inheritance = klass.associations | where: "member_end_type", "inheritance" %}{% for assoc in inheritance %}<<{{ assoc.member_end }}-section,{{ assoc.member_end }}>>{% endfor %}{% endcapture %}
138
+ {% capture generalizations %}{% assign inheritance = klass.associations | where: "member_end_type", "inheritance" %}{% for assoc in inheritance %}{% capture ref_id %}{% if additional_context.external_classes[assoc.member_end] %}{{ additional_context.external_classes[assoc.member_end] }}{% else %}{{ assoc.member_end }}-section{% endif %}{% endcapture %}<<{{ ref_id }},{{ assoc.member_end }}>>{% endfor %}{% endcapture %}
139
139
  [[{{ data_type.name }}-section]]
140
140
  {{equalsigns}}== {{ data_type.name }}
141
141
 
@@ -166,7 +166,8 @@ h| Constraint:
166
166
  {% if assoc.member_end_attribute_name.size > 0 %}
167
167
  {% capture cardinality %}&#91;{% case assoc.member_end_cardinality.min %}{% when "C" %}0{% when "M" %}1{% else %}{{assoc.member_end_cardinality.min}}{% endcase %}..{{ assoc.member_end_cardinality.max }}&#93;{% endcapture %}
168
168
  | {{ assoc.member_end_attribute_name }}
169
- | <<{{assoc.member_end}}-section,{{assoc.member_end}}>> {{ cardinality }}
169
+ {% capture ref_id %}{% if additional_context.external_classes[assoc.member_end] %}{{ additional_context.external_classes[assoc.member_end] }}{% else %}{{ assoc.member_end }}-section{% endif %}{% endcapture %}
170
+ | <<{{ ref_id }},{{assoc.member_end}}>> {{ cardinality }}
170
171
  | {{ assoc.definition | replace: '|', '\|' }}
171
172
  {% endif %}
172
173
  {% endfor %}
@@ -195,7 +196,8 @@ h| Constraint:
195
196
  {% for attr in data_type.attributes %}
196
197
  {% capture cardinality %}&#91;{% case attr.cardinality.min %}{% when 'C' %}0{% when 'M' %}1{% else %}{{ attr.cardinality.min }}{% endcase %}..{{ attr.cardinality.max }}&#93;{% endcapture %}
197
198
  | {{ attr.name }}
198
- | <<{{ attr.type }}-section,{{ attr.type }}>> {{ cardinality }}
199
+ {% capture ref_id %}{% if additional_context.external_classes[attr.type] %}{{ additional_context.external_classes[attr.type] }}{% else %}{{ attr.type }}-section{% endif %}{% endcapture %}
200
+ | <<{{ ref_id }},{{ attr.type }}>> {{ cardinality }}
199
201
  | {{ attr.definition | replace: '|', '\|' }}
200
202
 
201
203
  {% endfor %}
@@ -1,5 +1,5 @@
1
1
  {% capture equalsigns %}{% for count in (1..depth) %}={% endfor %}{% endcapture %}
2
- {% capture generalizations %}{% assign inheritance = klass.associations | where: "member_end_type", "inheritance" %}{% for assoc in inheritance %}<<{{ assoc.member_end }}-section,{{ assoc.member_end }}>>{% endfor %}{% endcapture %}
2
+ {% capture generalizations %}{% assign inheritance = klass.associations | where: "member_end_type", "inheritance" %}{% for assoc in inheritance %}{% capture ref_id %}{% if additional_context.external_classes[assoc.member_end] %}{{ additional_context.external_classes[assoc.member_end] }}{% else %}{{ assoc.member_end }}-section{% endif %}{% endcapture %}<<{{ ref_id }},{{ assoc.member_end }}>>{% endfor %}{% endcapture %}
3
3
  [[{{ klass.name }}-section]]
4
4
  {{equalsigns}} {{ klass.name }}
5
5
  {%comment%}(inside class: depth is {{ depth }}, equalsigns {{equalsigns}}){%endcomment%}
@@ -31,7 +31,8 @@ h| Constraint:
31
31
  {% if assoc.member_end_attribute_name.size > 0 %}
32
32
  {% capture cardinality %}&#91;{% case assoc.member_end_cardinality.min %}{% when "C" %}0{% when "M" %}1{% else %}{{assoc.member_end_cardinality.min}}{% endcase %}..{{ assoc.member_end_cardinality.max }}&#93;{% endcapture %}
33
33
  | {{ assoc.member_end_attribute_name }}
34
- | <<{{assoc.member_end}}-section,{{assoc.member_end}}>> {{ cardinality }}
34
+ {% capture ref_id %}{% if additional_context.external_classes[assoc.member_end] %}{{ additional_context.external_classes[assoc.member_end] }}{% else %}{{ assoc.member_end }}-section{% endif %}{% endcapture %}
35
+ | <<{{ ref_id }},{{assoc.member_end}}>> {{ cardinality }}
35
36
  | {{ assoc.definition | replace: '|', '\|' }}
36
37
  {% endif %}
37
38
  {% endfor %}
@@ -59,7 +60,8 @@ h| Constraint:
59
60
  {% for attr in klass.attributes %}
60
61
  {% capture cardinality %}&#91;{% case attr.cardinality.min %}{% when 'C' %}0{% when 'M' %}1{% else %}{{ attr.cardinality.min }}{% endcase %}..{{ attr.cardinality.max }}&#93;{% endcapture %}
61
62
  | {{ attr.name }}
62
- | <<{{ attr.type }}-section,{{ attr.type }}>> {{ cardinality }}
63
+ {% capture ref_id %}{% if additional_context.external_classes[attr.type] %}{{ additional_context.external_classes[attr.type] }}{% else %}{{ attr.type }}-section{% endif %}{% endcapture %}
64
+ | <<{{ ref_id }},{{ attr.type }}>> {{ cardinality }}
63
65
  | {{ attr.definition | replace: '|', '\|' }}
64
66
 
65
67
  {% endfor %}
@@ -89,7 +89,8 @@
89
89
 
90
90
  {% for klass in package.classes %}
91
91
  {% unless not_classes_stereotypes contains klass.stereotype %}
92
- | <<{{ klass.name }}-section,{{ klass.name }}>> «{{ klass.stereotype }}»
92
+ {% capture ref_id %}{% if additional_context.external_classes[klass.name] %}{{ additional_context.external_classes[klass.name] }}{% else %}{{ klass.name }}-section{% endif %}{% endcapture %}
93
+ | <<{{ ref_id }},{{ klass.name }}>> «{{ klass.stereotype }}»
93
94
  | {{ klass.definition | replace: '|', '\|' }}
94
95
 
95
96
  {% endunless %}
@@ -120,36 +121,6 @@
120
121
 
121
122
  {% endif %}
122
123
 
123
- {% comment %} {% if package.data_types.size > 0 %}
124
- .Data types used in {{ package.name }}
125
- [cols="2a,6a",options="header"]
126
- |===
127
- |Name |Description
128
-
129
- {% for klass in package.data_types %}
130
- |<<{{ klass.name }}-section,{{ klass.name }}>> «{{ klass.stereotype }}»
131
- |{{ klass.definition | replace: '|', '\|' }}
132
-
133
- {% endfor %}
134
-
135
- |===
136
- {% endif %}
137
-
138
- {% if package.enums.size > 0 %}
139
- .Enumerated Classes used in {{ package.name }}
140
- [cols="2a,6a",options="header"]
141
- |===
142
- |Name |Description
143
-
144
- {% for klass in package.enums %}
145
- |<<{{ klass.name }}-section,{{ klass.name }}>> «{{ klass.stereotype }}»
146
- |{{ klass.definition | replace: '|', '\|' }}
147
-
148
- {% endfor %}
149
-
150
- |===
151
- {% endif %} {% endcomment %}
152
-
153
124
  {% if additional_context.all_macros.size > 0 %}
154
125
  {% assign sorted_all_macros = additional_context.all_macros | where: "position", "after" | sort: 'index' %}
155
126
  {% for block in sorted_all_macros %}
@@ -163,7 +163,7 @@ module Metanorma
163
163
  'render_nested_packages' => true,
164
164
  "packages" => root_package['packages'],
165
165
  "root_packages" => [root_package],
166
- "additional_context" => additional_context,
166
+ "additional_context" => additional_context.merge("external_classes" => options["external_classes"]),
167
167
  "name" => root_package['name']
168
168
  }
169
169
  end
@@ -173,7 +173,7 @@ module Metanorma
173
173
  "packages" => sort_and_filter_out_packages(all_packages, options),
174
174
  "package_entities" => package_entities(options),
175
175
  "package_skip_sections" => package_skip_sections(options),
176
- "additional_context" => additional_context,
176
+ "additional_context" => additional_context.merge("external_classes" => options["external_classes"]),
177
177
  "root_packages" => [root_package],
178
178
  "name" => root_package['name']
179
179
  }
@@ -1,7 +1,7 @@
1
1
  module Metanorma
2
2
  module Plugin
3
3
  module Lutaml
4
- VERSION = "0.4.10".freeze
4
+ VERSION = "0.4.11".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.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-17 00:00:00.000000000 Z
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid