lib/isodoc/iso/metadata.rb in metanorma-iso-2.0.8.1 vs lib/isodoc/iso/metadata.rb in metanorma-iso-2.1.0
- old
+ new
@@ -19,24 +19,21 @@
if %w(technical-report technical-specification).include?(doctype)
stage = "DTS" if stage == "DIS"
stage = "FDTS" if stage == "FDIS"
end
- %w(PWI NWIP WD CD).include?(stage) && iter and
- stage += iter
+ %w(PWI NWIP WD CD).include?(stage) && iter and stage += iter
stage = "Pre#{stage}" if /^0\./.match?(draft)
stage
end
def docstatus(isoxml, _out)
docstatus = isoxml.at(ns("//bibdata/status/stage"))
set(:unpublished, false)
revdate = isoxml.at(ns("//bibdata/version/revision-date"))
set(:revdate, revdate&.text)
- if docstatus
- docstatus1(isoxml, docstatus)
- end
+ docstatus and docstatus1(isoxml, docstatus)
end
def docstatus1(isoxml, docstatus)
set(:stage, docstatus.text)
set(:stage_int, docstatus.text.to_i)
@@ -162,14 +159,13 @@
set(:doctitlemain,
@c.encode(tp[:main] ? tp[:main].text : "", :hexadecimal))
main = compose_title(tp, tn, lang)
set(:doctitle, main)
- if tp[:intro]
+ tp[:intro] and
set(:doctitleintro,
@c.encode(tp[:intro] ? tp[:intro].text : "", :hexadecimal))
- end
set(:doctitlepartlabel, part_prefix(tn, lang))
set(:doctitlepart, @c.encode(tp[:part].text, :hexadecimal)) if tp[:part]
set(:doctitleamdlabel, amd_prefix(tn, lang)) if tn[:amd]
set(:doctitleamd, @c.encode(tp[:amd].text, :hexadecimal)) if tp[:amd]
set(:doctitlecorrlabel, corr_prefix(tn, lang)) if tn[:corr]
@@ -182,18 +178,16 @@
set(:docsubtitlemain,
@c.encode(tp[:main] ? tp[:main].text : "", :hexadecimal))
main = compose_title(tp, tn, lang)
set(:docsubtitle, main)
- if tp[:intro]
+ tp[:intro] and
set(:docsubtitleintro,
@c.encode(tp[:intro] ? tp[:intro].text : "", :hexadecimal))
- end
set(:docsubtitlepartlabel, part_prefix(tn, lang))
- if tp[:part]
+ tp[:part] and
set(:docsubtitlepart,
@c.encode(tp[:part].text, :hexadecimal))
- end
set(:docsubtitleamdlabel, amd_prefix(tn, lang)) if tn[:amd]
set(:docsubtitleamd, @c.encode(tp[:amd].text, :hexadecimal)) if tp[:amd]
set(:docsubtitlecorrlabel, corr_prefix(tn, lang)) if tn[:corr]
end