Skip to content

Commit

Permalink
https://github.com/metanorma/pubid-iso/issues/102
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Sep 22, 2022
1 parent ebb092e commit 18972b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions lib/metanorma/iso/front_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ def iso_id_params(node)

def iso_id_params_core(node)
pub = (node.attr("publisher") || "ISO").split(/[;,]/)
{
number: node.attr("docnumber"),
part: node.attr("partnumber"),
language: node.attr("language") || "en",
type: get_typeabbr(node),
publisher: pub[0],
copublisher: pub[1..-1],
}.compact
ret = { number: node.attr("docnumber"),
part: node.attr("partnumber"),
language: node.attr("language") || "en",
type: get_typeabbr(node),
publisher: pub[0],
copublisher: pub[1..-1] }.compact
ret[:copublisher].empty? and ret.delete(:copublisher)
ret
end

def iso_id_params_add(node)
Expand Down Expand Up @@ -136,14 +136,14 @@ def iso_id_params_resolve(params, params2, node, orig_id)
def iso_id_out(xml, params)
xml.docidentifier iso_id_default(params), **attr_code(type: "ISO")
xml.docidentifier iso_id_reference(params)
.to_s(with_language_code: :single),
.to_s(format: :ref_num_long),
**attr_code(type: "iso-reference")
return if @amd

xml.docidentifier iso_id_undated(params),
**attr_code(type: "iso-undated")
xml.docidentifier iso_id_with_lang(params)
.to_s(with_language_code: :single),
.to_s(format: :ref_num_short),
**attr_code(type: "iso-with-lang")
end

Expand Down
2 changes: 1 addition & 1 deletion lib/metanorma/requirements/modspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Requirements
class Modspec
# Don't want to inherit from Metanorma::Requirements::Modspec
class Iso < ::Metanorma::Requirements::Modspec
def recommendation_label_xref(elem, label, xrefs)
def recommendation_label_xref(elem, label, xrefs, _type)
id = @reqtlabels[label]
number = xrefs.anchor(id, :xref_reqt2reqt, false)
number.nil? and return type
Expand Down

0 comments on commit 18972b9

Please sign in to comment.