pubid 2.0.0.pre.alpha.8 → 2.0.0.pre.alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (672) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +33 -11
  3. data/conformance/pending.yaml +4 -0
  4. data/data/bipm/update_codes.yaml +9 -0
  5. data/data/iec/update_codes.yaml +3 -0
  6. data/data/ieee/update_codes.yaml +107 -1
  7. data/{archived-gems/pubid-nist → data/nist}/series.yaml +34 -0
  8. data/data/nist/update_codes.yaml +8 -0
  9. data/lib/pubid/adobe/builder.rb +52 -0
  10. data/lib/pubid/adobe/identifier.rb +47 -0
  11. data/lib/pubid/adobe/identifiers/publication.rb +31 -0
  12. data/lib/pubid/adobe/identifiers/tech_note.rb +32 -0
  13. data/lib/pubid/adobe/identifiers.rb +10 -0
  14. data/lib/pubid/adobe/parser.rb +136 -0
  15. data/lib/pubid/adobe/renderer.rb +39 -0
  16. data/lib/pubid/adobe/urn_generator.rb +42 -0
  17. data/lib/pubid/adobe/urn_parser.rb +69 -0
  18. data/lib/pubid/adobe.rb +61 -0
  19. data/lib/pubid/amca/builder.rb +4 -4
  20. data/lib/pubid/amca/identifier.rb +1 -3
  21. data/lib/pubid/amca/identifiers/base.rb +50 -33
  22. data/lib/pubid/amca/identifiers/interpretation.rb +18 -10
  23. data/lib/pubid/amca/identifiers/publication.rb +14 -10
  24. data/lib/pubid/amca/identifiers/standard.rb +3 -1
  25. data/lib/pubid/amca/identifiers.rb +0 -1
  26. data/lib/pubid/amca/parser.rb +1 -1
  27. data/lib/pubid/amca/renderer.rb +4 -4
  28. data/lib/pubid/amca/single_identifier.rb +1 -1
  29. data/lib/pubid/amca/urn_generator.rb +2 -2
  30. data/lib/pubid/amca.rb +5 -4
  31. data/lib/pubid/ansi/builder.rb +2 -2
  32. data/lib/pubid/ansi/identifier.rb +18 -0
  33. data/lib/pubid/ansi/parser.rb +1 -1
  34. data/lib/pubid/ansi/renderer.rb +2 -2
  35. data/lib/pubid/ansi.rb +5 -5
  36. data/lib/pubid/api/builder.rb +16 -2
  37. data/lib/pubid/api/identifier.rb +25 -4
  38. data/lib/pubid/api/identifiers/mpms.rb +10 -8
  39. data/lib/pubid/api/parser.rb +1 -1
  40. data/lib/pubid/api/renderer.rb +16 -7
  41. data/lib/pubid/api/single_identifier.rb +5 -12
  42. data/lib/pubid/api.rb +1 -0
  43. data/lib/pubid/ashrae/builder.rb +53 -32
  44. data/lib/pubid/ashrae/identifier.rb +3 -4
  45. data/lib/pubid/ashrae/identifiers/addenda_package.rb +7 -1
  46. data/lib/pubid/ashrae/identifiers/addendum.rb +9 -1
  47. data/lib/pubid/ashrae/identifiers/base.rb +94 -12
  48. data/lib/pubid/ashrae/identifiers/combined_addenda.rb +8 -1
  49. data/lib/pubid/ashrae/identifiers/errata.rb +9 -0
  50. data/lib/pubid/ashrae/identifiers/guideline.rb +3 -0
  51. data/lib/pubid/ashrae/identifiers/interpretation.rb +16 -0
  52. data/lib/pubid/ashrae/identifiers/standard.rb +3 -0
  53. data/lib/pubid/ashrae/identifiers.rb +0 -1
  54. data/lib/pubid/ashrae/parser.rb +37 -17
  55. data/lib/pubid/ashrae/renderer.rb +20 -20
  56. data/lib/pubid/ashrae/single_identifier.rb +1 -1
  57. data/lib/pubid/ashrae/supplement_identifier.rb +21 -6
  58. data/lib/pubid/ashrae/urn_generator.rb +8 -2
  59. data/lib/pubid/ashrae.rb +10 -4
  60. data/lib/pubid/asme/builder.rb +11 -2
  61. data/lib/pubid/asme/identifier.rb +9 -0
  62. data/lib/pubid/asme/identifiers/standard.rb +86 -2
  63. data/lib/pubid/asme/parser.rb +1 -1
  64. data/lib/pubid/asme/renderer.rb +3 -3
  65. data/lib/pubid/asme/single_identifier.rb +8 -1
  66. data/lib/pubid/asme/urn_generator.rb +2 -2
  67. data/lib/pubid/asme.rb +1 -0
  68. data/lib/pubid/astm/builder.rb +10 -3
  69. data/lib/pubid/astm/identifier.rb +9 -0
  70. data/lib/pubid/astm/identifiers/adjunct.rb +16 -1
  71. data/lib/pubid/astm/identifiers/code_number.rb +81 -0
  72. data/lib/pubid/astm/identifiers/data_series.rb +2 -0
  73. data/lib/pubid/astm/identifiers/iso_dual_published.rb +16 -0
  74. data/lib/pubid/astm/identifiers/manual.rb +10 -0
  75. data/lib/pubid/astm/identifiers/monograph.rb +2 -0
  76. data/lib/pubid/astm/identifiers/research_report.rb +10 -0
  77. data/lib/pubid/astm/identifiers/standard.rb +10 -0
  78. data/lib/pubid/astm/identifiers/technical_report.rb +2 -0
  79. data/lib/pubid/astm/identifiers/work_in_progress.rb +2 -0
  80. data/lib/pubid/astm/identifiers.rb +1 -0
  81. data/lib/pubid/astm/parser.rb +1 -1
  82. data/lib/pubid/astm/renderer.rb +1 -1
  83. data/lib/pubid/astm/single_identifier.rb +31 -1
  84. data/lib/pubid/astm/urn_generator.rb +7 -5
  85. data/lib/pubid/astm.rb +1 -0
  86. data/lib/pubid/bipm/builder.rb +163 -0
  87. data/lib/pubid/bipm/identifier.rb +285 -0
  88. data/lib/pubid/bipm/identifiers/committee_document.rb +36 -0
  89. data/lib/pubid/bipm/identifiers/guide.rb +35 -0
  90. data/lib/pubid/bipm/identifiers/meeting.rb +53 -0
  91. data/lib/pubid/bipm/identifiers/mep.rb +33 -0
  92. data/lib/pubid/bipm/identifiers/metrologia_article.rb +48 -0
  93. data/lib/pubid/bipm/identifiers/si_brochure.rb +33 -0
  94. data/lib/pubid/bipm/identifiers.rb +15 -0
  95. data/lib/pubid/bipm/parser.rb +237 -0
  96. data/lib/pubid/bipm/renderer.rb +118 -0
  97. data/lib/pubid/bipm/urn_generator.rb +58 -0
  98. data/lib/pubid/bipm/urn_parser.rb +60 -0
  99. data/lib/pubid/bipm.rb +92 -0
  100. data/lib/pubid/bsi/builder.rb +62 -52
  101. data/lib/pubid/bsi/identifier.rb +0 -1
  102. data/lib/pubid/bsi/identifiers/addendum_document.rb +2 -2
  103. data/lib/pubid/bsi/identifiers/adopted_european_norm.rb +36 -7
  104. data/lib/pubid/bsi/identifiers/adopted_international_standard.rb +7 -6
  105. data/lib/pubid/bsi/identifiers/amendment.rb +4 -4
  106. data/lib/pubid/bsi/identifiers/british_industrial_practice.rb +0 -1
  107. data/lib/pubid/bsi/identifiers/bundled_identifier.rb +10 -0
  108. data/lib/pubid/bsi/identifiers/committee_document.rb +10 -1
  109. data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +6 -0
  110. data/lib/pubid/bsi/identifiers/corrigendum.rb +4 -4
  111. data/lib/pubid/bsi/identifiers/expert_commentary.rb +5 -5
  112. data/lib/pubid/bsi/identifiers/handbook.rb +0 -2
  113. data/lib/pubid/bsi/identifiers/practice_guide.rb +0 -1
  114. data/lib/pubid/bsi/identifiers/set.rb +11 -0
  115. data/lib/pubid/bsi/identifiers/standalone_amendment.rb +10 -1
  116. data/lib/pubid/bsi/identifiers/supplement_document.rb +2 -2
  117. data/lib/pubid/bsi/identifiers/value_added_publication.rb +6 -6
  118. data/lib/pubid/bsi/parser.rb +1 -1
  119. data/lib/pubid/bsi/renderer.rb +71 -59
  120. data/lib/pubid/bsi/single_identifier.rb +64 -7
  121. data/lib/pubid/bsi/urn_generator.rb +11 -2
  122. data/lib/pubid/bsi.rb +7 -1
  123. data/lib/pubid/builder/base.rb +23 -11
  124. data/lib/pubid/bundled_identifier.rb +19 -9
  125. data/lib/pubid/calconnect/builder.rb +38 -0
  126. data/lib/pubid/calconnect/identifier.rb +121 -0
  127. data/lib/pubid/calconnect/identifiers/standard.rb +29 -0
  128. data/lib/pubid/calconnect/identifiers.rb +9 -0
  129. data/lib/pubid/calconnect/parser.rb +54 -0
  130. data/lib/pubid/calconnect/renderer.rb +36 -0
  131. data/lib/pubid/calconnect/urn_generator.rb +33 -0
  132. data/lib/pubid/calconnect/urn_parser.rb +34 -0
  133. data/lib/pubid/calconnect.rb +83 -0
  134. data/lib/pubid/ccsds/builder.rb +1 -1
  135. data/lib/pubid/ccsds/identifier.rb +10 -3
  136. data/lib/pubid/ccsds/identifiers/base.rb +4 -2
  137. data/lib/pubid/ccsds/identifiers/corrigendum.rb +4 -4
  138. data/lib/pubid/ccsds/parser.rb +1 -1
  139. data/lib/pubid/ccsds/single_identifier.rb +2 -2
  140. data/lib/pubid/ccsds/supplement_identifier.rb +6 -6
  141. data/lib/pubid/ccsds/urn_generator.rb +3 -3
  142. data/lib/pubid/ccsds.rb +1 -0
  143. data/lib/pubid/cen_cenelec/builder.rb +131 -72
  144. data/lib/pubid/cen_cenelec/identifier.rb +115 -3
  145. data/lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb +27 -16
  146. data/lib/pubid/cen_cenelec/identifiers/amendment.rb +46 -6
  147. data/lib/pubid/cen_cenelec/identifiers/base.rb +8 -9
  148. data/lib/pubid/cen_cenelec/identifiers/cen_report.rb +1 -1
  149. data/lib/pubid/cen_cenelec/identifiers/cen_workshop_agreement.rb +1 -1
  150. data/lib/pubid/cen_cenelec/identifiers/cenelec_harmonization_document.rb +1 -1
  151. data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +29 -14
  152. data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +47 -8
  153. data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +60 -3
  154. data/lib/pubid/cen_cenelec/identifiers/european_prestandard.rb +27 -2
  155. data/lib/pubid/cen_cenelec/identifiers/european_specification.rb +1 -1
  156. data/lib/pubid/cen_cenelec/identifiers/fragment.rb +15 -5
  157. data/lib/pubid/cen_cenelec/identifiers/guide.rb +1 -1
  158. data/lib/pubid/cen_cenelec/identifiers/harmonization_document.rb +1 -1
  159. data/lib/pubid/cen_cenelec/identifiers/technical_report.rb +1 -1
  160. data/lib/pubid/cen_cenelec/identifiers/technical_specification.rb +1 -1
  161. data/lib/pubid/cen_cenelec/parser.rb +1 -1
  162. data/lib/pubid/cen_cenelec/renderer.rb +55 -60
  163. data/lib/pubid/cen_cenelec/single_identifier.rb +20 -2
  164. data/lib/pubid/cen_cenelec/urn_generator.rb +66 -44
  165. data/lib/pubid/cen_cenelec.rb +104 -82
  166. data/lib/pubid/cie/builder.rb +149 -24
  167. data/lib/pubid/cie/identifier.rb +13 -4
  168. data/lib/pubid/cie/identifiers/bundle.rb +35 -5
  169. data/lib/pubid/cie/identifiers/code_attributes.rb +52 -0
  170. data/lib/pubid/cie/identifiers/conference.rb +11 -6
  171. data/lib/pubid/cie/identifiers/corrigendum.rb +17 -23
  172. data/lib/pubid/cie/identifiers/dual_published.rb +6 -6
  173. data/lib/pubid/cie/identifiers/identical.rb +9 -9
  174. data/lib/pubid/cie/identifiers/joint_published.rb +10 -10
  175. data/lib/pubid/cie/identifiers/proceedings.rb +41 -0
  176. data/lib/pubid/cie/identifiers/standard.rb +43 -8
  177. data/lib/pubid/cie/identifiers/supplement.rb +27 -25
  178. data/lib/pubid/cie/identifiers/tutorial_bundle.rb +7 -3
  179. data/lib/pubid/cie/identifiers.rb +2 -0
  180. data/lib/pubid/cie/parser.rb +55 -6
  181. data/lib/pubid/cie/single_identifier.rb +40 -1
  182. data/lib/pubid/cie/supplement_identifier.rb +29 -16
  183. data/lib/pubid/cie/urn_generator.rb +11 -8
  184. data/lib/pubid/cie.rb +7 -2
  185. data/lib/pubid/components/date.rb +21 -5
  186. data/lib/pubid/conformance/checks.rb +72 -0
  187. data/lib/pubid/conformance/corpus/case.rb +55 -0
  188. data/lib/pubid/conformance/corpus.rb +36 -0
  189. data/lib/pubid/conformance/generator.rb +212 -0
  190. data/lib/pubid/conformance/pending.rb +63 -0
  191. data/lib/pubid/conformance/runner.rb +153 -0
  192. data/lib/pubid/conformance.rb +55 -0
  193. data/lib/pubid/core.rb +2 -0
  194. data/lib/pubid/csa/builder.rb +48 -48
  195. data/lib/pubid/csa/composite_identifier.rb +18 -7
  196. data/lib/pubid/csa/identifier.rb +187 -80
  197. data/lib/pubid/csa/identifiers/bundled.rb +25 -9
  198. data/lib/pubid/csa/identifiers/canadian_adopted.rb +13 -13
  199. data/lib/pubid/csa/identifiers/cec.rb +44 -4
  200. data/lib/pubid/csa/identifiers/combined.rb +97 -69
  201. data/lib/pubid/csa/identifiers/csa_adopted.rb +4 -4
  202. data/lib/pubid/csa/identifiers/package.rb +4 -4
  203. data/lib/pubid/csa/parser.rb +12 -8
  204. data/lib/pubid/csa/renderer.rb +13 -5
  205. data/lib/pubid/csa/single_identifier.rb +93 -4
  206. data/lib/pubid/csa/urn_generator.rb +9 -2
  207. data/lib/pubid/csa/wrapper_identifier.rb +43 -10
  208. data/lib/pubid/csa.rb +7 -1
  209. data/lib/pubid/doi/builder.rb +18 -0
  210. data/lib/pubid/doi/identifier.rb +49 -0
  211. data/lib/pubid/doi/identifiers/resource.rb +30 -0
  212. data/lib/pubid/doi/identifiers.rb +9 -0
  213. data/lib/pubid/doi/parser.rb +52 -0
  214. data/lib/pubid/doi/renderer.rb +13 -0
  215. data/lib/pubid/doi.rb +56 -0
  216. data/lib/pubid/easc/builder.rb +55 -0
  217. data/lib/pubid/easc/identifier.rb +59 -0
  218. data/lib/pubid/easc/identifiers/pmg.rb +20 -0
  219. data/lib/pubid/easc/identifiers/rmg.rb +19 -0
  220. data/lib/pubid/easc/identifiers.rb +10 -0
  221. data/lib/pubid/easc/parser.rb +88 -0
  222. data/lib/pubid/easc/renderer.rb +48 -0
  223. data/lib/pubid/easc/urn_generator.rb +46 -0
  224. data/lib/pubid/easc/urn_parser.rb +57 -0
  225. data/lib/pubid/easc.rb +53 -0
  226. data/lib/pubid/ecma/builder.rb +45 -0
  227. data/lib/pubid/ecma/identifier.rb +147 -0
  228. data/lib/pubid/ecma/identifiers/memento.rb +30 -0
  229. data/lib/pubid/ecma/identifiers/standard.rb +31 -0
  230. data/lib/pubid/ecma/identifiers/technical_report.rb +31 -0
  231. data/lib/pubid/ecma/identifiers.rb +11 -0
  232. data/lib/pubid/ecma/parser.rb +76 -0
  233. data/lib/pubid/ecma/renderer.rb +67 -0
  234. data/lib/pubid/ecma/urn_generator.rb +46 -0
  235. data/lib/pubid/ecma/urn_parser.rb +51 -0
  236. data/lib/pubid/ecma.rb +68 -0
  237. data/lib/pubid/errors.rb +80 -0
  238. data/lib/pubid/etsi/builder.rb +13 -4
  239. data/lib/pubid/etsi/identifier.rb +1 -3
  240. data/lib/pubid/etsi/identifiers/base.rb +43 -11
  241. data/lib/pubid/etsi/identifiers/etsi_standard.rb +207 -4
  242. data/lib/pubid/etsi/identifiers/supplement_identifier.rb +45 -3
  243. data/lib/pubid/etsi/identifiers.rb +0 -1
  244. data/lib/pubid/etsi/parser.rb +9 -3
  245. data/lib/pubid/etsi/renderer.rb +8 -2
  246. data/lib/pubid/etsi.rb +6 -5
  247. data/lib/pubid/evs/builder.rb +26 -0
  248. data/lib/pubid/evs/identifier.rb +37 -0
  249. data/lib/pubid/evs/identifiers/national_adoption.rb +17 -0
  250. data/lib/pubid/evs/identifiers.rb +9 -0
  251. data/lib/pubid/evs/parser.rb +27 -0
  252. data/lib/pubid/evs/renderer.rb +30 -0
  253. data/lib/pubid/evs/urn_generator.rb +30 -0
  254. data/lib/pubid/evs/urn_parser.rb +80 -0
  255. data/lib/pubid/evs.rb +90 -0
  256. data/lib/pubid/export/exporter.rb +2 -1
  257. data/lib/pubid/export/flavor_exporter.rb +18 -3
  258. data/lib/pubid/export.rb +1 -0
  259. data/lib/pubid/format_detector.rb +1 -0
  260. data/lib/pubid/gb/builder.rb +45 -0
  261. data/lib/pubid/gb/identifier.rb +67 -0
  262. data/lib/pubid/gb/identifiers/standard.rb +34 -0
  263. data/lib/pubid/gb/identifiers.rb +9 -0
  264. data/lib/pubid/gb/parser.rb +63 -0
  265. data/lib/pubid/gb/renderer.rb +35 -0
  266. data/lib/pubid/gb.rb +88 -0
  267. data/lib/pubid/gost/builder.rb +185 -0
  268. data/lib/pubid/gost/identifier.rb +47 -0
  269. data/lib/pubid/gost/identifiers/foreign_reference.rb +25 -0
  270. data/lib/pubid/gost/identifiers/harmonized.rb +39 -0
  271. data/lib/pubid/gost/identifiers/identical_adoption.rb +39 -0
  272. data/lib/pubid/gost/identifiers/interstate_standard.rb +20 -0
  273. data/lib/pubid/gost/identifiers/national_standard.rb +19 -0
  274. data/lib/pubid/gost/identifiers.rb +13 -0
  275. data/lib/pubid/gost/parser.rb +105 -0
  276. data/lib/pubid/gost/renderer.rb +48 -0
  277. data/lib/pubid/gost/urn_generator.rb +46 -0
  278. data/lib/pubid/gost/urn_parser.rb +52 -0
  279. data/lib/pubid/gost.rb +50 -0
  280. data/lib/pubid/iala/builder.rb +22 -27
  281. data/lib/pubid/iala/identifier.rb +36 -8
  282. data/lib/pubid/iala/identifiers/advice.rb +1 -1
  283. data/lib/pubid/iala/identifiers/annex.rb +10 -10
  284. data/lib/pubid/iala/identifiers/general_assembly.rb +5 -2
  285. data/lib/pubid/iala/identifiers/guideline.rb +3 -1
  286. data/lib/pubid/iala/identifiers/letter.rb +1 -1
  287. data/lib/pubid/iala/identifiers/manual.rb +3 -1
  288. data/lib/pubid/iala/identifiers/model_course.rb +3 -1
  289. data/lib/pubid/iala/identifiers/recommendation.rb +3 -1
  290. data/lib/pubid/iala/identifiers/report.rb +1 -1
  291. data/lib/pubid/iala/identifiers/resolution.rb +1 -1
  292. data/lib/pubid/iala/identifiers/standard.rb +3 -1
  293. data/lib/pubid/iala/identifiers.rb +0 -1
  294. data/lib/pubid/iala/parser.rb +10 -2
  295. data/lib/pubid/iala/renderer.rb +1 -1
  296. data/lib/pubid/iala/urn_generator.rb +1 -1
  297. data/lib/pubid/iala/urn_parser.rb +24 -3
  298. data/lib/pubid/iala.rb +5 -4
  299. data/lib/pubid/iana/builder.rb +22 -0
  300. data/lib/pubid/iana/identifier.rb +140 -0
  301. data/lib/pubid/iana/identifiers/registry.rb +69 -0
  302. data/lib/pubid/iana/identifiers.rb +9 -0
  303. data/lib/pubid/iana/parser.rb +38 -0
  304. data/lib/pubid/iana/renderer.rb +32 -0
  305. data/lib/pubid/iana/urn_generator.rb +19 -0
  306. data/lib/pubid/iana/urn_parser.rb +24 -0
  307. data/lib/pubid/iana.rb +70 -0
  308. data/lib/pubid/identifier.rb +797 -26
  309. data/lib/pubid/identifier_metadata.rb +1 -0
  310. data/lib/pubid/idf/builder.rb +4 -4
  311. data/lib/pubid/idf/identifier.rb +18 -9
  312. data/lib/pubid/idf/parser.rb +3 -3
  313. data/lib/pubid/idf/renderer.rb +5 -5
  314. data/lib/pubid/idf/supplement_identifier.rb +3 -3
  315. data/lib/pubid/idf/urn_generator.rb +1 -1
  316. data/lib/pubid/idf.rb +7 -1
  317. data/lib/pubid/iec/builder.rb +49 -32
  318. data/lib/pubid/iec/components.rb +0 -1
  319. data/lib/pubid/iec/identifier.rb +112 -77
  320. data/lib/pubid/iec/identifiers/amendment.rb +6 -2
  321. data/lib/pubid/iec/identifiers/base.rb +2 -2
  322. data/lib/pubid/iec/identifiers/component_specification.rb +0 -10
  323. data/lib/pubid/iec/identifiers/conformity_assessment.rb +0 -10
  324. data/lib/pubid/iec/identifiers/consolidated_identifier.rb +6 -0
  325. data/lib/pubid/iec/identifiers/corrigendum.rb +2 -2
  326. data/lib/pubid/iec/identifiers/fragment_identifier.rb +13 -15
  327. data/lib/pubid/iec/identifiers/guide.rb +0 -16
  328. data/lib/pubid/iec/identifiers/international_standard.rb +22 -6
  329. data/lib/pubid/iec/identifiers/operational_document.rb +0 -10
  330. data/lib/pubid/iec/identifiers/publicly_available_specification.rb +0 -12
  331. data/lib/pubid/iec/identifiers/sheet_identifier.rb +12 -12
  332. data/lib/pubid/iec/identifiers/societal_technology_trend_report.rb +0 -10
  333. data/lib/pubid/iec/identifiers/systems_reference_document.rb +0 -10
  334. data/lib/pubid/iec/identifiers/technical_group.rb +30 -0
  335. data/lib/pubid/iec/identifiers/technical_report.rb +1 -18
  336. data/lib/pubid/iec/identifiers/technical_specification.rb +1 -18
  337. data/lib/pubid/iec/identifiers/technology_report.rb +0 -10
  338. data/lib/pubid/iec/identifiers/test_report_form.rb +0 -11
  339. data/lib/pubid/iec/identifiers/vap_identifier.rb +12 -12
  340. data/lib/pubid/iec/identifiers/white_paper.rb +0 -10
  341. data/lib/pubid/iec/identifiers/working_document.rb +24 -10
  342. data/lib/pubid/iec/identifiers.rb +1 -0
  343. data/lib/pubid/iec/parser.rb +53 -28
  344. data/lib/pubid/iec/renderer.rb +31 -18
  345. data/lib/pubid/iec/single_identifier.rb +34 -11
  346. data/lib/pubid/iec/supplement_identifier.rb +32 -19
  347. data/lib/pubid/iec/urn_generator.rb +227 -61
  348. data/lib/pubid/iec/urn_parser.rb +42 -4
  349. data/lib/pubid/iec.rb +2 -6
  350. data/lib/pubid/ieee/aiee/builder.rb +17 -3
  351. data/lib/pubid/ieee/aiee/identifier.rb +46 -62
  352. data/lib/pubid/ieee/aiee/parser.rb +1 -1
  353. data/lib/pubid/ieee/builder.rb +386 -69
  354. data/lib/pubid/ieee/compaction.rb +121 -0
  355. data/lib/pubid/ieee/components/draft.rb +47 -7
  356. data/lib/pubid/ieee/identifier.rb +1 -3
  357. data/lib/pubid/ieee/identifiers/adopted_standard.rb +62 -5
  358. data/lib/pubid/ieee/identifiers/amendment.rb +40 -0
  359. data/lib/pubid/ieee/identifiers/base.rb +148 -18
  360. data/lib/pubid/ieee/identifiers/code_number.rb +82 -0
  361. data/lib/pubid/ieee/identifiers/conformance_identifier.rb +6 -2
  362. data/lib/pubid/ieee/identifiers/corrigendum.rb +17 -2
  363. data/lib/pubid/ieee/identifiers/csa_dual_published.rb +24 -3
  364. data/lib/pubid/ieee/identifiers/dual_identifier.rb +3 -3
  365. data/lib/pubid/ieee/identifiers/dual_published.rb +58 -3
  366. data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +102 -5
  367. data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +25 -1
  368. data/lib/pubid/ieee/identifiers/joint_development.rb +64 -15
  369. data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +58 -6
  370. data/lib/pubid/ieee/identifiers/nesc/base.rb +90 -19
  371. data/lib/pubid/ieee/identifiers/nesc/draft.rb +20 -5
  372. data/lib/pubid/ieee/identifiers/nesc/edition.rb +32 -0
  373. data/lib/pubid/ieee/identifiers/nesc/handbook.rb +16 -5
  374. data/lib/pubid/ieee/identifiers/nesc/redline.rb +11 -2
  375. data/lib/pubid/ieee/identifiers/nesc/standard.rb +18 -3
  376. data/lib/pubid/ieee/identifiers/nesc.rb +1 -0
  377. data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +3 -3
  378. data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +14 -6
  379. data/lib/pubid/ieee/identifiers/redlined_standard.rb +4 -4
  380. data/lib/pubid/ieee/identifiers/si_standard.rb +4 -1
  381. data/lib/pubid/ieee/identifiers/standard.rb +4 -1
  382. data/lib/pubid/ieee/identifiers/supplement_identifier.rb +26 -7
  383. data/lib/pubid/ieee/identifiers.rb +2 -1
  384. data/lib/pubid/ieee/ire/builder.rb +7 -6
  385. data/lib/pubid/ieee/ire/identifier.rb +48 -33
  386. data/lib/pubid/ieee/ire/parser.rb +1 -1
  387. data/lib/pubid/ieee/nesc/builder.rb +33 -20
  388. data/lib/pubid/ieee/nesc/parser.rb +16 -15
  389. data/lib/pubid/ieee/parser.rb +462 -44
  390. data/lib/pubid/ieee/pre_parser.rb +1 -1
  391. data/lib/pubid/ieee/renderer.rb +158 -57
  392. data/lib/pubid/ieee/typed_stages.rb +12 -1
  393. data/lib/pubid/ieee/urn_generator.rb +35 -8
  394. data/lib/pubid/ieee.rb +63 -4
  395. data/lib/pubid/ieee_debug.rb +1 -0
  396. data/lib/pubid/ietf/builder.rb +78 -0
  397. data/lib/pubid/ietf/identifier.rb +5 -0
  398. data/lib/pubid/ietf/identifiers/base.rb +72 -0
  399. data/lib/pubid/ietf/identifiers/bcp.rb +36 -0
  400. data/lib/pubid/ietf/identifiers/fyi.rb +36 -0
  401. data/lib/pubid/ietf/identifiers/internet_draft.rb +45 -0
  402. data/lib/pubid/ietf/identifiers/rfc.rb +27 -0
  403. data/lib/pubid/ietf/identifiers/serialization.rb +51 -0
  404. data/lib/pubid/ietf/identifiers/std.rb +36 -0
  405. data/lib/pubid/ietf/identifiers.rb +14 -0
  406. data/lib/pubid/ietf/parser.rb +61 -0
  407. data/lib/pubid/ietf/renderer.rb +64 -0
  408. data/lib/pubid/ietf/urn_generator.rb +37 -0
  409. data/lib/pubid/ietf/urn_parser.rb +43 -0
  410. data/lib/pubid/ietf.rb +86 -0
  411. data/lib/pubid/iho/identifier.rb +1 -3
  412. data/lib/pubid/iho/identifiers/base.rb +11 -10
  413. data/lib/pubid/iho/identifiers/bibliographic.rb +1 -1
  414. data/lib/pubid/iho/identifiers/circular_letter.rb +1 -1
  415. data/lib/pubid/iho/identifiers/miscellaneous.rb +1 -1
  416. data/lib/pubid/iho/identifiers/publication.rb +1 -1
  417. data/lib/pubid/iho/identifiers/standard.rb +1 -1
  418. data/lib/pubid/iho/identifiers.rb +0 -1
  419. data/lib/pubid/iho/parser.rb +1 -1
  420. data/lib/pubid/iho.rb +8 -7
  421. data/lib/pubid/isbn/builder.rb +44 -0
  422. data/lib/pubid/isbn/check_digit.rb +53 -0
  423. data/lib/pubid/isbn/identifier.rb +81 -0
  424. data/lib/pubid/isbn/identifiers/book.rb +30 -0
  425. data/lib/pubid/isbn/identifiers.rb +9 -0
  426. data/lib/pubid/isbn/parser.rb +45 -0
  427. data/lib/pubid/isbn/renderer.rb +16 -0
  428. data/lib/pubid/isbn.rb +53 -0
  429. data/lib/pubid/iso/builder.rb +9 -4
  430. data/lib/pubid/iso/bundled_identifier.rb +5 -3
  431. data/lib/pubid/iso/combined_identifier.rb +6 -4
  432. data/lib/pubid/iso/identifier.rb +29 -8
  433. data/lib/pubid/iso/identifiers/directives_supplement.rb +12 -12
  434. data/lib/pubid/iso/normalizer.rb +2 -2
  435. data/lib/pubid/iso/parser.rb +17 -13
  436. data/lib/pubid/iso/supplement_identifier.rb +19 -6
  437. data/lib/pubid/iso/urn_generator.rb +4 -1
  438. data/lib/pubid/iso/urn_parser.rb +1 -1
  439. data/lib/pubid/iso.rb +7 -1
  440. data/lib/pubid/itu/builder.rb +230 -29
  441. data/lib/pubid/itu/components/code.rb +48 -5
  442. data/lib/pubid/itu/components/designation.rb +35 -0
  443. data/lib/pubid/itu/components.rb +1 -0
  444. data/lib/pubid/itu/identifier.rb +1 -3
  445. data/lib/pubid/itu/identifiers/addendum.rb +15 -0
  446. data/lib/pubid/itu/identifiers/amendment.rb +7 -29
  447. data/lib/pubid/itu/identifiers/annex.rb +13 -2
  448. data/lib/pubid/itu/identifiers/annex_of_recommendation.rb +87 -0
  449. data/lib/pubid/itu/identifiers/appendix_of_recommendation.rb +92 -0
  450. data/lib/pubid/itu/identifiers/base.rb +357 -25
  451. data/lib/pubid/itu/identifiers/combined_identifier.rb +99 -23
  452. data/lib/pubid/itu/identifiers/corrigendum.rb +16 -23
  453. data/lib/pubid/itu/identifiers/errata.rb +15 -0
  454. data/lib/pubid/itu/identifiers/handbook.rb +38 -0
  455. data/lib/pubid/itu/identifiers/question.rb +63 -0
  456. data/lib/pubid/itu/identifiers/recommendation.rb +3 -2
  457. data/lib/pubid/itu/identifiers/report.rb +39 -0
  458. data/lib/pubid/itu/identifiers/special_publication.rb +3 -1
  459. data/lib/pubid/itu/identifiers/standard_serialization.rb +58 -0
  460. data/lib/pubid/itu/identifiers/supplement.rb +119 -14
  461. data/lib/pubid/itu/identifiers.rb +10 -1
  462. data/lib/pubid/itu/model.rb +1 -1
  463. data/lib/pubid/itu/parser.rb +481 -27
  464. data/lib/pubid/itu/urn_generator.rb +36 -6
  465. data/lib/pubid/itu/urn_parser.rb +8 -0
  466. data/lib/pubid/itu.rb +12 -3
  467. data/lib/pubid/jcgm/builder.rb +24 -14
  468. data/lib/pubid/jcgm/identifier.rb +10 -0
  469. data/lib/pubid/jcgm/identifiers/amendment.rb +0 -2
  470. data/lib/pubid/jcgm/identifiers/corrigendum.rb +34 -0
  471. data/lib/pubid/jcgm/identifiers/gum_guide.rb +3 -3
  472. data/lib/pubid/jcgm/identifiers/meeting.rb +47 -0
  473. data/lib/pubid/jcgm/identifiers.rb +2 -0
  474. data/lib/pubid/jcgm/parser.rb +74 -7
  475. data/lib/pubid/jcgm/renderer.rb +33 -12
  476. data/lib/pubid/jcgm/single_identifier.rb +84 -6
  477. data/lib/pubid/jcgm/supplement_identifier.rb +39 -4
  478. data/lib/pubid/jcgm/urn_generator.rb +21 -13
  479. data/lib/pubid/jcgm/urn_parser.rb +164 -10
  480. data/lib/pubid/jcgm.rb +10 -0
  481. data/lib/pubid/jis/identifier.rb +62 -3
  482. data/lib/pubid/jis/parser.rb +1 -1
  483. data/lib/pubid/jis.rb +1 -0
  484. data/lib/pubid/nist/builder.rb +29 -9
  485. data/lib/pubid/nist/caster.rb +7 -45
  486. data/lib/pubid/nist/circular_supplement_builder.rb +7 -5
  487. data/lib/pubid/nist/components/stage.rb +2 -2
  488. data/lib/pubid/nist/components/supplement.rb +5 -2
  489. data/lib/pubid/nist/configuration.rb +6 -2
  490. data/lib/pubid/nist/identifier.rb +1 -3
  491. data/lib/pubid/nist/identifiers/base.rb +133 -39
  492. data/lib/pubid/nist/identifiers/circular.rb +10 -3
  493. data/lib/pubid/nist/identifiers/circular_supplement.rb +14 -5
  494. data/lib/pubid/nist/identifiers/commercial_standard.rb +1 -1
  495. data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +1 -1
  496. data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +8 -2
  497. data/lib/pubid/nist/identifiers/crpl_report.rb +8 -2
  498. data/lib/pubid/nist/identifiers/dated_document.rb +1 -1
  499. data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +1 -1
  500. data/lib/pubid/nist/identifiers/grant_contractor_report.rb +1 -1
  501. data/lib/pubid/nist/identifiers/handbook.rb +10 -3
  502. data/lib/pubid/nist/identifiers/internal_report.rb +13 -6
  503. data/lib/pubid/nist/identifiers/letter_circular.rb +1 -1
  504. data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +15 -7
  505. data/lib/pubid/nist/identifiers/monograph.rb +15 -8
  506. data/lib/pubid/nist/identifiers/ncstar.rb +2 -2
  507. data/lib/pubid/nist/identifiers/nsrds.rb +1 -1
  508. data/lib/pubid/nist/identifiers/owmwp.rb +1 -1
  509. data/lib/pubid/nist/identifiers/report.rb +15 -7
  510. data/lib/pubid/nist/identifiers/special_publication.rb +10 -1
  511. data/lib/pubid/nist/identifiers/technical_note.rb +1 -1
  512. data/lib/pubid/nist/identifiers.rb +0 -1
  513. data/lib/pubid/nist/parser.rb +27 -4
  514. data/lib/pubid/nist/preprocessor.rb +15 -0
  515. data/lib/pubid/nist/router.rb +2 -2
  516. data/lib/pubid/nist/series/ir.rb +0 -3
  517. data/lib/pubid/nist/supplement_identifier.rb +24 -9
  518. data/lib/pubid/nist.rb +19 -13
  519. data/lib/pubid/oasis/builder.rb +79 -0
  520. data/lib/pubid/oasis/identifier.rb +160 -0
  521. data/lib/pubid/oasis/identifiers/standard.rb +29 -0
  522. data/lib/pubid/oasis/identifiers.rb +9 -0
  523. data/lib/pubid/oasis/parser.rb +34 -0
  524. data/lib/pubid/oasis/renderer.rb +29 -0
  525. data/lib/pubid/oasis/urn_generator.rb +25 -0
  526. data/lib/pubid/oasis/urn_parser.rb +22 -0
  527. data/lib/pubid/oasis.rb +80 -0
  528. data/lib/pubid/ogc/builder.rb +33 -0
  529. data/lib/pubid/ogc/identifier.rb +81 -0
  530. data/lib/pubid/ogc/identifiers/document.rb +26 -0
  531. data/lib/pubid/ogc/identifiers.rb +10 -0
  532. data/lib/pubid/ogc/parser.rb +40 -0
  533. data/lib/pubid/ogc/renderer.rb +33 -0
  534. data/lib/pubid/ogc/urn_generator.rb +14 -0
  535. data/lib/pubid/ogc/urn_parser.rb +22 -0
  536. data/lib/pubid/ogc.rb +72 -0
  537. data/lib/pubid/oiml/builder.rb +36 -8
  538. data/lib/pubid/oiml/identifier.rb +9 -1
  539. data/lib/pubid/oiml/identifiers/basic_publication.rb +2 -0
  540. data/lib/pubid/oiml/identifiers/bulletin.rb +36 -0
  541. data/lib/pubid/oiml/identifiers/code_number.rb +90 -0
  542. data/lib/pubid/oiml/identifiers/document.rb +2 -0
  543. data/lib/pubid/oiml/identifiers/expert_report.rb +2 -0
  544. data/lib/pubid/oiml/identifiers/guide.rb +2 -0
  545. data/lib/pubid/oiml/identifiers/recommendation.rb +2 -0
  546. data/lib/pubid/oiml/identifiers/seminar_report.rb +2 -0
  547. data/lib/pubid/oiml/identifiers/vocabulary.rb +2 -0
  548. data/lib/pubid/oiml/identifiers.rb +1 -0
  549. data/lib/pubid/oiml/parser.rb +12 -13
  550. data/lib/pubid/oiml/renderer.rb +13 -13
  551. data/lib/pubid/oiml/single_identifier.rb +41 -37
  552. data/lib/pubid/oiml/supplement_identifier.rb +36 -9
  553. data/lib/pubid/oiml/urn_parser.rb +23 -6
  554. data/lib/pubid/oiml.rb +10 -0
  555. data/lib/pubid/omg/builder.rb +20 -0
  556. data/lib/pubid/omg/identifier.rb +61 -0
  557. data/lib/pubid/omg/identifiers/specification.rb +32 -0
  558. data/lib/pubid/omg/identifiers.rb +9 -0
  559. data/lib/pubid/omg/parser.rb +93 -0
  560. data/lib/pubid/omg/renderer.rb +31 -0
  561. data/lib/pubid/omg.rb +52 -0
  562. data/lib/pubid/parser/grammar.rb +74 -0
  563. data/lib/pubid/parser.rb +2 -0
  564. data/lib/pubid/parsers/mr_string.rb +120 -7
  565. data/lib/pubid/plateau/builder.rb +8 -4
  566. data/lib/pubid/plateau/identifier.rb +1 -3
  567. data/lib/pubid/plateau/identifiers/base.rb +1 -6
  568. data/lib/pubid/plateau/identifiers/handbook.rb +1 -1
  569. data/lib/pubid/plateau/identifiers/technical_report.rb +1 -1
  570. data/lib/pubid/plateau/identifiers.rb +0 -1
  571. data/lib/pubid/plateau/parser.rb +16 -6
  572. data/lib/pubid/plateau/renderer.rb +1 -1
  573. data/lib/pubid/plateau/supplement_identifier.rb +11 -11
  574. data/lib/pubid/plateau.rb +14 -4
  575. data/lib/pubid/prefixes_support.rb +1 -0
  576. data/lib/pubid/renderers/annotator.rb +233 -0
  577. data/lib/pubid/renderers/base.rb +13 -0
  578. data/lib/pubid/renderers/directives_renderer.rb +3 -3
  579. data/lib/pubid/renderers/human_readable.rb +6 -4
  580. data/lib/pubid/renderers/mr_string.rb +54 -6
  581. data/lib/pubid/renderers/supplement_renderer.rb +1 -1
  582. data/lib/pubid/renderers.rb +1 -0
  583. data/lib/pubid/rendering/numbering.rb +25 -7
  584. data/lib/pubid/rendering/supplement.rb +4 -4
  585. data/lib/pubid/rendering.rb +1 -0
  586. data/lib/pubid/sae/builder.rb +1 -1
  587. data/lib/pubid/sae/identifier.rb +1 -3
  588. data/lib/pubid/sae/identifiers/base.rb +19 -9
  589. data/lib/pubid/sae/identifiers.rb +0 -1
  590. data/lib/pubid/sae/parser.rb +1 -1
  591. data/lib/pubid/sae.rb +4 -3
  592. data/lib/pubid/schema/declaration.rb +33 -0
  593. data/lib/pubid/schema/error.rb +14 -0
  594. data/lib/pubid/schema/identifier_type.rb +23 -0
  595. data/lib/pubid/schema/loader.rb +117 -0
  596. data/lib/pubid/schema/typed_stage.rb +24 -0
  597. data/lib/pubid/schema.rb +25 -0
  598. data/lib/pubid/tgpp/builder.rb +41 -0
  599. data/lib/pubid/tgpp/identifier.rb +107 -0
  600. data/lib/pubid/tgpp/identifiers/technical_report.rb +32 -0
  601. data/lib/pubid/tgpp/identifiers/technical_specification.rb +33 -0
  602. data/lib/pubid/tgpp/identifiers.rb +11 -0
  603. data/lib/pubid/tgpp/parser.rb +78 -0
  604. data/lib/pubid/tgpp/renderer.rb +52 -0
  605. data/lib/pubid/tgpp/urn_generator.rb +39 -0
  606. data/lib/pubid/tgpp/urn_parser.rb +30 -0
  607. data/lib/pubid/tgpp.rb +84 -0
  608. data/lib/pubid/type_resolver.rb +74 -0
  609. data/lib/pubid/un/builder.rb +42 -0
  610. data/lib/pubid/un/identifier.rb +40 -0
  611. data/lib/pubid/un/identifiers/document.rb +24 -0
  612. data/lib/pubid/un/identifiers.rb +9 -0
  613. data/lib/pubid/un/parser.rb +25 -0
  614. data/lib/pubid/un/renderer.rb +11 -0
  615. data/lib/pubid/un.rb +47 -0
  616. data/lib/pubid/urn_parser/errors.rb +8 -1
  617. data/lib/pubid/urn_parser.rb +1 -0
  618. data/lib/pubid/utils.rb +1 -0
  619. data/lib/pubid/version.rb +1 -1
  620. data/lib/pubid/w3c/builder.rb +55 -0
  621. data/lib/pubid/w3c/identifier.rb +130 -0
  622. data/lib/pubid/w3c/identifiers/candidate_recommendation.rb +31 -0
  623. data/lib/pubid/w3c/identifiers/candidate_recommendation_draft.rb +31 -0
  624. data/lib/pubid/w3c/identifiers/draft_note.rb +31 -0
  625. data/lib/pubid/w3c/identifiers/note.rb +30 -0
  626. data/lib/pubid/w3c/identifiers/obsolete_recommendation.rb +31 -0
  627. data/lib/pubid/w3c/identifiers/proposed_edited_recommendation.rb +31 -0
  628. data/lib/pubid/w3c/identifiers/proposed_recommendation.rb +31 -0
  629. data/lib/pubid/w3c/identifiers/recommendation.rb +31 -0
  630. data/lib/pubid/w3c/identifiers/standard.rb +12 -0
  631. data/lib/pubid/w3c/identifiers/superseded_recommendation.rb +31 -0
  632. data/lib/pubid/w3c/identifiers/working_draft.rb +30 -0
  633. data/lib/pubid/w3c/identifiers.rb +25 -0
  634. data/lib/pubid/w3c/parser.rb +43 -0
  635. data/lib/pubid/w3c/renderer.rb +35 -0
  636. data/lib/pubid/w3c/urn_generator.rb +18 -0
  637. data/lib/pubid/w3c/urn_parser.rb +36 -0
  638. data/lib/pubid/w3c.rb +68 -0
  639. data/lib/pubid/xsf/builder.rb +17 -0
  640. data/lib/pubid/xsf/identifier.rb +66 -0
  641. data/lib/pubid/xsf/identifiers/xep.rb +31 -0
  642. data/lib/pubid/xsf/identifiers.rb +9 -0
  643. data/lib/pubid/xsf/parser.rb +38 -0
  644. data/lib/pubid/xsf/renderer.rb +23 -0
  645. data/lib/pubid/xsf/urn_generator.rb +13 -0
  646. data/lib/pubid/xsf/urn_parser.rb +18 -0
  647. data/lib/pubid/xsf.rb +82 -0
  648. data/lib/pubid.rb +424 -22
  649. data/lib/tasks/conformance.rake +34 -0
  650. data/lib/tasks/docs.rake +3 -3
  651. data/lib/tasks/schema.rake +88 -0
  652. data/schema/core/joint_prefixes.yaml +24 -0
  653. data/schema/iec.yaml +1017 -0
  654. data/schema/iso.yaml +1586 -0
  655. data/schema/schema.schema.yaml +96 -0
  656. metadata +241 -19
  657. data/archived-gems/pubid-ccsds/update_codes.yaml +0 -1
  658. data/archived-gems/pubid-iec/stages.yaml +0 -129
  659. data/archived-gems/pubid-iec/update_codes.yaml +0 -67
  660. data/archived-gems/pubid-ieee/update_codes.yaml +0 -104
  661. data/archived-gems/pubid-iso/stages.yaml +0 -106
  662. data/archived-gems/pubid-iso/update_codes.yaml +0 -4
  663. data/archived-gems/pubid-itu/i18n.yaml +0 -13
  664. data/archived-gems/pubid-itu/series.yaml +0 -42
  665. data/archived-gems/pubid-nist/publishers.yaml +0 -6
  666. data/archived-gems/pubid-nist/update_codes.yaml +0 -93
  667. data/archived-gems/pubid-plateau/update_codes.yaml +0 -6
  668. data/lib/pubid/cen_cenelec/supplement_identifier.rb +0 -48
  669. data/lib/pubid/cie/components/code.rb +0 -80
  670. data/lib/pubid/iala/identifiers/base.rb +0 -14
  671. data/lib/pubid/iec/components/code.rb +0 -36
  672. /data/{archived-gems/pubid-nist → data/nist}/stages.yaml +0 -0
