mn-requirements 0.1.9 → 0.2.0
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/isodoc-yaml/i18n-ar.yaml +1 -0
- data/lib/isodoc-yaml/i18n-de.yaml +1 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +1 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/metanorma/modspec/isodoc.rb +15 -44
- data/lib/metanorma/modspec/reqt_label.rb +41 -0
- data/lib/metanorma/requirements/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cc32c6334d63f4745d279e84ea08305400eccc4f020ac410b85488e47e3c6ce
|
4
|
+
data.tar.gz: 57e1f8b559a619d6d01a18520d15f3de7787d0eb7fed17add4c120bc58b0d862
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 817a441beba95552171c674b07c7d447808496a642c90181baf039723b7fcdef1dbb5ee23ecac9e167ffea9d09871af3bfa48dec7c40c7cc46b4fe48559e1286
|
7
|
+
data.tar.gz: '09ee6db13e6fc2eb7e99ec2fbeb281a6ce3a9aed08e8d41b865a1acd458c2ec9fa642325bfff50de1ec8689ba9f8e8a74f914e0c5e3759670ee85c183f787ec1'
|
@@ -69,8 +69,8 @@ module Metanorma
|
|
69
69
|
|
70
70
|
def recommend_title(node, out)
|
71
71
|
label = node.at(ns("./identifier")) or return
|
72
|
-
out.add_child("<tr><
|
73
|
-
"<tt>#{label.children.to_xml}</tt></td>")
|
72
|
+
out.add_child("<tr><th>#{@labels['modspec']['identifier']}</th>" \
|
73
|
+
"<td><tt>#{label.children.to_xml}</tt></td>")
|
74
74
|
end
|
75
75
|
|
76
76
|
def recommendation_attributes1(node)
|
@@ -162,7 +162,8 @@ module Metanorma
|
|
162
162
|
def recommendation_attr_keyvalue(node, key, value)
|
163
163
|
tag = node.at(ns("./#{key}")) or return nil
|
164
164
|
value = node.at(ns("./#{value}")) or return nil
|
165
|
-
!%w(target indirect-dependency
|
165
|
+
!%w(target indirect-dependency
|
166
|
+
implements).include?(tag.text.downcase) or
|
166
167
|
return nil
|
167
168
|
[Metanorma::Utils.strict_capitalize_first(tag.text), value.children]
|
168
169
|
end
|
@@ -184,12 +185,23 @@ module Metanorma
|
|
184
185
|
return reqt_dl(node.first_element_child, out)
|
185
186
|
node.name == "component" and
|
186
187
|
return recommendation_attributes1_component(node, out)
|
188
|
+
node.name == "description" and
|
189
|
+
return requirement_description_parse(node, out)
|
187
190
|
out.add_child("<tr#{id_attr(node)}><td colspan='2'></td></tr>").first
|
188
191
|
.at(ns(".//td")) <<
|
189
192
|
(preserve_in_nested_table?(node) ? node : node.children)
|
190
193
|
out
|
191
194
|
end
|
192
195
|
|
196
|
+
def requirement_description_parse(node, out)
|
197
|
+
lbl = "statement"
|
198
|
+
recommend_class(node.parent) == "recommendclass" and
|
199
|
+
lbl = "description"
|
200
|
+
out << "<tr><th>#{@labels['modspec'][lbl]}</th>" \
|
201
|
+
"<td>#{node.children.to_xml}</td></tr>"
|
202
|
+
out
|
203
|
+
end
|
204
|
+
|
193
205
|
def requirement_guidance_parse(node, out)
|
194
206
|
ins = out.at(ns("./tbody"))
|
195
207
|
node.xpath(ns("./component[@class = 'guidance']")).each do |f|
|
@@ -208,47 +220,6 @@ module Metanorma
|
|
208
220
|
end
|
209
221
|
out
|
210
222
|
end
|
211
|
-
|
212
|
-
def rec_subj(node)
|
213
|
-
case node["type"]
|
214
|
-
when "class" then @labels["modspec"]["targettype"]
|
215
|
-
else @labels["default"]["subject"]
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
def rec_target(node)
|
220
|
-
case node["type"]
|
221
|
-
when "class" then @labels["modspec"]["targettype"]
|
222
|
-
when "conformanceclass" then @labels["modspec"]["requirementclass"]
|
223
|
-
when "verification", "abstracttest" then @labels["default"]["requirement"]
|
224
|
-
else @labels["modspec"]["target"]
|
225
|
-
end
|
226
|
-
end
|
227
|
-
|
228
|
-
def recommend_class(node)
|
229
|
-
case node["type"]
|
230
|
-
when "verification", "abstracttest" then "recommendtest"
|
231
|
-
when "class", "conformanceclass" then "recommendclass"
|
232
|
-
else "recommend"
|
233
|
-
end
|
234
|
-
end
|
235
|
-
|
236
|
-
def recommend_name_class(node)
|
237
|
-
if %w(verification abstracttest).include?(node["type"])
|
238
|
-
"RecommendationTestTitle"
|
239
|
-
else "RecommendationTitle"
|
240
|
-
end
|
241
|
-
end
|
242
|
-
|
243
|
-
def recommend_component_label(node)
|
244
|
-
c = case node["class"]
|
245
|
-
when "test-purpose" then "Test purpose"
|
246
|
-
when "test-method" then "Test method"
|
247
|
-
else node["class"]
|
248
|
-
end
|
249
|
-
@labels["default"][c] || @labels["modspec"][c] ||
|
250
|
-
Metanorma::Utils.strict_capitalize_first(c)
|
251
|
-
end
|
252
223
|
end
|
253
224
|
end
|
254
225
|
end
|
@@ -142,6 +142,47 @@ module Metanorma
|
|
142
142
|
ret << [@labels["modspec"]["included_in"], xref]
|
143
143
|
ret
|
144
144
|
end
|
145
|
+
|
146
|
+
def rec_subj(node)
|
147
|
+
case node["type"]
|
148
|
+
when "class" then @labels["modspec"]["targettype"]
|
149
|
+
else @labels["default"]["subject"]
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def rec_target(node)
|
154
|
+
case node["type"]
|
155
|
+
when "class" then @labels["modspec"]["targettype"]
|
156
|
+
when "conformanceclass" then @labels["modspec"]["requirementclass"]
|
157
|
+
when "verification", "abstracttest" then @labels["default"]["requirement"]
|
158
|
+
else @labels["modspec"]["target"]
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def recommend_class(node)
|
163
|
+
case node["type"]
|
164
|
+
when "verification", "abstracttest" then "recommendtest"
|
165
|
+
when "class", "conformanceclass" then "recommendclass"
|
166
|
+
else "recommend"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def recommend_name_class(node)
|
171
|
+
if %w(verification abstracttest).include?(node["type"])
|
172
|
+
"RecommendationTestTitle"
|
173
|
+
else "RecommendationTitle"
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
def recommend_component_label(node)
|
178
|
+
c = case node["class"]
|
179
|
+
when "test-purpose" then "Test purpose"
|
180
|
+
when "test-method" then "Test method"
|
181
|
+
else node["class"]
|
182
|
+
end
|
183
|
+
@labels["default"][c] || @labels["modspec"][c] ||
|
184
|
+
Metanorma::Utils.strict_capitalize_first(c)
|
185
|
+
end
|
145
186
|
end
|
146
187
|
end
|
147
188
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mn-requirements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: isodoc-i18n
|