lib/isodoc/nist/metadata_id.rb in metanorma-nist-1.2.9 vs lib/isodoc/nist/metadata_id.rb in metanorma-nist-1.2.10
- old
+ new
@@ -71,12 +71,11 @@
end
end
def docid(ixml, _out)
docid = ixml.at(ns("//bibdata/docidentifier[@type = 'NIST']"))&.text
- docid_long = ixml.at(ns("//bibdata/docidentifier"\
- "[@type = 'nist-long']"))&.text
+ docid_long = ixml.at(ns("//bibdata/docidentifier[@type = 'nist-long']"))&.text
set(:docidentifier, docid)
set(:docidentifier_long, docid_long)
set(:docidentifier_undated, stripdate(docid))
set(:docidentifier_long_undated, stripdate(docid_long))
d = draft_prefix(ixml) and set(:draft_prefix, d)
@@ -84,12 +83,11 @@
d = iter_ordinal(ixml) and set(:iteration_ordinal, d)
end
def stripdate(id)
return if id.nil?
- id.sub(/ \((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[^)]+\)$/,
- "")
+ id.sub(/ \((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[^)]+\)$/, "")
end
def draft_prefix(ixml)
docstatus = ixml.at(ns("//bibdata/status/stage"))&.text
return nil unless docstatus && /^draft/.match(docstatus)
@@ -115,12 +113,10 @@
iter.to_i.localize.to_rbnf_s("SpelloutRules", "spellout-ordinal")
end
def draftinfo(draft, revdate)
draftinfo = ""
- if draft
- draftinfo = " #{@labels["draft_label"]} #{draft}"
- end
+ draft and draftinfo = " #{@labels["draft_label"]} #{draft}"
@i18n.l10n(draftinfo, @lang, @script)
end
end
end
end