@@ -9,11 +9,15 @@ module Pubid
9
9
  # "base". No-op the delegated maps so they serialize once. (Mirrors
10
10
  # Iso::BundledIdentifier.) Fragment keeps its own stage/edition, so it
11
11
  # suppresses a subset inline instead of including this.
12
+ #
13
+ # number/part/subpart are NOT here, and deliberately so: their maps live on
14
+ # SingleIdentifier, which the four wrappers do not inherit from, so the
15
+ # exclusion is structural rather than a denylist that can drift. Only a
16
+ # converter can be no-opped this way, so a key that needs `with:` for
17
+ # another reason — year, publisher, copublishers, stage — still lists here.
18
+ # (`month`/`day`/`undated` are missing from that list and leak a duplicated
19
+ # top-level key on a wrapper; pre-existing, see docs/flavors/iec.md.)
12
20
  module DelegatedFieldSuppression
13
- def number_to_kv(_model, _doc); end
14
- def part_to_kv(_model, _doc); end
15
- def subpart_to_kv(_model, _doc); end
16
- def stage_iteration_to_kv(_model, _doc); end
17
21
  def year_to_kv(_model, _doc); end
18
22
  def publisher_to_kv(_model, _doc); end
19
23
  def copublishers_to_kv(_model, _doc); end
