lib/metanorma/modspec/cleanup.rb in mn-requirements-0.1.4 vs lib/metanorma/modspec/cleanup.rb in mn-requirements-0.1.4.1
- old
+ new
@@ -13,11 +13,11 @@
end
end
def requirement_metadata_component_tags
%w(test-purpose test-method test-method-type conditions part description
- reference step requirement permission recommendation)
+ reference step requirement permission recommendation guidance)
end
def requirement_metadata1(reqt, dlist, ins)
ins1 = super
dlist.xpath("./dt").each do |e|
@@ -57,12 +57,12 @@
v.children = v.at("./link/@target").text
end
end
def requirement_metadata_to_component(reqt)
- reqt.xpath(".//test-method | .//test-purpose | .//conditions | "\
- ".//part | .//test-method-type | .//step | .//reference")
- .each do |c|
+ xpath = requirement_metadata_component_tags -
+ %w(description requirement permission recommendation)
+ reqt.xpath(xpath.map { |x| ".//#{x}" }.join(" | ")).each do |c|
c["class"] = c.name
c.name = "component"
end
end