Closed opoudjis closed 2 years ago
I have re-checked all the examples provided and revised the original post in detail. Some of the original issues were not accurate.
@mico can you help check the examples above and create issues as necessary? Thanks.
@mico I've updated the ticket again and split the work out. Please review the associated tickets.
We need a simple way of adding an Amendment / Corrigendum.
I'm surprised that this doesn't work:
Pubid::Iso::Identifier.new(number: 17301, part: 1, publisher: "ISO", language: "en", year: 2016, amendments: [{number: 1, stage: "NP"}]).to_s
lib/pubid/iso/renderer/base.rb:58:in `block in render_amendments': undefined method `render_pubid' for {:number=>1, :stage=>"NP"}:Hash (NoMethodError)
amendments.sort.map { |amendment| amendment.render_pubid(opts[:stage_format_long], opts[:with_date]) }.join("+")
^^^^^^^^^^^^^
from lib/pubid/iso/renderer/base.rb:58:in `map'
from lib/pubid/iso/renderer/base.rb:58:in `render_amendments
Where's the documentation on how to create an Amendment identifier?
Users won't bother creating a class when creating an identifier. If the stage given is not a class, look it up for them.
Pubid::Iso::Identifier.new(number: 17301, part: "1-1", publisher: "ISO", language: "en", year: 2016, type: "TS", stage: "DIS", copublisher:
["IEC","IEEE"]).to_s
lib/pubid/iso/identifier.rb:43:in `initialize': undefined method `abbr' for "DIS":String (NoMethodError)
if stage.abbr == "IS" && iteration
^^^^^
from (irb):6:in `new'
from (irb):6:in `<main>'
I will create new tickets for these remaining issues.
The remaining tasks are :
Closing this one for now.
I think there is a clear misunderstanding in how this gem is to be used.
The tests for this gem round trip from parsing ISO IDs, to constructing IDs based on the parse.
The correct way of testing this gem is to construct identifier class instances from parameters, and then compare the results to the defined exemplars.
The reason the current tests are flawed are:
I have attempted to use this gem with the identifiers generated by metanorma-iso in its testing. None of them are correct. These must be fixed.
Pubid::Iso::Identifier.new()
parameters, expected value, generated value:ISO. 17301-1. 2016. AMENDMENT 1. 2017.
urn_stage
, that should be the gem's job)ISO 17301-1 Amd 1 DIS
This is wrong. The correct output is (depending on rendering options of #69):
ISO 17301-1 Amd 1 (stage = published)
Notice that the
Identifier
object differentiates the "no-stage" vs "IS stage" (published) in the URN, the rendering of the "IS stage" identifier is wrong.When the stage is "IS", the output should be "ISO 17301-1:2016/Amd 1(en)", not "ISO 17301-1:2016/IS Amd :1(en)".
This behavior also applies to "Cor".
ISO 17301-1/CD Cor 3
Generated: "ISO 17301-1/CD Cor :3" Correct: "ISO 17301-1/CD Cor 3"
ISO 17301-1, FDIS stage, Cor 3 => "ISO 17301-1/FD Cor 3"
Generated: "ISO 17301-1/FD Cor :3" Correct: "ISO 17301-1/FDCor 3"
Stage iteration identifiers in Amd or Cor
Stage iteration is supported in the normal pubid.
This is filed in #82.
TR and TS documents with subparts
This output is correct.
TR and TS documents with DIS or FDIS stages
This should have been "ISO/IEC/IEEE DTS 17301-1-1:2016(en)" (instead of "TS DIS", it is "DTS").
This should have been "ISO/IEC/IEEE FDTS 17301-1-1:2016(en)" (instead of "TS FDIS", it is "FDTS").
The same applies to
type: "TR"
.ISO Directives
Right now:
Why don't we use the
type
attribute to holdDIR
, but a newdir
attribute?