@@ -23,14 +27,33 @@ module Pubid
23
27
  class Identifier < ::Pubid::Identifier
24
28
  # Override base types with IEC-specific ones. publisher defaults to the
25
29
  # type's implied publisher (IEC), so an omitted publisher key reconstructs
26
- # correctly on from_hash. number/part/subpart are IEC codes.
30
+ # correctly on from_hash.
27
31
  attribute :publisher, ::Pubid::Iec::Components::Publisher,
28
32
  default: -> { self.class.default_publisher }
29
33
  attribute :copublishers, ::Pubid::Iec::Components::Publisher,
30
34
  collection: true
31
- attribute :number, ::Pubid::Iec::Components::Code
32
- attribute :part, ::Pubid::Iec::Components::Code
33
- attribute :subpart, ::Pubid::Iec::Components::Code
35
+
36
+ # number/part/subpart are plain strings, not a Components::Code.
37
+ # ::Pubid::Identifier declares them as a Code, so this is a REDECLARATION
38
+ # — safe here because this class body lives in this one file and is never
39
+ # reopened, so lutaml's deep-dup of the attribute table into each subclass
40
+ # always sees the complete table.
41
+ #
42
+ # The Code they used to hold was an empty box. Measured over all 12,331
43
+ # parseable IEC pass fixtures, number/part/subpart were a Code 9,975 /
44
+ # 5,422 / 2,416 times and NOT ONE populated `prefix`, `parts`, `part` or
45
+ # `subpart` inside it; `Iec::Components::Code` existed solely to render a
46
+ # `prefix` that no construction path ever set, and is deleted.
47
+ #
48
+ # The split was a live defect, not just clutter: `parse` produced a Code
49
+ # while `new` left a String (a `:string` assigned to a Code-typed
50
+ # attribute stays a String), so a hand-built identifier was not `==` the
51
+ # parsed one — and `#matches?` is `exclude(*ignore) == other.exclude(...)`,
52
+ # so every match between them silently returned false while `to_s`,
53
+ # `to_urn` and `to_hash` all agreed. See spec/pubid/iec/number_string_spec.
54
+ attribute :number, :string
55
+ attribute :part, :string
56
+ attribute :subpart, :string
34
57
 
