lib/metanorma/itu/validate.rb in metanorma-itu-2.4.4 vs lib/metanorma/itu/validate.rb in metanorma-itu-2.4.5
- old
+ new
@@ -4,15 +4,16 @@
def bibdata_validate(doc)
doctype_validate(doc)
stage_validate(doc)
end
- def doctype_validate(xmldoc)
+ def doctype_validate(_xmldoc)
%w(recommendation recommendation-supplement recommendation-amendment
recommendation-corrigendum recommendation-errata recommendation-annex
focus-group implementers-guide technical-paper technical-report
- joint-itu-iso-iec service-publication).include? @doctype or
+ joint-itu-iso-iec service-publication
+ contribution).include? @doctype or
@log.add("Document Attributes", nil,
"#{@doctype} is not a recognised document type")
end
def stage_validate(xmldoc)
@@ -69,11 +70,10 @@
# Editing Guidelines 9.4.3
# Supplanted by rendering
def numbers_validate(xmldoc); end
def style_two_regex_not_prev(node, text, regex, regex_prev, warning)
- return if text.nil?
-
+ text.nil? and return
arr = text.split(/\W+/)
arr.each_index do |i|
m = regex.match arr[i]
m_prev = i.zero? ? nil : regex_prev.match(arr[i - 1])
if !m.nil? && m_prev.nil?