This gem is deprecated and no longer maintained. The code now lives in
the pubid monogem — pubid/pubid
(RubyGems: pubid >= 2.0) — which
bundles every former pubid-* flavor grammar. This repository is
archived and read-only; issues and pull requests are disabled.
Install once:
# Gemfile
gem "pubid", "~> 2.0"Parse any identifier — one parser returns the typed identifier for the right flavor automatically:
require "pubid"
id = Pubid.parse("ISO 8601-1:2019")
id.class.name # => "Pubid::Iso::Identifiers::InternationalStandard"
id.to_s # => "ISO 8601-1:2019"
id.year # => "2019"
id.part # => "1"
jis = Pubid.parse("JIS Z 8301:2019")
jis.to_s # => "JIS Z 8301:2019"
dir = Pubid.parse("ISO/IEC Directives Part 2")
dir.to_s # => "ISO/IEC DIR 2" (normalized)Create new identifiers programmatically — the typed constructor, not string parsing:
id = Pubid::Iso::Identifier.new(number: 8601, part: 1, year: "2019")
id.to_s # => "ISO 8601-1:2019"
id.to_urn # => "urn:iso:std:iso:8601:-1:2019"
Pubid.parse("ISO 8601-1:2019").to_urn
# => "urn:iso:std:iso:8601:-1"Your existing Pubid::Iso::… / Pubid::Jis::… / Pubid.parse calls
resolve exactly as before — the flavor grammars moved into the monogem
under the same paths. The old Pubid::Iso::Identifier.create(…)
module function is gone — construct with .new(keyword args). Any
pubid-* ~> 1.x pin becomes pubid ~> 2.0 — the monogem is the only
line receiving updates.
- :
|
Warning
|
This gem is deprecated and no longer maintained. The per-flavor PubID gems have been superseded by pubid 2.0 — the unified PubID library implementing the publication identifiers of all standards bodies. Please use pubid ~> 2.0, and open issues and pull requests at metanorma/pubid. |
-
generate updated PubID
-
generate language specific PubID
-
generate dated vs undated PubIDs
The IECEE TRF pattern is:
IECEE TRF {number-and-part}{trf-version}[{test-type}][:{year}]
(Sample IECEE TRF PubID: IECEE TRF 60086-1&2A:2017)
Where
-
number-and-partis the number and part of the IEC standard, e.g.61000-3-33. If there are multiple parts, the & ampersand separator is used. When parsing, we should accept the , character here, but when generating the PubID, the & separator must be used -
trf-versionis typically the alphabet version of a single character length, whereAis the first version,Bis the second version and so on.
There are cases where the trf-version is {version-alphabet}{sub-version} where sub-version is a string, e.g. F_II (the sub-version is _II). In this case, the "full version" is considered to be the full string of trf-version, i.e. F_II. (in the case of IECEE TRF 61058-1F_II:2019)
-
test-typeis an optional string such as _EMC, _PS, _SOF that indicates a specialized type of TRF -
yearis optional for edition year.
The IECEx TRF pattern is:
IECEx TRF {number-and-part}{either '_' or 'v'}{std-edition}{trf-version}
Where
-
number-and-partis the number and part of the IEC standard, e.g.60079-0. If there are multiple parts, the , comma separator is used. -
either '_' or 'v'is either a_orvcharacter. In the IEC Webstore, they use a v character, e.g.IECEx TRF 60079-15v1:2002, but in the official IECEx identifier pattern it is_. -
std-editionis the edition number of the underlying IEC standard, an integer. -
trf-versionis typically the alphabet version of a single character length, whereAis the first version,Bis the second version and so on.-
There are cases where the
trf-versionis{version-alphabet}{sub-version}wheresub-versionis a string, e.g.A_DS(thesub-versionis_DS) orArev4_ds(thesub-versionisrev4_ds). In this case, the "full version" is considered to be the full string oftrf-version, i.e.A_DSorArev4_ds.
-