35
58
  # The publisher implied when none is serialized (IEC for every type).
36
59
  def self.default_publisher
@@ -45,15 +68,17 @@ module Pubid
45
68
 
46
69
  # The class's published typed_stage (canonical surface form), or nil for
47
70
  # types without a published stage.
71
+ #
72
+ # `original_abbr` is deliberately LEFT NIL. It records the spelling the
73
+ # input used, it is not serialized, and the parse path (Builder#
74
+ # locate_typed_stage) never writes it — so setting it here alone made
75
+ # `from_hash(to_hash) != parse` for every IEC identifier. The `dup` stays:
76
+ # TYPED_STAGES is frozen, its elements are not.
48
77
  def self.published_typed_stage
49
78
  return nil unless const_defined?(:TYPED_STAGES)
50
79
 
51
80
  ts = self::TYPED_STAGES.find { |t| t.stage_code.to_s == "published" }
52
- return nil unless ts
53
-
54
- ts = ts.dup
55
- ts.original_abbr = ts.canonical_abbreviation
56
- ts
81
+ ts&.dup
57
82
  end
58
83
 
59
84
  # type and generic stage are derived from typed_stage, never stored — so
@@ -84,6 +109,7 @@ module Pubid
84
109
  "pubid:iec:societal-technology-trend-report" => "Pubid::Iec::Identifiers::SocietalTechnologyTrendReport",
85
110
  "pubid:iec:systems-reference-document" => "Pubid::Iec::Identifiers::SystemsReferenceDocument",
86
111
  "pubid:iec:technology-report" => "Pubid::Iec::Identifiers::TechnologyReport",
112
+ "pubid:iec:technical-group" => "Pubid::Iec::Identifiers::TechnicalGroup",
87
113
  "pubid:iec:test-report-form" => "Pubid::Iec::Identifiers::TestReportForm",
88
114
  "pubid:iec:white-paper" => "Pubid::Iec::Identifiers::WhitePaper",
89
115
  "pubid:iec:working-document" => "Pubid::Iec::Identifiers::WorkingDocument",
@@ -116,21 +142,38 @@ module Pubid
116
142
 
117
143
  # The base Pubid::Identifier no longer auto-maps attributes, so each
118
144
  # flavor's top class declares its own key_value mapping. Subclasses merge
119
- # their own blocks on top of this one (e.g. SupplementIdentifier adds
120
- # base; VapIdentifier adds vap), so list every base attribute IEC
121
- # serializes here once. Code/Date are flattened to plain scalars; the
122
- # verbose type/stage trees are not mapped (type/stage are recomputed from
123
- # typed_stage, which serializes as just its code under "stage").
145
+ # their own blocks on top of this one — lutaml APPENDS a subclass's maps
146
+ # to the parent's (e.g. SingleIdentifier adds number/part/subpart,
147
+ # SupplementIdentifier adds base, VapIdentifier adds vap) — so list every
148
+ # attribute EVERY IEC type serializes here once, and put a key that only
149
+ # some types own on the class that owns it.
150
+ #
151
+ # Date is flattened to plain scalars; the verbose type/stage trees are not
152
+ # mapped (type/stage are recomputed from typed_stage, which serializes as
153
+ # just its code under "stage").
154
+ #
155
+ # A converter (`with:`) is for a custom class, or for splitting one
156
+ # attribute across several keys. A primitive takes a plain map: a nil and
157
+ # a default-valued attribute are both dropped by
158
+ # ::Pubid::Identifier#to_hash, so no converter is needed to omit them.
124
159
  key_value do
125
160
  map "_type", to: :_type, polymorphic_map: IEC_TYPE_MAP
126
- # Code components serialize as their plain string value, not {value,...}.
127
- map "number", with: { to: :number_to_kv, from: :number_from_kv }
128
- map "part", with: { to: :part_to_kv, from: :part_from_kv }
129
- map "subpart", with: { to: :subpart_to_kv, from: :subpart_from_kv }
130
- map "stage_iteration",
131
- with: { to: :stage_iteration_to_kv, from: :stage_iteration_from_kv }
132
- # IEC dates are year-only, so flatten the Date component to a scalar year.
161
+ # number/part/subpart are NOT mapped here — they live on
162
+ # SingleIdentifier, the seam that excludes the four delegating wrappers.
163
+ # See the comment on that block.
164
+ #
165
+ # stage_iteration is a degenerate Components::Iteration (one :string
166
+ # field, `number`), so the shared FLAT_SCALAR_COMPONENTS rule on
167
+ # ::Pubid::Identifier flattens it to a bare scalar and inflates it back.
168
+ # A plain map is enough; no converter.
169
+ map "stage_iteration", to: :stage_iteration, render_default: false
170
+ # date serialized flat as year/month/day, nils omitted.
133
171
  map "year", with: { to: :year_to_kv, from: :year_from_kv }
172
+ map "month", with: { to: :month_to_kv, from: :month_from_kv }
173
+ map "day", with: { to: :day_to_kv, from: :day_from_kv }
174
+ # IEC undated reference (e.g. IEC 60050:--). The `false` default is
175
+ # omitted; only the meaningful `true` round-trips via to_hash.
176
+ map "undated", with: { to: :undated_to_kv, from: :undated_from_kv }
134
177
  map "edition", to: :edition, render_default: false
135
178
  map "languages", to: :languages, render_default: false
136
179
  # publisher emitted only when the primary isn't the IEC default;
@@ -142,59 +185,62 @@ module Pubid
142
185
  # serialize only the unique typed-stage code under "stage" and recompute
143
186
  # the rest on load. _type already pins the document type.
144
187
  map "stage", with: { to: :stage_to_kv, from: :stage_from_kv }
145
- # Omit the `false` default; only the meaningful `true` is serialized.
146
- map "all_parts", with: { to: :all_parts_to_kv, from: :all_parts_from_kv }
188
+ # A Boolean attribute whose `false` default ::Pubid::Identifier#to_hash
189
+ # already drops, so a plain map suffices (the GB spelling).
190
+ map "all_parts", to: :all_parts, render_default: false
147
191
  end
148
192
 
149
- # --- Code components <-> plain string ---
150
- def number_to_kv(model, doc) = emit_code(doc, "number", model.number)
151
- def number_from_kv(model, value) = model.number = build_code(value)
152
- def part_to_kv(model, doc) = emit_code(doc, "part", model.part)
153
- def part_from_kv(model, value) = model.part = build_code(value)
154
- def subpart_to_kv(model, doc) = emit_code(doc, "subpart", model.subpart)
155
- def subpart_from_kv(model, value) = model.subpart = build_code(value)
156
-
157
- def emit_code(doc, key, code)
158
- v = code.is_a?(::Pubid::Components::Code) ? code.value : code
159
- return if v.nil? || v.to_s.empty?
193
+ # --- date serialized flat as year/month/day ---
194
+ def year_to_kv(model, doc)
195
+ y = model.date&.year
196
+ return if y.nil? || y.to_s.empty?
160
197
 
161
- doc.add_child(Lutaml::KeyValue::DataModel::Element.new(key, v.to_s))
198
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("year", y.to_s))
162
199
  end
163
200
 
164
- def build_code(value)
201
+ def year_from_kv(model, value)
165
202
  return if value.nil? || value.to_s.empty?
166
203
 
167
- ::Pubid::Iec::Components::Code.new(value: value.to_s)
204
+ (model.date ||= ::Pubid::Components::Date.new).year = value.to_s
168
205
  end
169
206
 
170
- def stage_iteration_to_kv(model, doc)
171
- iter = model.stage_iteration
172
- v = iter.is_a?(::Pubid::Components::Iteration) ? iter.number : iter
173
- return if v.nil? || v.to_s.empty?
207
+ def month_to_kv(model, doc)
208
+ m = model.date&.month
209
+ return if m.nil? || m.to_s.empty?
174
210
 
175
- doc.add_child(Lutaml::KeyValue::DataModel::Element.new("stage_iteration",
176
- v.to_s))
211
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("month", m.to_s))
177
212
  end
178
213
 
179
- def stage_iteration_from_kv(model, value)
214
+ def month_from_kv(model, value)
180
215
  return if value.nil? || value.to_s.empty?
181
216
 
182
- model.stage_iteration =
183
- ::Pubid::Components::Iteration.new(number: value.to_s)
217
+ (model.date ||= ::Pubid::Components::Date.new).month = value.to_s
184
218
  end
185
219
 
186
- # --- date <-> scalar year (IEC dates are year-only) ---
187
- def year_to_kv(model, doc)
188
- y = model.date&.year
189
- return if y.nil? || y.to_s.empty?
220
+ def day_to_kv(model, doc)
221
+ d = model.date&.day
222
+ return if d.nil? || d.to_s.empty?
190
223
 
191
- doc.add_child(Lutaml::KeyValue::DataModel::Element.new("year", y.to_s))
224
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("day", d.to_s))
192
225
  end
193
226
 
194
- def year_from_kv(model, value)
227
+ def day_from_kv(model, value)
195
228
  return if value.nil? || value.to_s.empty?
196
229
 
197
- (model.date ||= ::Pubid::Components::Date.new).year = value.to_s
230
+ (model.date ||= ::Pubid::Components::Date.new).day = value.to_s
231
+ end
232
+
233
+ # --- date undated flag (IEC undated reference, e.g. IEC 60050:--) ---
234
+ # The `false` default is omitted; only the meaningful `true` round-trips
235
+ # via to_hash / from_hash.
236
+ def undated_to_kv(model, doc)
237
+ return unless model.date&.undated?
238
+
239
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("undated", true))
240
+ end
241
+
242
+ def undated_from_kv(model, value)
243
+ (model.date ||= ::Pubid::Components::Date.new).undated = value.to_s == "true"
198
244
  end
199
245
 
200
246
  # --- publisher: primary only when non-default; copublishers as a list ---
@@ -229,17 +275,6 @@ module Pubid
229
275
  end
230
276
  end
231
277
 
232
- # --- all_parts: omit the false default ---
233
- def all_parts_to_kv(model, doc)
234
- return unless model.all_parts
235
-
236
- doc.add_child(Lutaml::KeyValue::DataModel::Element.new("all_parts", true))
237
- end
238
-
239
- def all_parts_from_kv(model, value)
240
- model.all_parts = value
241
- end
242
-
243
278
  # Serialize typed_stage as just its unique code (e.g. "cd", "fdis"); the
244
279
  # published default is omitted (recomputed from the class on load).
245
280
  def stage_to_kv(model, doc)
@@ -253,6 +288,8 @@ module Pubid
253
288
  end
254
289
 
255
290
  # Resolve the typed-stage code back within this identifier's class.
291
+ # `original_abbr` is left nil here for the same reason as in
292
+ # `published_typed_stage` above.
256
293
  def stage_from_kv(model, value)
257
294
  return if value.nil? || value.to_s.empty?
258
295
 
@@ -261,14 +298,17 @@ module Pubid
261
298
  Pubid::Iec.all_typed_stages.find { |t| t.code.to_s == value.to_s }
262
299
  return unless ts
263
300
 
264
- ts = ts.dup
265
- ts.original_abbr = ts.canonical_abbreviation
266
- model.typed_stage = ts
301
+ model.typed_stage = ts.dup
267
302
  end
268
303
 
269
304
  def self.parse(string)
305
+ unless string.is_a?(String)
306
+ raise Pubid::Errors::InvalidInputError,
307
+ Pubid::INPUT_NOT_A_STRING_MESSAGE
308
+ end
309
+
270
310
  if string.length > Pubid::MAX_INPUT_LENGTH
271
- raise ArgumentError, Pubid::INPUT_TOO_LONG_MESSAGE
311
+ raise Pubid::Errors::InvalidInputError, Pubid::INPUT_TOO_LONG_MESSAGE
272
312
  end
273
313
 
274
314
  # Route URN strings to the URN parser (mirrors Iso::Identifier.parse)
@@ -279,11 +319,6 @@ module Pubid
279
319
  # Apply legacy update_codes normalization first, before any other preprocessing
280
320
  normalized = Core::UpdateCodes.apply(string, :iec)
281
321
  parsed = Pubid::Iec::Parser.new.parse(normalized)
282
- if parsed.nil? || parsed.empty?
283
- raise Pubid::Iec::Parser::ParseError,
284
- "Invalid identifier format"
285
- end
286
-
287
322
  Pubid::Iec::Builder.new.build(parsed)
288
323
  end
289
324
 
@@ -5,8 +5,12 @@ module Pubid
5
5
  module Identifiers
6
6
  # Amendment Identifier
7
7
  class Amendment < SupplementIdentifier
8
- attribute :type, Pubid::Components::Type, default: -> { self.class.type[:key] }
9
-
8
+ # `type` is NOT redeclared here. It is derived from `typed_stage` by
9
+ # Pubid::Iec::Identifier#type, like every other IEC type. A redeclared
10
+ # attribute shadowed that reader and, because `type` is not serialized,
11
+ # its class-level default assigned the Symbol `:amd` on the from_hash
12
+ # path where the parse path assigns a Components::Type — so
13
+ # `from_hash(to_hash) != parse` for every amendment.
10
14
  TYPED_STAGES = [
11
15
  Pubid::Components::TypedStage.new(
12
16
  code: :pwi_amd,
@@ -31,8 +31,8 @@ module Pubid
31
31
  # Add subpart if present
32
32
  result += "-#{subpart}" if subpart && subpart.to_s != ""
33
33
 
34
- # Add date if present
35
- result += ":#{date.year}" if date
34
+ # Render the date (year[-month[-day]], or `--` for undated).
35
+ result += ":#{date.render}" if date
36
36
 
37
37
  result
38
38
  end
@@ -23,16 +23,6 @@ module Pubid
23
23
  web: :component_specification, title: "Component Specification", short: "CS" }
24
24
  end
25
25
 
26
- # Override publisher_portion to add CS
27
- def publisher_portion
28
- result = publisher.to_s
29
-
30
- if typed_stage && typed_stage.abbreviation == "CS"
31
- result += " CS"
32
- end
33
-
34
- result
35
- end
36
26
  end
37
27
  end
38
28
  end
@@ -22,16 +22,6 @@ module Pubid
22
22
  { key: :ca, title: "Conformity Assessment", short: "CA" }
23
23
  end
24
24
 
25
- # Override publisher_portion to add /CA
26
- def publisher_portion
27
- result = publisher.to_s
28
-
29
- if typed_stage && typed_stage.abbreviation == "CA"
30
- result += " CA"
31
- end
32
-
33
- result
34
- end
35
25
  end
36
26
  end
37
27
  end
@@ -69,6 +69,12 @@ module Pubid
69
69
  identifiers&.first
70
70
  end
71
71
 
72
+ # The origin document. A consolidated bundle stores its members in
73
+ # `identifiers` (not `base`), so walk the first member to its root.
74
+ def root
75
+ identifiers&.first&.root || self
76
+ end
77
+
72
78
  # Get all supplements (identifiers after first)
73
79
  def supplements
74
80
  identifiers&.drop(1) || []
@@ -5,8 +5,8 @@ module Pubid
5
5
  module Identifiers
6
6
  # Corrigendum Identifier
7
7
  class Corrigendum < SupplementIdentifier
8
- attribute :type, Pubid::Components::Type, default: -> { self.class.type[:key] }
9
-
8
+ # `type` is NOT redeclared here — see the note on Amendment. The
9
+ # redeclaration assigned the Symbol `:cor` on the from_hash path.
10
10
  TYPED_STAGES = [
11
11
  Pubid::Components::TypedStage.new(
12
12
  code: :pwi_cor,
@@ -8,7 +8,7 @@ module Pubid
8
8
  # Example: "IEC 60050-191/AMD2/FRAG2 ED1" = Fragment 2 of Amendment 2
9
9
  # Fragments are independently approved and have their own lifecycle stages.
10
10
  class FragmentIdentifier < Identifier
11
- attribute :base_identifier, Identifier, polymorphic: true
11
+ attribute :base, Identifier, polymorphic: true
12
12
  attribute :fragment_number, :string
13
13
  attribute :edition, ::Pubid::Components::Edition, default: -> {}
14
14
  # Fragments have their own lifecycle; default to the published FRAG stage
@@ -16,7 +16,7 @@ module Pubid
16
16
  attribute :typed_stage, ::Pubid::Components::TypedStage,
17
17
  default: -> { self.class.published_typed_stage }
18
18
 
19
- # number/date/publisher delegate to base_identifier, but the fragment's
19
+ # number/date/publisher delegate to base, but the fragment's
20
20
  # stage and edition are its own. Serialize the wrapped identifier under
21
21
  # "base" plus the fragment number; suppress only the truly-delegated
22
22
  # common maps (keep stage/edition from the inherited block).
@@ -25,16 +25,14 @@ module Pubid
25
25
  map "fragment_number", to: :fragment_number, render_default: false
26
26
  end
27
27
 
28
- def number_to_kv(_model, _doc); end
29
- def part_to_kv(_model, _doc); end
30
- def subpart_to_kv(_model, _doc); end
31
- def stage_iteration_to_kv(_model, _doc); end
28
+ # number/part/subpart need no no-op here: their maps live on
29
+ # SingleIdentifier, which this class does not inherit from.
32
30
  def year_to_kv(_model, _doc); end
33
31
  def publisher_to_kv(_model, _doc); end
34
32
  def copublishers_to_kv(_model, _doc); end
35
33
 
36
34
  def base_to_kv(model, doc)
37
- base = model.base_identifier
35
+ base = model.base
38
36
  return unless base
39
37
 
40
38
  doc.add_child(Lutaml::KeyValue::DataModel::Element.new("base",
@@ -42,7 +40,7 @@ module Pubid
42
40
  end
43
41
 
44
42
  def base_from_kv(model, value)
45
- model.base_identifier = ::Pubid::Iec::Identifier.from_hash(value) if value
43
+ model.base = ::Pubid::Iec::Identifier.from_hash(value) if value
46
44
  end
47
45
 
48
46
  TYPED_STAGES = [
@@ -118,29 +116,29 @@ module Pubid
118
116
  web: :fragment_identifier, title: "Fragment", short: "FRAG" }
119
117
  end
120
118
 
121
- # Delegate common attributes to base_identifier
119
+ # Delegate common attributes to base
122
120
  def publisher
123
- base_identifier&.publisher
121
+ base&.publisher
124
122
  end
125
123
 
126
124
  def copublishers
127
- base_identifier&.copublishers
125
+ base&.copublishers
128
126
  end
129
127
 
130
128
  def code
131
- base_identifier&.code
129
+ base&.code
132
130
  end
133
131
 
134
132
  def number
135
- base_identifier&.number
133
+ base&.number
136
134
  end
137
135
 
138
136
  def date
139
- base_identifier&.date
137
+ base&.date
140
138
  end
141
139
 
142
140
  def stage
143
- typed_stage&.to_stage || base_identifier&.stage
141
+ typed_stage&.to_stage || base&.stage
144
142
  end
145
143
  end
146
144
  end
@@ -80,22 +80,6 @@ module Pubid
80
80
  { key: :guide, title: "Guide", short: %w[Guide GUIDE] }
81
81
  end
82
82
 
83
- # Override publisher_portion to handle Guide formatting
84
- # If copublishers exist, use parent implementation
85
- def publisher_portion
86
- # If copublishers, delegate to parent (SingleIdentifier) which handles them
87
- return super if copublishers&.any?
88
-
89
- # No copublishers: simple Guide formatting
90
- result = publisher.to_s
91
-
92
- if typed_stage
93
- abbr = typed_stage.abbreviation
94
- result += " #{abbr}" unless abbr.empty?
95
- end
96
-
97
- result
98
- end
99
83
  end
100
84
  end
101
85
  end
@@ -13,7 +13,7 @@ module Pubid
13
13
  code: :pwi,
14
14
  stage_code: :pwi,
15
15
  type_code: :is,
16
- abbr: ["PWI"],
16
+ abbr: %w[PWI NWIP BWG AWIN AMW],
17
17
  name: "Preliminary Work Item",
18
18
  harmonized_stages: %w[00.00 00.20 00.60 00.98 00.99],
19
19
  ),
@@ -23,7 +23,20 @@ module Pubid
23
23
  type_code: :is,
24
24
  abbr: ["NP"],
25
25
  name: "New Proposal",
26
- harmonized_stages: %w[10.00 10.20 10.60 10.92 10.98],
26
+ harmonized_stages: %w[10.00 10.60 10.92 10.98],
27
+ ),
28
+ # PNW is a stage of its own, not an alias of PWI. IEC's portal and
29
+ # pubid-iec 1.x both give it harmonized code 10.20 ("New work item
30
+ # proposal"), which is why 10.20 is absent from :np above — the two
31
+ # must not both claim it, or a lookup by harmonized code is
32
+ # ambiguous. See issue #360 item 1.
33
+ Pubid::Components::TypedStage.new(
34
+ code: :pnw,
35
+ stage_code: :pnw,
36
+ type_code: :is,
37
+ abbr: ["PNW"],
38
+ name: "New work item proposal",
39
+ harmonized_stages: %w[10.20],
27
40
  ),
28
41
  Pubid::Components::TypedStage.new(
29
42
  code: :anw,
@@ -45,7 +58,9 @@ module Pubid
45
58
  code: :cd,
46
59
  stage_code: :cd,
47
60
  type_code: :is,
48
- abbr: ["CD"],
61
+ abbr: %w[CD 2CD 3CD 4CD 5CD 6CD 7CD 8CD 9CD
62
+ ACD A2CD A3CD A4CD A5CD A6CD A7CD A8CD A9CD
63
+ CDM],
49
64
  name: "Committee Draft",
50
65
  harmonized_stages: %w[30.00 30.20 30.60 30.92 30.98 30.99],
51
66
  ),
@@ -53,7 +68,7 @@ module Pubid
53
68
  code: :cdv,
54
69
  stage_code: :cdv,
55
70
  type_code: :is,
56
- abbr: ["CDV"],
71
+ abbr: %w[CDV ACDV CCDV CDVM NCDV],
57
72
  name: "Committee Draft for Vote",
58
73
  harmonized_stages: %w[40.00 40.20 40.60 40.92 40.98 40.99],
59
74
  ),
@@ -61,7 +76,7 @@ module Pubid
61
76
  code: :fdis,
62
77
  stage_code: :fdis,
63
78
  type_code: :is,
64
- abbr: ["FDIS", "PRF"],
79
+ abbr: %w[FDIS PRF NFDIS NADIS RDISH RFDIS CFDIS],
65
80
  name: "Final Draft International Standard",
66
81
  harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
67
82
  ),
@@ -69,7 +84,8 @@ module Pubid
69
84
  code: :is,
70
85
  stage_code: :published,
71
86
  type_code: :is,
72
- abbr: [""],
87
+ abbr: ["", "BPUB", "PPUB", "APUB", "WPUB", "DELPUB",
88
+ "RR", "CAN"],
73
89
  name: "International Standard",
74
90
  harmonized_stages: %w[60.00 60.60 90.20 90.60 90.92 90.93 90.99
75
91
  95.20 95.60 95.92 95.99],
@@ -23,16 +23,6 @@ module Pubid
23
23
  web: :operational_document, title: "Operational Document", short: "OD" }
24
24
  end
25
25
 
26
- # Override publisher_portion to add OD
27
- def publisher_portion
28
- result = publisher.to_s
29
-
30
- if typed_stage && typed_stage.abbreviation == "OD"
31
- result += " OD"
32
- end
33
-
34
- result
35
- end
36
26
  end
37
27
  end
38
28
  end
@@ -82,18 +82,6 @@ module Pubid
82
82
  web: :publicly_available_specification, title: "Publicly Available Specification", short: "PAS" }
83
83
  end
84
84
 
85
- # Override publisher_portion to add PAS or DPAS stage
86
- def publisher_portion
87
- result = publisher.to_s
88
-
89
- if typed_stage
90
- abbr = typed_stage.abbreviation
91
- # PAS uses space for all stages
92
- result += " #{abbr}" unless abbr.empty?
93
- end
94
-
95
- result
96
- end
97
85
  end
98
86
  end
99
87
  end