pubid 1.15.21 → 2.0.0.alpha.10
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.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.adoc +2044 -53
- data/archived-gems/pubid-ccsds/update_codes.yaml +1 -0
- data/archived-gems/pubid-iec/stages.yaml +129 -0
- data/archived-gems/pubid-iec/update_codes.yaml +67 -0
- data/archived-gems/pubid-ieee/update_codes.yaml +104 -0
- data/archived-gems/pubid-iso/stages.yaml +106 -0
- data/archived-gems/pubid-iso/update_codes.yaml +4 -0
- data/archived-gems/pubid-itu/i18n.yaml +13 -0
- data/archived-gems/pubid-itu/series.yaml +42 -0
- data/archived-gems/pubid-nist/publishers.yaml +6 -0
- data/archived-gems/pubid-nist/series.yaml +121 -0
- data/archived-gems/pubid-nist/stages.yaml +16 -0
- data/archived-gems/pubid-nist/update_codes.yaml +93 -0
- data/archived-gems/pubid-plateau/update_codes.yaml +6 -0
- data/data/bipm/update_codes.yaml +9 -0
- data/data/ccsds/update_codes.yaml +1 -0
- data/data/iec/update_codes.yaml +70 -0
- data/data/ieee/update_codes.yaml +210 -0
- data/data/iso/update_codes.yaml +21 -0
- data/data/nist/series.yaml +155 -0
- data/data/nist/update_codes.yaml +122 -0
- data/data/plateau/update_codes.yaml +6 -0
- data/lib/pubid/adobe/builder.rb +52 -0
- data/lib/pubid/adobe/identifier.rb +47 -0
- data/lib/pubid/adobe/identifiers/publication.rb +31 -0
- data/lib/pubid/adobe/identifiers/tech_note.rb +32 -0
- data/lib/pubid/adobe/identifiers.rb +10 -0
- data/lib/pubid/adobe/parser.rb +136 -0
- data/lib/pubid/adobe/renderer.rb +39 -0
- data/lib/pubid/adobe/urn_generator.rb +42 -0
- data/lib/pubid/adobe/urn_parser.rb +69 -0
- data/lib/pubid/adobe.rb +60 -0
- data/lib/pubid/amca/builder.rb +176 -0
- data/lib/pubid/amca/identifier.rb +4 -0
- data/lib/pubid/amca/identifiers/base.rb +92 -0
- data/lib/pubid/amca/identifiers/interpretation.rb +38 -0
- data/lib/pubid/amca/identifiers/publication.rb +34 -0
- data/lib/pubid/amca/identifiers/standard.rb +20 -0
- data/lib/pubid/amca/identifiers.rb +11 -0
- data/lib/pubid/amca/parser.rb +153 -0
- data/lib/pubid/amca/renderer.rb +82 -0
- data/lib/pubid/amca/single_identifier.rb +10 -0
- data/lib/pubid/amca/urn_generator.rb +51 -0
- data/lib/pubid/amca/urn_parser.rb +28 -0
- data/lib/pubid/amca.rb +73 -0
- data/lib/pubid/ansi/builder.rb +54 -0
- data/lib/pubid/ansi/identifier.rb +31 -0
- data/lib/pubid/ansi/identifiers/american_national_standard.rb +13 -0
- data/lib/pubid/ansi/identifiers/standard.rb +15 -0
- data/lib/pubid/ansi/identifiers.rb +11 -0
- data/lib/pubid/ansi/parser.rb +91 -0
- data/lib/pubid/ansi/renderer.rb +53 -0
- data/lib/pubid/ansi/single_identifier.rb +16 -0
- data/lib/pubid/ansi/urn_generator.rb +41 -0
- data/lib/pubid/ansi/urn_parser.rb +23 -0
- data/lib/pubid/ansi.rb +68 -0
- data/lib/pubid/api/builder.rb +58 -0
- data/lib/pubid/api/components/code.rb +9 -0
- data/lib/pubid/api/identifier.rb +42 -0
- data/lib/pubid/api/identifiers/base.rb +12 -0
- data/lib/pubid/api/identifiers/bulletin.rb +13 -0
- data/lib/pubid/api/identifiers/continuous_operations_standard.rb +13 -0
- data/lib/pubid/api/identifiers/mpms.rb +26 -0
- data/lib/pubid/api/identifiers/publication.rb +13 -0
- data/lib/pubid/api/identifiers/recommended_practice.rb +13 -0
- data/lib/pubid/api/identifiers/specification.rb +13 -0
- data/lib/pubid/api/identifiers/standard.rb +13 -0
- data/lib/pubid/api/identifiers/technical_report.rb +13 -0
- data/lib/pubid/api/identifiers/typeless_standard.rb +11 -0
- data/lib/pubid/api/identifiers.rb +18 -0
- data/lib/pubid/api/parser.rb +140 -0
- data/lib/pubid/api/renderer.rb +98 -0
- data/lib/pubid/api/single_identifier.rb +24 -0
- data/lib/pubid/api/urn_generator.rb +23 -0
- data/lib/pubid/api/urn_parser.rb +35 -0
- data/lib/pubid/api.rb +68 -0
- data/lib/pubid/ashrae/builder.rb +519 -0
- data/lib/pubid/ashrae/identifier.rb +8 -0
- data/lib/pubid/ashrae/identifiers/addenda_package.rb +42 -0
- data/lib/pubid/ashrae/identifiers/addendum.rb +44 -0
- data/lib/pubid/ashrae/identifiers/base.rb +119 -0
- data/lib/pubid/ashrae/identifiers/combined_addenda.rb +43 -0
- data/lib/pubid/ashrae/identifiers/errata.rb +39 -0
- data/lib/pubid/ashrae/identifiers/guideline.rb +41 -0
- data/lib/pubid/ashrae/identifiers/interpretation.rb +45 -0
- data/lib/pubid/ashrae/identifiers/standard.rb +41 -0
- data/lib/pubid/ashrae/identifiers.rb +15 -0
- data/lib/pubid/ashrae/parser.rb +748 -0
- data/lib/pubid/ashrae/renderer.rb +117 -0
- data/lib/pubid/ashrae/single_identifier.rb +10 -0
- data/lib/pubid/ashrae/supplement_identifier.rb +38 -0
- data/lib/pubid/ashrae/urn_generator.rb +57 -0
- data/lib/pubid/ashrae/urn_parser.rb +27 -0
- data/lib/pubid/ashrae.rb +77 -0
- data/lib/pubid/asme/builder.rb +162 -0
- data/lib/pubid/asme/components/code.rb +26 -0
- data/lib/pubid/asme/identifier.rb +24 -0
- data/lib/pubid/asme/identifiers/base.rb +10 -0
- data/lib/pubid/asme/identifiers/standard.rb +96 -0
- data/lib/pubid/asme/identifiers.rb +10 -0
- data/lib/pubid/asme/parser.rb +308 -0
- data/lib/pubid/asme/renderer.rb +66 -0
- data/lib/pubid/asme/single_identifier.rb +38 -0
- data/lib/pubid/asme/urn_generator.rb +133 -0
- data/lib/pubid/asme/urn_parser.rb +31 -0
- data/lib/pubid/asme.rb +67 -0
- data/lib/pubid/astm/builder.rb +166 -0
- data/lib/pubid/astm/components/code.rb +42 -0
- data/lib/pubid/astm/components.rb +9 -0
- data/lib/pubid/astm/identifier.rb +24 -0
- data/lib/pubid/astm/identifiers/adjunct.rb +28 -0
- data/lib/pubid/astm/identifiers/base.rb +13 -0
- data/lib/pubid/astm/identifiers/code_number.rb +81 -0
- data/lib/pubid/astm/identifiers/data_series.rb +13 -0
- data/lib/pubid/astm/identifiers/iso_dual_published.rb +65 -0
- data/lib/pubid/astm/identifiers/manual.rb +23 -0
- data/lib/pubid/astm/identifiers/monograph.rb +13 -0
- data/lib/pubid/astm/identifiers/research_report.rb +21 -0
- data/lib/pubid/astm/identifiers/standard.rb +23 -0
- data/lib/pubid/astm/identifiers/technical_report.rb +12 -0
- data/lib/pubid/astm/identifiers/work_in_progress.rb +12 -0
- data/lib/pubid/astm/identifiers.rb +19 -0
- data/lib/pubid/astm/parser.rb +244 -0
- data/lib/pubid/astm/renderer.rb +172 -0
- data/lib/pubid/astm/single_identifier.rb +47 -0
- data/lib/pubid/astm/urn_generator.rb +101 -0
- data/lib/pubid/astm/urn_parser.rb +30 -0
- data/lib/pubid/astm.rb +55 -0
- data/lib/pubid/bipm/builder.rb +163 -0
- data/lib/pubid/bipm/identifier.rb +285 -0
- data/lib/pubid/bipm/identifiers/committee_document.rb +36 -0
- data/lib/pubid/bipm/identifiers/guide.rb +35 -0
- data/lib/pubid/bipm/identifiers/meeting.rb +53 -0
- data/lib/pubid/bipm/identifiers/mep.rb +33 -0
- data/lib/pubid/bipm/identifiers/metrologia_article.rb +48 -0
- data/lib/pubid/bipm/identifiers/si_brochure.rb +33 -0
- data/lib/pubid/bipm/identifiers.rb +15 -0
- data/lib/pubid/bipm/parser.rb +237 -0
- data/lib/pubid/bipm/renderer.rb +118 -0
- data/lib/pubid/bipm/urn_generator.rb +58 -0
- data/lib/pubid/bipm/urn_parser.rb +60 -0
- data/lib/pubid/bipm.rb +91 -0
- data/lib/pubid/bsi/builder.rb +1495 -0
- data/lib/pubid/bsi/components/code.rb +11 -0
- data/lib/pubid/bsi/components/date.rb +11 -0
- data/lib/pubid/bsi/components/publisher.rb +11 -0
- data/lib/pubid/bsi/components/type.rb +11 -0
- data/lib/pubid/bsi/identifier.rb +6 -0
- data/lib/pubid/bsi/identifiers/addendum_document.rb +30 -0
- data/lib/pubid/bsi/identifiers/adopted_european_norm.rb +67 -0
- data/lib/pubid/bsi/identifiers/adopted_international_standard.rb +51 -0
- data/lib/pubid/bsi/identifiers/aerospace_standard.rb +65 -0
- data/lib/pubid/bsi/identifiers/amendment.rb +48 -0
- data/lib/pubid/bsi/identifiers/british_industrial_practice.rb +21 -0
- data/lib/pubid/bsi/identifiers/british_standard.rb +34 -0
- data/lib/pubid/bsi/identifiers/bundled_identifier.rb +40 -0
- data/lib/pubid/bsi/identifiers/committee_document.rb +44 -0
- data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +84 -0
- data/lib/pubid/bsi/identifiers/corrigendum.rb +44 -0
- data/lib/pubid/bsi/identifiers/detailed_specification.rb +33 -0
- data/lib/pubid/bsi/identifiers/disc.rb +27 -0
- data/lib/pubid/bsi/identifiers/draft_document.rb +27 -0
- data/lib/pubid/bsi/identifiers/electronic_book.rb +16 -0
- data/lib/pubid/bsi/identifiers/expert_commentary.rb +36 -0
- data/lib/pubid/bsi/identifiers/explanatory_supplement.rb +35 -0
- data/lib/pubid/bsi/identifiers/flex.rb +30 -0
- data/lib/pubid/bsi/identifiers/handbook.rb +23 -0
- data/lib/pubid/bsi/identifiers/index.rb +30 -0
- data/lib/pubid/bsi/identifiers/method.rb +35 -0
- data/lib/pubid/bsi/identifiers/national_annex.rb +48 -0
- data/lib/pubid/bsi/identifiers/practice_guide.rb +21 -0
- data/lib/pubid/bsi/identifiers/publicly_available_specification.rb +27 -0
- data/lib/pubid/bsi/identifiers/published_document.rb +27 -0
- data/lib/pubid/bsi/identifiers/section.rb +32 -0
- data/lib/pubid/bsi/identifiers/set.rb +40 -0
- data/lib/pubid/bsi/identifiers/standalone_amendment.rb +40 -0
- data/lib/pubid/bsi/identifiers/supplement_document.rb +29 -0
- data/lib/pubid/bsi/identifiers/supplementary_index.rb +35 -0
- data/lib/pubid/bsi/identifiers/technical_specification.rb +34 -0
- data/lib/pubid/bsi/identifiers/test_method.rb +35 -0
- data/lib/pubid/bsi/identifiers/value_added_publication.rb +37 -0
- data/lib/pubid/bsi/identifiers.rb +51 -0
- data/lib/pubid/bsi/model.rb +196 -0
- data/lib/pubid/bsi/parser.rb +673 -0
- data/lib/pubid/bsi/renderer.rb +1064 -0
- data/lib/pubid/bsi/single_identifier.rb +141 -0
- data/lib/pubid/bsi/urn_generator.rb +92 -0
- data/lib/pubid/bsi/urn_parser.rb +52 -0
- data/lib/pubid/bsi.rb +282 -0
- data/lib/pubid/builder/base.rb +187 -0
- data/lib/pubid/bundled_identifier.rb +134 -0
- data/lib/pubid/calconnect/builder.rb +38 -0
- data/lib/pubid/calconnect/identifier.rb +121 -0
- data/lib/pubid/calconnect/identifiers/standard.rb +29 -0
- data/lib/pubid/calconnect/identifiers.rb +9 -0
- data/lib/pubid/calconnect/parser.rb +54 -0
- data/lib/pubid/calconnect/renderer.rb +36 -0
- data/lib/pubid/calconnect/urn_generator.rb +33 -0
- data/lib/pubid/calconnect/urn_parser.rb +34 -0
- data/lib/pubid/calconnect.rb +82 -0
- data/lib/pubid/ccsds/builder.rb +57 -0
- data/lib/pubid/ccsds/identifier.rb +76 -0
- data/lib/pubid/ccsds/identifiers/base.rb +41 -0
- data/lib/pubid/ccsds/identifiers/base_BASE_88929.rb +70 -0
- data/lib/pubid/ccsds/identifiers/corrigendum.rb +40 -0
- data/lib/pubid/ccsds/identifiers.rb +10 -0
- data/lib/pubid/ccsds/parser.rb +73 -0
- data/lib/pubid/ccsds/single_identifier.rb +77 -0
- data/lib/pubid/ccsds/supplement_identifier.rb +37 -0
- data/lib/pubid/ccsds/urn_generator.rb +115 -0
- data/lib/pubid/ccsds/urn_parser.rb +20 -0
- data/lib/pubid/ccsds.rb +64 -0
- data/lib/pubid/cen_cenelec/builder.rb +362 -0
- data/lib/pubid/cen_cenelec/identifier.rb +38 -0
- data/lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb +45 -0
- data/lib/pubid/cen_cenelec/identifiers/amendment.rb +19 -0
- data/lib/pubid/cen_cenelec/identifiers/base.rb +34 -0
- data/lib/pubid/cen_cenelec/identifiers/cen_report.rb +29 -0
- data/lib/pubid/cen_cenelec/identifiers/cen_workshop_agreement.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/cenelec_harmonization_document.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +40 -0
- data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +20 -0
- data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +99 -0
- data/lib/pubid/cen_cenelec/identifiers/european_prestandard.rb +50 -0
- data/lib/pubid/cen_cenelec/identifiers/european_specification.rb +29 -0
- data/lib/pubid/cen_cenelec/identifiers/fragment.rb +18 -0
- data/lib/pubid/cen_cenelec/identifiers/guide.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/harmonization_document.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/technical_report.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/technical_specification.rb +36 -0
- data/lib/pubid/cen_cenelec/identifiers.rb +32 -0
- data/lib/pubid/cen_cenelec/parser.rb +144 -0
- data/lib/pubid/cen_cenelec/renderer.rb +261 -0
- data/lib/pubid/cen_cenelec/single_identifier.rb +49 -0
- data/lib/pubid/cen_cenelec/supplement_identifier.rb +47 -0
- data/lib/pubid/cen_cenelec/urn_generator.rb +129 -0
- data/lib/pubid/cen_cenelec/urn_parser.rb +28 -0
- data/lib/pubid/cen_cenelec.rb +208 -0
- data/lib/pubid/cie/builder.rb +524 -0
- data/lib/pubid/cie/components/language.rb +58 -0
- data/lib/pubid/cie/identifier.rb +33 -0
- data/lib/pubid/cie/identifiers/bundle.rb +50 -0
- data/lib/pubid/cie/identifiers/code_attributes.rb +52 -0
- data/lib/pubid/cie/identifiers/conference.rb +37 -0
- data/lib/pubid/cie/identifiers/corrigendum.rb +34 -0
- data/lib/pubid/cie/identifiers/dual_published.rb +41 -0
- data/lib/pubid/cie/identifiers/identical.rb +64 -0
- data/lib/pubid/cie/identifiers/joint_published.rb +52 -0
- data/lib/pubid/cie/identifiers/proceedings.rb +41 -0
- data/lib/pubid/cie/identifiers/standard.rb +93 -0
- data/lib/pubid/cie/identifiers/supplement.rb +47 -0
- data/lib/pubid/cie/identifiers/tutorial_bundle.rb +24 -0
- data/lib/pubid/cie/identifiers.rb +19 -0
- data/lib/pubid/cie/parser.rb +396 -0
- data/lib/pubid/cie/single_identifier.rb +69 -0
- data/lib/pubid/cie/supplement_identifier.rb +39 -0
- data/lib/pubid/cie/urn_generator.rb +126 -0
- data/lib/pubid/cie/urn_parser.rb +28 -0
- data/lib/pubid/cie.rb +83 -0
- data/lib/pubid/components/adoption.rb +104 -0
- data/lib/pubid/components/code.rb +47 -0
- data/lib/pubid/components/date.rb +72 -0
- data/lib/pubid/components/edition.rb +35 -0
- data/lib/pubid/components/iteration.rb +32 -0
- data/lib/pubid/components/language.rb +39 -0
- data/lib/pubid/components/locality.rb +19 -0
- data/lib/pubid/components/publisher.rb +39 -0
- data/lib/pubid/components/relationship.rb +151 -0
- data/lib/pubid/components/stage.rb +45 -0
- data/lib/pubid/components/supplement.rb +184 -0
- data/lib/pubid/components/type.rb +48 -0
- data/lib/pubid/components/typed_stage.rb +58 -0
- data/lib/pubid/components.rb +19 -0
- data/lib/pubid/core/pattern_doc_generator.rb +272 -0
- data/lib/pubid/core/update_codes.rb +98 -0
- data/lib/pubid/core.rb +8 -0
- data/lib/pubid/csa/builder.rb +671 -0
- data/lib/pubid/csa/components/code.rb +9 -0
- data/lib/pubid/csa/components.rb +9 -0
- data/lib/pubid/csa/composite_identifier.rb +38 -0
- data/lib/pubid/csa/identifier.rb +570 -0
- data/lib/pubid/csa/identifiers/base.rb +10 -0
- data/lib/pubid/csa/identifiers/bundled.rb +141 -0
- data/lib/pubid/csa/identifiers/canadian_adopted.rb +82 -0
- data/lib/pubid/csa/identifiers/cec.rb +66 -0
- data/lib/pubid/csa/identifiers/combined.rb +158 -0
- data/lib/pubid/csa/identifiers/csa_adopted.rb +78 -0
- data/lib/pubid/csa/identifiers/package.rb +65 -0
- data/lib/pubid/csa/identifiers/series.rb +23 -0
- data/lib/pubid/csa/identifiers/standard.rb +10 -0
- data/lib/pubid/csa/identifiers.rb +17 -0
- data/lib/pubid/csa/parser.rb +449 -0
- data/lib/pubid/csa/renderer.rb +300 -0
- data/lib/pubid/csa/single_identifier.rb +119 -0
- data/lib/pubid/csa/urn_generator.rb +87 -0
- data/lib/pubid/csa/urn_parser.rb +33 -0
- data/lib/pubid/csa/wrapper_identifier.rb +64 -0
- data/lib/pubid/csa.rb +80 -0
- data/lib/pubid/doi/builder.rb +18 -0
- data/lib/pubid/doi/identifier.rb +49 -0
- data/lib/pubid/doi/identifiers/resource.rb +30 -0
- data/lib/pubid/doi/identifiers.rb +9 -0
- data/lib/pubid/doi/parser.rb +52 -0
- data/lib/pubid/doi/renderer.rb +13 -0
- data/lib/pubid/doi.rb +55 -0
- data/lib/pubid/easc/builder.rb +55 -0
- data/lib/pubid/easc/identifier.rb +59 -0
- data/lib/pubid/easc/identifiers/pmg.rb +20 -0
- data/lib/pubid/easc/identifiers/rmg.rb +19 -0
- data/lib/pubid/easc/identifiers.rb +10 -0
- data/lib/pubid/easc/parser.rb +88 -0
- data/lib/pubid/easc/renderer.rb +48 -0
- data/lib/pubid/easc/urn_generator.rb +46 -0
- data/lib/pubid/easc/urn_parser.rb +57 -0
- data/lib/pubid/easc.rb +52 -0
- data/lib/pubid/ecma/builder.rb +45 -0
- data/lib/pubid/ecma/identifier.rb +147 -0
- data/lib/pubid/ecma/identifiers/memento.rb +30 -0
- data/lib/pubid/ecma/identifiers/standard.rb +31 -0
- data/lib/pubid/ecma/identifiers/technical_report.rb +31 -0
- data/lib/pubid/ecma/identifiers.rb +11 -0
- data/lib/pubid/ecma/parser.rb +76 -0
- data/lib/pubid/ecma/renderer.rb +67 -0
- data/lib/pubid/ecma/urn_generator.rb +46 -0
- data/lib/pubid/ecma/urn_parser.rb +51 -0
- data/lib/pubid/ecma.rb +67 -0
- data/lib/pubid/errors.rb +79 -0
- data/lib/pubid/etsi/builder.rb +142 -0
- data/lib/pubid/etsi/components/code.rb +43 -0
- data/lib/pubid/etsi/components/version.rb +32 -0
- data/lib/pubid/etsi/components.rb +10 -0
- data/lib/pubid/etsi/identifier.rb +4 -0
- data/lib/pubid/etsi/identifiers/amendment.rb +15 -0
- data/lib/pubid/etsi/identifiers/base.rb +74 -0
- data/lib/pubid/etsi/identifiers/corrigendum.rb +15 -0
- data/lib/pubid/etsi/identifiers/etsi_standard.rb +222 -0
- data/lib/pubid/etsi/identifiers/supplement_identifier.rb +123 -0
- data/lib/pubid/etsi/identifiers.rb +13 -0
- data/lib/pubid/etsi/parser.rb +139 -0
- data/lib/pubid/etsi/renderer.rb +48 -0
- data/lib/pubid/etsi/urn_generator.rb +76 -0
- data/lib/pubid/etsi/urn_parser.rb +34 -0
- data/lib/pubid/etsi.rb +71 -0
- data/lib/pubid/export/auditor.rb +89 -0
- data/lib/pubid/export/exporter.rb +33 -0
- data/lib/pubid/export/flavor_exporter.rb +250 -0
- data/lib/pubid/export/result.rb +97 -0
- data/lib/pubid/export.rb +12 -0
- data/lib/pubid/format_detector.rb +16 -0
- data/lib/pubid/format_registry.rb +42 -0
- data/lib/pubid/gb/builder.rb +45 -0
- data/lib/pubid/gb/identifier.rb +67 -0
- data/lib/pubid/gb/identifiers/standard.rb +34 -0
- data/lib/pubid/gb/identifiers.rb +9 -0
- data/lib/pubid/gb/parser.rb +63 -0
- data/lib/pubid/gb/renderer.rb +35 -0
- data/lib/pubid/gb.rb +87 -0
- data/lib/pubid/gost/builder.rb +148 -0
- data/lib/pubid/gost/identifier.rb +47 -0
- data/lib/pubid/gost/identifiers/foreign_reference.rb +25 -0
- data/lib/pubid/gost/identifiers/harmonized.rb +39 -0
- data/lib/pubid/gost/identifiers/identical_adoption.rb +39 -0
- data/lib/pubid/gost/identifiers/interstate_standard.rb +20 -0
- data/lib/pubid/gost/identifiers/national_standard.rb +19 -0
- data/lib/pubid/gost/identifiers.rb +13 -0
- data/lib/pubid/gost/parser.rb +105 -0
- data/lib/pubid/gost/renderer.rb +48 -0
- data/lib/pubid/gost/urn_generator.rb +46 -0
- data/lib/pubid/gost/urn_parser.rb +52 -0
- data/lib/pubid/gost.rb +49 -0
- data/lib/pubid/iala/builder.rb +102 -0
- data/lib/pubid/iala/identifier.rb +90 -0
- data/lib/pubid/iala/identifiers/advice.rb +15 -0
- data/lib/pubid/iala/identifiers/annex.rb +57 -0
- data/lib/pubid/iala/identifiers/general_assembly.rb +19 -0
- data/lib/pubid/iala/identifiers/guideline.rb +17 -0
- data/lib/pubid/iala/identifiers/letter.rb +16 -0
- data/lib/pubid/iala/identifiers/manual.rb +18 -0
- data/lib/pubid/iala/identifiers/model_course.rb +17 -0
- data/lib/pubid/iala/identifiers/recommendation.rb +17 -0
- data/lib/pubid/iala/identifiers/report.rb +16 -0
- data/lib/pubid/iala/identifiers/resolution.rb +16 -0
- data/lib/pubid/iala/identifiers/standard.rb +17 -0
- data/lib/pubid/iala/identifiers.rb +19 -0
- data/lib/pubid/iala/parser.rb +138 -0
- data/lib/pubid/iala/renderer.rb +36 -0
- data/lib/pubid/iala/urn_generator.rb +49 -0
- data/lib/pubid/iala/urn_parser.rb +67 -0
- data/lib/pubid/iala.rb +71 -0
- data/lib/pubid/iana/builder.rb +22 -0
- data/lib/pubid/iana/identifier.rb +140 -0
- data/lib/pubid/iana/identifiers/registry.rb +69 -0
- data/lib/pubid/iana/identifiers.rb +9 -0
- data/lib/pubid/iana/parser.rb +38 -0
- data/lib/pubid/iana/renderer.rb +32 -0
- data/lib/pubid/iana/urn_generator.rb +19 -0
- data/lib/pubid/iana/urn_parser.rb +24 -0
- data/lib/pubid/iana.rb +69 -0
- data/lib/pubid/identifier.rb +1118 -0
- data/lib/pubid/identifier_metadata.rb +148 -0
- data/lib/pubid/idf/builder.rb +82 -0
- data/lib/pubid/idf/identifier.rb +79 -0
- data/lib/pubid/idf/identifiers/amendment.rb +28 -0
- data/lib/pubid/idf/identifiers/corrigendum.rb +28 -0
- data/lib/pubid/idf/identifiers/international_standard.rb +124 -0
- data/lib/pubid/idf/identifiers/reviewed_method.rb +101 -0
- data/lib/pubid/idf/identifiers.rb +13 -0
- data/lib/pubid/idf/parser.rb +144 -0
- data/lib/pubid/idf/renderer.rb +84 -0
- data/lib/pubid/idf/single_identifier.rb +19 -0
- data/lib/pubid/idf/supplement_identifier.rb +35 -0
- data/lib/pubid/idf/urn_generator.rb +49 -0
- data/lib/pubid/idf/urn_parser.rb +25 -0
- data/lib/pubid/idf.rb +89 -0
- data/lib/pubid/iec/builder.rb +458 -0
- data/lib/pubid/iec/components/code.rb +36 -0
- data/lib/pubid/iec/components/consolidated_amendment.rb +59 -0
- data/lib/pubid/iec/components/publisher.rb +35 -0
- data/lib/pubid/iec/components/sheet.rb +32 -0
- data/lib/pubid/iec/components/trf_info.rb +38 -0
- data/lib/pubid/iec/components/vap_suffix.rb +41 -0
- data/lib/pubid/iec/components.rb +14 -0
- data/lib/pubid/iec/identifier.rb +341 -0
- data/lib/pubid/iec/identifiers/amendment.rb +97 -0
- data/lib/pubid/iec/identifiers/base.rb +54 -0
- data/lib/pubid/iec/identifiers/component_specification.rb +29 -0
- data/lib/pubid/iec/identifiers/conformity_assessment.rb +28 -0
- data/lib/pubid/iec/identifiers/consolidated_identifier.rb +85 -0
- data/lib/pubid/iec/identifiers/corrigendum.rb +93 -0
- data/lib/pubid/iec/identifiers/fragment_identifier.rb +148 -0
- data/lib/pubid/iec/identifiers/guide.rb +86 -0
- data/lib/pubid/iec/identifiers/international_standard.rb +162 -0
- data/lib/pubid/iec/identifiers/interpretation_sheet.rb +103 -0
- data/lib/pubid/iec/identifiers/operational_document.rb +29 -0
- data/lib/pubid/iec/identifiers/publicly_available_specification.rb +88 -0
- data/lib/pubid/iec/identifiers/sheet_identifier.rb +68 -0
- data/lib/pubid/iec/identifiers/societal_technology_trend_report.rb +30 -0
- data/lib/pubid/iec/identifiers/systems_reference_document.rb +29 -0
- data/lib/pubid/iec/identifiers/technical_group.rb +30 -0
- data/lib/pubid/iec/identifiers/technical_report.rb +114 -0
- data/lib/pubid/iec/identifiers/technical_specification.rb +114 -0
- data/lib/pubid/iec/identifiers/technology_report.rb +28 -0
- data/lib/pubid/iec/identifiers/test_report_form.rb +35 -0
- data/lib/pubid/iec/identifiers/vap_identifier.rb +76 -0
- data/lib/pubid/iec/identifiers/white_paper.rb +29 -0
- data/lib/pubid/iec/identifiers/working_document.rb +62 -0
- data/lib/pubid/iec/identifiers.rb +31 -0
- data/lib/pubid/iec/parser.rb +443 -0
- data/lib/pubid/iec/renderer.rb +267 -0
- data/lib/pubid/iec/rendering_style.rb +113 -0
- data/lib/pubid/iec/single_identifier.rb +72 -0
- data/lib/pubid/iec/supplement_identifier.rb +178 -0
- data/lib/pubid/iec/urn_generator.rb +245 -0
- data/lib/pubid/iec/urn_parser.rb +128 -0
- data/lib/pubid/iec.rb +64 -0
- data/lib/pubid/ieee/aiee/builder.rb +85 -0
- data/lib/pubid/ieee/aiee/identifier.rb +89 -0
- data/lib/pubid/ieee/aiee/parser.rb +130 -0
- data/lib/pubid/ieee/aiee.rb +11 -0
- data/lib/pubid/ieee/builder.rb +1554 -0
- data/lib/pubid/ieee/compaction.rb +121 -0
- data/lib/pubid/ieee/components/code.rb +110 -0
- data/lib/pubid/ieee/components/draft.rb +147 -0
- data/lib/pubid/ieee/components/relationship.rb +13 -0
- data/lib/pubid/ieee/components/typed_stage.rb +100 -0
- data/lib/pubid/ieee/identifier.rb +5 -0
- data/lib/pubid/ieee/identifiers/adopted_standard.rb +81 -0
- data/lib/pubid/ieee/identifiers/amendment.rb +40 -0
- data/lib/pubid/ieee/identifiers/base.rb +384 -0
- data/lib/pubid/ieee/identifiers/code_number.rb +82 -0
- data/lib/pubid/ieee/identifiers/conformance_identifier.rb +29 -0
- data/lib/pubid/ieee/identifiers/corrigendum.rb +40 -0
- data/lib/pubid/ieee/identifiers/csa_dual_published.rb +62 -0
- data/lib/pubid/ieee/identifiers/dual_identifier.rb +14 -0
- data/lib/pubid/ieee/identifiers/dual_published.rb +79 -0
- data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +115 -0
- data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +48 -0
- data/lib/pubid/ieee/identifiers/joint_development.rb +223 -0
- data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +85 -0
- data/lib/pubid/ieee/identifiers/nesc/base.rb +127 -0
- data/lib/pubid/ieee/identifiers/nesc/draft.rb +43 -0
- data/lib/pubid/ieee/identifiers/nesc/edition.rb +32 -0
- data/lib/pubid/ieee/identifiers/nesc/handbook.rb +43 -0
- data/lib/pubid/ieee/identifiers/nesc/redline.rb +35 -0
- data/lib/pubid/ieee/identifiers/nesc/standard.rb +41 -0
- data/lib/pubid/ieee/identifiers/nesc.rb +16 -0
- data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +14 -0
- data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +49 -0
- data/lib/pubid/ieee/identifiers/redlined_standard.rb +26 -0
- data/lib/pubid/ieee/identifiers/si_standard.rb +38 -0
- data/lib/pubid/ieee/identifiers/standard.rb +44 -0
- data/lib/pubid/ieee/identifiers/supplement_identifier.rb +42 -0
- data/lib/pubid/ieee/identifiers.rb +34 -0
- data/lib/pubid/ieee/ire/builder.rb +62 -0
- data/lib/pubid/ieee/ire/identifier.rb +73 -0
- data/lib/pubid/ieee/ire/parser.rb +91 -0
- data/lib/pubid/ieee/ire.rb +11 -0
- data/lib/pubid/ieee/nesc/builder.rb +114 -0
- data/lib/pubid/ieee/nesc/parser.rb +155 -0
- data/lib/pubid/ieee/nesc.rb +10 -0
- data/lib/pubid/ieee/parser.rb +1644 -0
- data/lib/pubid/ieee/pre_parser.rb +301 -0
- data/lib/pubid/ieee/renderer.rb +408 -0
- data/lib/pubid/ieee/typed_stages.rb +183 -0
- data/lib/pubid/ieee/urn_generator.rb +215 -0
- data/lib/pubid/ieee/urn_parser.rb +34 -0
- data/lib/pubid/ieee.rb +163 -0
- data/lib/pubid/ieee_debug.rb +30 -0
- data/lib/pubid/ietf/builder.rb +78 -0
- data/lib/pubid/ietf/identifier.rb +5 -0
- data/lib/pubid/ietf/identifiers/base.rb +72 -0
- data/lib/pubid/ietf/identifiers/bcp.rb +36 -0
- data/lib/pubid/ietf/identifiers/fyi.rb +36 -0
- data/lib/pubid/ietf/identifiers/internet_draft.rb +45 -0
- data/lib/pubid/ietf/identifiers/rfc.rb +27 -0
- data/lib/pubid/ietf/identifiers/serialization.rb +51 -0
- data/lib/pubid/ietf/identifiers/std.rb +36 -0
- data/lib/pubid/ietf/identifiers.rb +14 -0
- data/lib/pubid/ietf/parser.rb +61 -0
- data/lib/pubid/ietf/renderer.rb +64 -0
- data/lib/pubid/ietf/urn_generator.rb +37 -0
- data/lib/pubid/ietf/urn_parser.rb +43 -0
- data/lib/pubid/ietf.rb +85 -0
- data/lib/pubid/iho/builder.rb +37 -0
- data/lib/pubid/iho/identifier.rb +7 -0
- data/lib/pubid/iho/identifiers/base.rb +75 -0
- data/lib/pubid/iho/identifiers/bibliographic.rb +16 -0
- data/lib/pubid/iho/identifiers/circular_letter.rb +15 -0
- data/lib/pubid/iho/identifiers/miscellaneous.rb +16 -0
- data/lib/pubid/iho/identifiers/publication.rb +15 -0
- data/lib/pubid/iho/identifiers/standard.rb +15 -0
- data/lib/pubid/iho/identifiers.rb +13 -0
- data/lib/pubid/iho/parser.rb +68 -0
- data/lib/pubid/iho/renderer.rb +30 -0
- data/lib/pubid/iho/urn_generator.rb +29 -0
- data/lib/pubid/iho/urn_parser.rb +58 -0
- data/lib/pubid/iho.rb +77 -0
- data/lib/pubid/isbn/builder.rb +44 -0
- data/lib/pubid/isbn/check_digit.rb +53 -0
- data/lib/pubid/isbn/identifier.rb +81 -0
- data/lib/pubid/isbn/identifiers/book.rb +30 -0
- data/lib/pubid/isbn/identifiers.rb +9 -0
- data/lib/pubid/isbn/parser.rb +45 -0
- data/lib/pubid/isbn/renderer.rb +16 -0
- data/lib/pubid/isbn.rb +52 -0
- data/lib/pubid/iso/builder.rb +316 -0
- data/lib/pubid/iso/bundled_identifier.rb +138 -0
- data/lib/pubid/iso/combined_identifier.rb +24 -0
- data/lib/pubid/iso/components/code.rb +24 -0
- data/lib/pubid/iso/components/publisher.rb +62 -0
- data/lib/pubid/iso/components.rb +10 -0
- data/lib/pubid/iso/format_resolver.rb +45 -0
- data/lib/pubid/iso/identifier.rb +318 -0
- data/lib/pubid/iso/identifiers/addendum.rb +107 -0
- data/lib/pubid/iso/identifiers/amendment.rb +132 -0
- data/lib/pubid/iso/identifiers/corrigendum.rb +108 -0
- data/lib/pubid/iso/identifiers/data.rb +75 -0
- data/lib/pubid/iso/identifiers/directives.rb +65 -0
- data/lib/pubid/iso/identifiers/directives_supplement.rb +148 -0
- data/lib/pubid/iso/identifiers/extract.rb +30 -0
- data/lib/pubid/iso/identifiers/guide.rb +99 -0
- data/lib/pubid/iso/identifiers/international_standard.rb +168 -0
- data/lib/pubid/iso/identifiers/international_standardized_profile.rb +94 -0
- data/lib/pubid/iso/identifiers/international_workshop_agreement.rb +95 -0
- data/lib/pubid/iso/identifiers/pas.rb +93 -0
- data/lib/pubid/iso/identifiers/recommendation.rb +45 -0
- data/lib/pubid/iso/identifiers/supplement.rb +95 -0
- data/lib/pubid/iso/identifiers/tc_document.rb +137 -0
- data/lib/pubid/iso/identifiers/technical_report.rb +103 -0
- data/lib/pubid/iso/identifiers/technical_specification.rb +102 -0
- data/lib/pubid/iso/identifiers/technology_trends_assessments.rb +95 -0
- data/lib/pubid/iso/identifiers.rb +32 -0
- data/lib/pubid/iso/normalizer.rb +89 -0
- data/lib/pubid/iso/parser.rb +534 -0
- data/lib/pubid/iso/rendering_style.rb +120 -0
- data/lib/pubid/iso/single_identifier.rb +60 -0
- data/lib/pubid/iso/supplement_identifier.rb +53 -0
- data/lib/pubid/iso/urn_generator.rb +313 -0
- data/lib/pubid/iso/urn_parser.rb +442 -0
- data/lib/pubid/iso/utilities.rb +86 -0
- data/lib/pubid/iso.rb +236 -0
- data/lib/pubid/itu/builder.rb +360 -0
- data/lib/pubid/itu/components/code.rb +84 -0
- data/lib/pubid/itu/components/designation.rb +35 -0
- data/lib/pubid/itu/components/sector.rb +46 -0
- data/lib/pubid/itu/components/series.rb +25 -0
- data/lib/pubid/itu/components.rb +12 -0
- data/lib/pubid/itu/i18n.rb +9 -0
- data/lib/pubid/itu/i18n.yaml +30 -0
- data/lib/pubid/itu/identifier.rb +4 -0
- data/lib/pubid/itu/identifiers/addendum.rb +15 -0
- data/lib/pubid/itu/identifiers/amendment.rb +19 -0
- data/lib/pubid/itu/identifiers/annex.rb +83 -0
- data/lib/pubid/itu/identifiers/annex_of_recommendation.rb +87 -0
- data/lib/pubid/itu/identifiers/appendix_of_recommendation.rb +92 -0
- data/lib/pubid/itu/identifiers/base.rb +482 -0
- data/lib/pubid/itu/identifiers/combined_identifier.rb +121 -0
- data/lib/pubid/itu/identifiers/corrigendum.rb +35 -0
- data/lib/pubid/itu/identifiers/errata.rb +15 -0
- data/lib/pubid/itu/identifiers/handbook.rb +38 -0
- data/lib/pubid/itu/identifiers/question.rb +63 -0
- data/lib/pubid/itu/identifiers/recommendation.rb +15 -0
- data/lib/pubid/itu/identifiers/report.rb +39 -0
- data/lib/pubid/itu/identifiers/special_publication.rb +31 -0
- data/lib/pubid/itu/identifiers/standard_serialization.rb +58 -0
- data/lib/pubid/itu/identifiers/supplement.rb +149 -0
- data/lib/pubid/itu/identifiers.rb +25 -0
- data/lib/pubid/itu/model.rb +111 -0
- data/lib/pubid/itu/parser.rb +679 -0
- data/lib/pubid/itu/urn_generator.rb +135 -0
- data/lib/pubid/itu/urn_parser.rb +31 -0
- data/lib/pubid/itu.rb +78 -0
- data/lib/pubid/jcgm/builder.rb +106 -0
- data/lib/pubid/jcgm/components/publisher.rb +20 -0
- data/lib/pubid/jcgm/components.rb +9 -0
- data/lib/pubid/jcgm/identifier.rb +21 -0
- data/lib/pubid/jcgm/identifiers/amendment.rb +24 -0
- data/lib/pubid/jcgm/identifiers/corrigendum.rb +34 -0
- data/lib/pubid/jcgm/identifiers/guide.rb +21 -0
- data/lib/pubid/jcgm/identifiers/gum_guide.rb +39 -0
- data/lib/pubid/jcgm/identifiers/meeting.rb +47 -0
- data/lib/pubid/jcgm/identifiers.rb +13 -0
- data/lib/pubid/jcgm/parser.rb +151 -0
- data/lib/pubid/jcgm/renderer.rb +89 -0
- data/lib/pubid/jcgm/single_identifier.rb +118 -0
- data/lib/pubid/jcgm/supplement_identifier.rb +51 -0
- data/lib/pubid/jcgm/urn_generator.rb +116 -0
- data/lib/pubid/jcgm/urn_parser.rb +177 -0
- data/lib/pubid/jcgm.rb +86 -0
- data/lib/pubid/jis/builder.rb +116 -0
- data/lib/pubid/jis/identifier.rb +194 -0
- data/lib/pubid/jis/identifiers/amendment.rb +16 -0
- data/lib/pubid/jis/identifiers/corrigendum.rb +16 -0
- data/lib/pubid/jis/identifiers/explanation.rb +22 -0
- data/lib/pubid/jis/identifiers/japanese_industrial_standard.rb +16 -0
- data/lib/pubid/jis/identifiers/standard.rb +28 -0
- data/lib/pubid/jis/identifiers/technical_report.rb +32 -0
- data/lib/pubid/jis/identifiers/technical_specification.rb +32 -0
- data/lib/pubid/jis/identifiers.rb +17 -0
- data/lib/pubid/jis/parser.rb +135 -0
- data/lib/pubid/jis/renderer.rb +69 -0
- data/lib/pubid/jis/single_identifier.rb +31 -0
- data/lib/pubid/jis/supplement_identifier.rb +50 -0
- data/lib/pubid/jis/urn_generator.rb +25 -0
- data/lib/pubid/jis/urn_parser.rb +23 -0
- data/lib/pubid/jis.rb +69 -0
- data/lib/pubid/lutaml/no_store_registration.rb +30 -0
- data/lib/pubid/nist/builder.rb +481 -0
- data/lib/pubid/nist/caster.rb +1234 -0
- data/lib/pubid/nist/circular_supplement_builder.rb +293 -0
- data/lib/pubid/nist/components/code.rb +27 -0
- data/lib/pubid/nist/components/edition.rb +134 -0
- data/lib/pubid/nist/components/issue_number.rb +28 -0
- data/lib/pubid/nist/components/part.rb +77 -0
- data/lib/pubid/nist/components/stage.rb +53 -0
- data/lib/pubid/nist/components/supplement.rb +191 -0
- data/lib/pubid/nist/components/translation.rb +42 -0
- data/lib/pubid/nist/components/update.rb +103 -0
- data/lib/pubid/nist/components/version.rb +35 -0
- data/lib/pubid/nist/components/volume.rb +32 -0
- data/lib/pubid/nist/components.rb +18 -0
- data/lib/pubid/nist/configuration.rb +87 -0
- data/lib/pubid/nist/identifier.rb +8 -0
- data/lib/pubid/nist/identifiers/base.rb +744 -0
- data/lib/pubid/nist/identifiers/circular.rb +80 -0
- data/lib/pubid/nist/identifiers/circular_supplement.rb +60 -0
- data/lib/pubid/nist/identifiers/commercial_standard.rb +42 -0
- data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +58 -0
- data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +69 -0
- data/lib/pubid/nist/identifiers/crpl_report.rb +138 -0
- data/lib/pubid/nist/identifiers/dated_document.rb +49 -0
- data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +95 -0
- data/lib/pubid/nist/identifiers/grant_contractor_report.rb +36 -0
- data/lib/pubid/nist/identifiers/handbook.rb +58 -0
- data/lib/pubid/nist/identifiers/internal_report.rb +64 -0
- data/lib/pubid/nist/identifiers/letter_circular.rb +46 -0
- data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +74 -0
- data/lib/pubid/nist/identifiers/monograph.rb +80 -0
- data/lib/pubid/nist/identifiers/ncstar.rb +41 -0
- data/lib/pubid/nist/identifiers/nsrds.rb +41 -0
- data/lib/pubid/nist/identifiers/owmwp.rb +35 -0
- data/lib/pubid/nist/identifiers/report.rb +77 -0
- data/lib/pubid/nist/identifiers/special_publication.rb +46 -0
- data/lib/pubid/nist/identifiers/technical_note.rb +91 -0
- data/lib/pubid/nist/identifiers.rb +33 -0
- data/lib/pubid/nist/parser.rb +752 -0
- data/lib/pubid/nist/parser_output_normalizer.rb +233 -0
- data/lib/pubid/nist/preprocessor.rb +443 -0
- data/lib/pubid/nist/renderer.rb +43 -0
- data/lib/pubid/nist/router.rb +149 -0
- data/lib/pubid/nist/series/base.rb +58 -0
- data/lib/pubid/nist/series/crpl.rb +13 -0
- data/lib/pubid/nist/series/fips.rb +14 -0
- data/lib/pubid/nist/series/ir.rb +57 -0
- data/lib/pubid/nist/series/letter_preserving.rb +15 -0
- data/lib/pubid/nist/series/mono.rb +19 -0
- data/lib/pubid/nist/series/ncstar.rb +20 -0
- data/lib/pubid/nist/series.rb +49 -0
- data/lib/pubid/nist/supplement_identifier.rb +84 -0
- data/lib/pubid/nist/urn_generator.rb +133 -0
- data/lib/pubid/nist/urn_parser.rb +67 -0
- data/lib/pubid/nist.rb +138 -0
- data/lib/pubid/oasis/builder.rb +79 -0
- data/lib/pubid/oasis/identifier.rb +160 -0
- data/lib/pubid/oasis/identifiers/standard.rb +29 -0
- data/lib/pubid/oasis/identifiers.rb +9 -0
- data/lib/pubid/oasis/parser.rb +34 -0
- data/lib/pubid/oasis/renderer.rb +29 -0
- data/lib/pubid/oasis/urn_generator.rb +25 -0
- data/lib/pubid/oasis/urn_parser.rb +22 -0
- data/lib/pubid/oasis.rb +79 -0
- data/lib/pubid/ogc/builder.rb +33 -0
- data/lib/pubid/ogc/identifier.rb +81 -0
- data/lib/pubid/ogc/identifiers/document.rb +26 -0
- data/lib/pubid/ogc/identifiers.rb +10 -0
- data/lib/pubid/ogc/parser.rb +40 -0
- data/lib/pubid/ogc/renderer.rb +33 -0
- data/lib/pubid/ogc/urn_generator.rb +14 -0
- data/lib/pubid/ogc/urn_parser.rb +22 -0
- data/lib/pubid/ogc.rb +71 -0
- data/lib/pubid/oiml/builder.rb +270 -0
- data/lib/pubid/oiml/components/code.rb +37 -0
- data/lib/pubid/oiml/components.rb +9 -0
- data/lib/pubid/oiml/identifier.rb +64 -0
- data/lib/pubid/oiml/identifiers/amendment.rb +13 -0
- data/lib/pubid/oiml/identifiers/annex.rb +29 -0
- data/lib/pubid/oiml/identifiers/basic_publication.rb +15 -0
- data/lib/pubid/oiml/identifiers/bulletin.rb +137 -0
- data/lib/pubid/oiml/identifiers/code_number.rb +90 -0
- data/lib/pubid/oiml/identifiers/document.rb +15 -0
- data/lib/pubid/oiml/identifiers/errata.rb +15 -0
- data/lib/pubid/oiml/identifiers/expert_report.rb +15 -0
- data/lib/pubid/oiml/identifiers/guide.rb +15 -0
- data/lib/pubid/oiml/identifiers/recommendation.rb +15 -0
- data/lib/pubid/oiml/identifiers/seminar_report.rb +15 -0
- data/lib/pubid/oiml/identifiers/vocabulary.rb +15 -0
- data/lib/pubid/oiml/identifiers.rb +20 -0
- data/lib/pubid/oiml/parser.rb +274 -0
- data/lib/pubid/oiml/renderer.rb +232 -0
- data/lib/pubid/oiml/single_identifier.rb +113 -0
- data/lib/pubid/oiml/supplement_identifier.rb +88 -0
- data/lib/pubid/oiml/urn_generator.rb +78 -0
- data/lib/pubid/oiml/urn_parser.rb +39 -0
- data/lib/pubid/oiml.rb +81 -0
- data/lib/pubid/omg/builder.rb +19 -0
- data/lib/pubid/omg/identifier.rb +47 -0
- data/lib/pubid/omg/identifiers/specification.rb +32 -0
- data/lib/pubid/omg/identifiers.rb +9 -0
- data/lib/pubid/omg/parser.rb +40 -0
- data/lib/pubid/omg/renderer.rb +19 -0
- data/lib/pubid/omg.rb +51 -0
- data/lib/pubid/parser/common_parse_methods.rb +13 -0
- data/lib/pubid/parser/common_parse_rules.rb +56 -0
- data/lib/pubid/parser/grammar.rb +74 -0
- data/lib/pubid/parser.rb +9 -0
- data/lib/pubid/parsers/base.rb +11 -0
- data/lib/pubid/parsers/mr_string.rb +206 -0
- data/lib/pubid/plateau/builder.rb +54 -0
- data/lib/pubid/plateau/identifier.rb +4 -0
- data/lib/pubid/plateau/identifiers/annex.rb +16 -0
- data/lib/pubid/plateau/identifiers/base.rb +55 -0
- data/lib/pubid/plateau/identifiers/handbook.rb +28 -0
- data/lib/pubid/plateau/identifiers/technical_report.rb +16 -0
- data/lib/pubid/plateau/identifiers.rb +11 -0
- data/lib/pubid/plateau/parser.rb +73 -0
- data/lib/pubid/plateau/renderer.rb +51 -0
- data/lib/pubid/plateau/supplement_identifier.rb +68 -0
- data/lib/pubid/plateau/urn_generator.rb +29 -0
- data/lib/pubid/plateau/urn_parser.rb +43 -0
- data/lib/pubid/plateau.rb +82 -0
- data/lib/pubid/prefixes_support.rb +51 -0
- data/lib/pubid/renderers/annotator.rb +233 -0
- data/lib/pubid/renderers/base.rb +66 -0
- data/lib/pubid/renderers/directives_renderer.rb +75 -0
- data/lib/pubid/renderers/guide_renderer.rb +26 -0
- data/lib/pubid/renderers/human_readable.rb +83 -0
- data/lib/pubid/renderers/iwa_renderer.rb +20 -0
- data/lib/pubid/renderers/mr_string.rb +64 -0
- data/lib/pubid/renderers/supplement_renderer.rb +36 -0
- data/lib/pubid/renderers/urn.rb +11 -0
- data/lib/pubid/renderers.rb +15 -0
- data/lib/pubid/rendering/context.rb +168 -0
- data/lib/pubid/rendering/date.rb +27 -0
- data/lib/pubid/rendering/language.rb +21 -0
- data/lib/pubid/rendering/numbering.rb +42 -0
- data/lib/pubid/rendering/publisher.rb +25 -0
- data/lib/pubid/rendering/stage.rb +38 -0
- data/lib/pubid/rendering/supplement.rb +46 -0
- data/lib/pubid/rendering.rb +13 -0
- data/lib/pubid/sae/builder.rb +32 -0
- data/lib/pubid/sae/components/code.rb +9 -0
- data/lib/pubid/sae/components/date.rb +27 -0
- data/lib/pubid/sae/components/type.rb +23 -0
- data/lib/pubid/sae/components.rb +11 -0
- data/lib/pubid/sae/identifier.rb +4 -0
- data/lib/pubid/sae/identifiers/base.rb +47 -0
- data/lib/pubid/sae/identifiers.rb +8 -0
- data/lib/pubid/sae/parser.rb +55 -0
- data/lib/pubid/sae/renderer.rb +36 -0
- data/lib/pubid/sae/urn_generator.rb +30 -0
- data/lib/pubid/sae/urn_parser.rb +36 -0
- data/lib/pubid/sae.rb +66 -0
- data/lib/pubid/tgpp/builder.rb +41 -0
- data/lib/pubid/tgpp/identifier.rb +107 -0
- data/lib/pubid/tgpp/identifiers/technical_report.rb +32 -0
- data/lib/pubid/tgpp/identifiers/technical_specification.rb +33 -0
- data/lib/pubid/tgpp/identifiers.rb +11 -0
- data/lib/pubid/tgpp/parser.rb +78 -0
- data/lib/pubid/tgpp/renderer.rb +52 -0
- data/lib/pubid/tgpp/urn_generator.rb +39 -0
- data/lib/pubid/tgpp/urn_parser.rb +30 -0
- data/lib/pubid/tgpp.rb +83 -0
- data/lib/pubid/type_resolver.rb +59 -0
- data/lib/pubid/un/builder.rb +42 -0
- data/lib/pubid/un/identifier.rb +40 -0
- data/lib/pubid/un/identifiers/document.rb +24 -0
- data/lib/pubid/un/identifiers.rb +9 -0
- data/lib/pubid/un/parser.rb +25 -0
- data/lib/pubid/un/renderer.rb +11 -0
- data/lib/pubid/un.rb +46 -0
- data/lib/pubid/urn_generator/base.rb +110 -0
- data/lib/pubid/urn_parser/base.rb +81 -0
- data/lib/pubid/urn_parser/errors.rb +16 -0
- data/lib/pubid/urn_parser.rb +14 -0
- data/lib/pubid/utils/string_normalizer.rb +196 -0
- data/lib/pubid/utils.rb +7 -0
- data/lib/pubid/version.rb +3 -1
- data/lib/pubid/w3c/builder.rb +55 -0
- data/lib/pubid/w3c/identifier.rb +130 -0
- data/lib/pubid/w3c/identifiers/candidate_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/candidate_recommendation_draft.rb +31 -0
- data/lib/pubid/w3c/identifiers/draft_note.rb +31 -0
- data/lib/pubid/w3c/identifiers/note.rb +30 -0
- data/lib/pubid/w3c/identifiers/obsolete_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/proposed_edited_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/proposed_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/standard.rb +12 -0
- data/lib/pubid/w3c/identifiers/superseded_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/working_draft.rb +30 -0
- data/lib/pubid/w3c/identifiers.rb +25 -0
- data/lib/pubid/w3c/parser.rb +43 -0
- data/lib/pubid/w3c/renderer.rb +35 -0
- data/lib/pubid/w3c/urn_generator.rb +18 -0
- data/lib/pubid/w3c/urn_parser.rb +36 -0
- data/lib/pubid/w3c.rb +67 -0
- data/lib/pubid/xsf/builder.rb +17 -0
- data/lib/pubid/xsf/identifier.rb +66 -0
- data/lib/pubid/xsf/identifiers/xep.rb +31 -0
- data/lib/pubid/xsf/identifiers.rb +9 -0
- data/lib/pubid/xsf/parser.rb +25 -0
- data/lib/pubid/xsf/renderer.rb +23 -0
- data/lib/pubid/xsf/urn_generator.rb +13 -0
- data/lib/pubid/xsf/urn_parser.rb +18 -0
- data/lib/pubid/xsf.rb +81 -0
- data/lib/pubid.rb +551 -13
- data/lib/tasks/docs.rake +37 -0
- data/lib/tasks/export.rake +39 -0
- data/lib/tasks/website-data.json +7546 -0
- metadata +875 -171
- data/lib/pubid/registry.rb +0 -30
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Ieee
|
|
5
|
+
module Identifiers
|
|
6
|
+
# Dual Published Identifier
|
|
7
|
+
# Document jointly published by two organizations
|
|
8
|
+
# Example: "ANSI C37.61-1973 and IEEE Std 321-1973"
|
|
9
|
+
# This means the document was published together by both organizations
|
|
10
|
+
class DualPublished < Identifier
|
|
11
|
+
# First organization's identifier
|
|
12
|
+
attribute :first_identifier, Identifier, polymorphic: true
|
|
13
|
+
|
|
14
|
+
# Second organization's identifier
|
|
15
|
+
attribute :second_identifier, Identifier, polymorphic: true
|
|
16
|
+
|
|
17
|
+
def publisher
|
|
18
|
+
# Return array of both publishers
|
|
19
|
+
[first_identifier&.publisher, second_identifier&.publisher].compact
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# `publisher` above is DERIVED from the two member identifiers (the
|
|
23
|
+
# serialized source of truth), so it must not be serialized itself.
|
|
24
|
+
# Emitting it breaks the canonical round-trip exactly as it did on
|
|
25
|
+
# Identifiers::AdoptedStandard and Identifiers::JointDevelopment: the
|
|
26
|
+
# derived value is default-omitted on the parse path (the attribute is
|
|
27
|
+
# unset), but re-emitted once from_hash materializes the attribute
|
|
28
|
+
# default, because the override then returns the members' publishers
|
|
29
|
+
# rather than the "IEEE" default. Worse here, it is an ARRAY, so the
|
|
30
|
+
# re-emitted value was the literal string `["IEEE", "IEEE"]`.
|
|
31
|
+
#
|
|
32
|
+
# This made all 25 DualPublished ids in the fixture corpus fail
|
|
33
|
+
# `from_hash(to_hash) == to_hash` — the gate relaton's index build
|
|
34
|
+
# uses, which SKIPS a document that fails it. Dropping the key is
|
|
35
|
+
# lossless: first_identifier and second_identifier rebuild it.
|
|
36
|
+
#
|
|
37
|
+
# A top-level to_hash delete is sufficient because DualPublished is
|
|
38
|
+
# only ever a top-level wrapper, never a nested `base` (where lutaml's
|
|
39
|
+
# own transform would bypass this override).
|
|
40
|
+
def to_hash(*args)
|
|
41
|
+
hash = super
|
|
42
|
+
hash.delete("publisher") if hash.is_a?(::Hash)
|
|
43
|
+
hash
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# A dual-published document is one document under two designations, and
|
|
47
|
+
# this wrapper carries neither number itself — so `root.number`, the key
|
|
48
|
+
# relaton-index sorts and bsearches on, was "". Walk to the first
|
|
49
|
+
# designation, which is the one the printed reference leads with.
|
|
50
|
+
def root
|
|
51
|
+
first_identifier ? first_identifier.root : self
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Carry the number onto the URN and the MR slug as well as #root — see
|
|
55
|
+
# AdoptedStandard#code_obj for why all three surfaces need it.
|
|
56
|
+
def code_obj
|
|
57
|
+
first_identifier&.code_obj
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# See AdoptedStandard#mr_year — without it the 1989 and the 1993
|
|
61
|
+
# printings of "IEEE Std 960 and IEEE Std 1177" shared one slug.
|
|
62
|
+
def mr_year
|
|
63
|
+
(year || first_identifier&.year)&.to_s
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# `#publisher` above returns an ARRAY, and the inherited `mr_publisher`
|
|
67
|
+
# is `publisher&.to_s&.downcase` — so the MR slug contained a literal
|
|
68
|
+
# Ruby array (`["ieee", "asme"]`, brackets, quotes, comma and space
|
|
69
|
+
# included) and `to_slug` is an output FILENAME. Join the two instead,
|
|
70
|
+
# keeping both publishers in the slug: they are equally part of this
|
|
71
|
+
# document's identity, so by the project rule both must reach it.
|
|
72
|
+
def mr_publisher
|
|
73
|
+
names = Array(publisher).map { |p| p.to_s.downcase }.reject(&:empty?)
|
|
74
|
+
names.empty? ? nil : names.join("-")
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Ieee
|
|
5
|
+
module Identifiers
|
|
6
|
+
# IEC/IEEE Copublished Identifier - standards copublished by IEC and IEEE.
|
|
7
|
+
# Example: "IEC/IEEE 60079-30-2/D5 IEC:2013 (10/07)"
|
|
8
|
+
#
|
|
9
|
+
# The printed IEC/IEEE number is stored as split index columns rather than
|
|
10
|
+
# a verbatim string: `number` (bare-digit narrowing key), `parts` (matched
|
|
11
|
+
# within the bucket), `separators` (per-part `.`/`-`, since a single code
|
|
12
|
+
# mixes them, e.g. `60076.57-1202`), and the trailing publication `year`
|
|
13
|
+
# (inherited from the base; attached with `year_sep`, always `-` in
|
|
14
|
+
# practice). The verbatim `copublished_number` is reconstructed from these
|
|
15
|
+
# for rendering — see #copublished_number — so it is NOT serialized.
|
|
16
|
+
class IecIeeeCopublished < Identifier
|
|
17
|
+
attribute :number, :string
|
|
18
|
+
attribute :parts, :string, collection: true, default: -> { [] }
|
|
19
|
+
attribute :separators, :string, collection: true, default: -> { [] }
|
|
20
|
+
attribute :year_sep, :string, default: -> { "-" }
|
|
21
|
+
# `year` is inherited from the base (:string).
|
|
22
|
+
|
|
23
|
+
attribute :iec_identifier, Identifier, polymorphic: true
|
|
24
|
+
attribute :ieee_identifier, Identifier, polymorphic: true
|
|
25
|
+
attribute :draft_info, :string # Draft information like "/D5"
|
|
26
|
+
attribute :iec_year, :string # IEC year like "2013"
|
|
27
|
+
attribute :date_info, :string # Date information like "(10/07)"
|
|
28
|
+
|
|
29
|
+
# The printed IEC/IEEE number, rebuilt losslessly from the split
|
|
30
|
+
# columns (the renderer/urn read this). Not stored — number/parts/
|
|
31
|
+
# separators/year fully describe it, so the verbatim string never
|
|
32
|
+
# bloats an index row.
|
|
33
|
+
# @param mark [String] IEEE trademark symbol, spliced in after the
|
|
34
|
+
# number and its parts and before the publication year (IEEE prints
|
|
35
|
+
# it there); "" for the ordinary, unmarked rendering.
|
|
36
|
+
def copublished_number(mark = "")
|
|
37
|
+
return nil if number.to_s.empty?
|
|
38
|
+
|
|
39
|
+
code = marked_code(mark)
|
|
40
|
+
code += "#{year_sep}#{year}" if year
|
|
41
|
+
code
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# The dotted/dashed parts portion, each part with its own separator.
|
|
45
|
+
def parts_suffix
|
|
46
|
+
separators.zip(parts).map { |sep, part| "#{sep}#{part}" }.join
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# A stage word printed ahead of the number (`FDIS 60079-30-2`,
|
|
50
|
+
# `CD2 P62704-5 ED1`, `TS P61869-105 ED1`). The lookahead — the next
|
|
51
|
+
# token must start like a document number — is what stops this eating a
|
|
52
|
+
# number that merely begins with a letter.
|
|
53
|
+
STAGE_PREFIX = /\A[A-Z]+\d*\s+(?=P?\d)/
|
|
54
|
+
|
|
55
|
+
# Inside the number token, the printed code stops early at:
|
|
56
|
+
#
|
|
57
|
+
# * a colon-attached publication year (`62582-2:2022`);
|
|
58
|
+
# * a dash/dot-attached 19xx/20xx year (`62395.1-2024 Redline`) — only
|
|
59
|
+
# one a descriptive tail stranded inside the code gets here, since
|
|
60
|
+
# #peel_copublished_year moves a genuinely trailing year into the
|
|
61
|
+
# `year` attribute. The 19/20 prefix keeps a part that merely looks
|
|
62
|
+
# like a year (`60076.57-1202`) from matching;
|
|
63
|
+
# * a glued parenthetical (`62704-1(E)`), which is a language marker
|
|
64
|
+
# rather than part of the number.
|
|
65
|
+
CODE_END = /:\d{4}|[-.](?:19|20)\d{2}\z|\(/
|
|
66
|
+
|
|
67
|
+
# `number` + #parts_suffix with the mark spliced at the end of the code
|
|
68
|
+
# proper.
|
|
69
|
+
#
|
|
70
|
+
# Some copublished references carry an edition, a colon year, a stage
|
|
71
|
+
# word or a "- Redline" tail that the parser keeps inside
|
|
72
|
+
# `number`/`parts` rather than in dedicated attributes; appending the
|
|
73
|
+
# mark after all of it would print
|
|
74
|
+
# `IEC/IEEE 60076-16 Edition 2.0 2018-09™` instead of
|
|
75
|
+
# `IEC/IEEE 60076-16™ Edition 2.0 2018-09`. Scanning the whole printed
|
|
76
|
+
# code (not just the suffix) matters because the split point varies —
|
|
77
|
+
# `60802 Edition 1` lands in `number`, `-16 Edition 2` in `parts`.
|
|
78
|
+
#
|
|
79
|
+
# With the flag off `mark` is "" and this returns the code unchanged, so
|
|
80
|
+
# the plain rendering is byte-identical by construction.
|
|
81
|
+
def marked_code(mark)
|
|
82
|
+
code = "#{number}#{parts_suffix}"
|
|
83
|
+
return code if mark.to_s.empty?
|
|
84
|
+
|
|
85
|
+
at = code_end_index(code)
|
|
86
|
+
"#{code[0...at]}#{mark}#{code[at..]}"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Index at which the printed code ends and descriptive text begins.
|
|
90
|
+
#
|
|
91
|
+
# The number is the first whitespace-delimited token after any stage
|
|
92
|
+
# word, so the code can never run past that token's end — which is what
|
|
93
|
+
# keeps the mark off a trailing edition/date phrase even when no
|
|
94
|
+
# CODE_END boundary matches inside the token.
|
|
95
|
+
def code_end_index(code)
|
|
96
|
+
start = code[STAGE_PREFIX]&.length || 0
|
|
97
|
+
token_end = code.index(" ", start) || code.length
|
|
98
|
+
boundary = code[start...token_end].index(CODE_END)
|
|
99
|
+
boundary ? start + boundary : token_end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# The base IEEE #exclude already nils year/month/day; also reset the
|
|
103
|
+
# year separator (a format sibling of the scalar year, per the CSA
|
|
104
|
+
# lesson) so a date-less reference matches a `:`-dated form too.
|
|
105
|
+
def exclude(*args)
|
|
106
|
+
result = super
|
|
107
|
+
if args.intersect?(%i[year date]) && result.respond_to?(:year_sep=)
|
|
108
|
+
result.year_sep = "-"
|
|
109
|
+
end
|
|
110
|
+
result
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Ieee
|
|
5
|
+
module Identifiers
|
|
6
|
+
# Interpretation identifier for IEEE standards
|
|
7
|
+
# Represents an interpretation sheet or clarification
|
|
8
|
+
# Example: IEEE Std 1076/INT-1991, IEEE Std 1003.1-1988/INT
|
|
9
|
+
class InterpretationIdentifier < SupplementIdentifier
|
|
10
|
+
# Uniform `year` (the interpretation year), not `int_year` — inherited
|
|
11
|
+
# from the base, so no attribute is declared here.
|
|
12
|
+
|
|
13
|
+
# The interpreted standard's code must reach the URN. Before this
|
|
14
|
+
# change the flat-parsed form kept its number in the wrapper's own
|
|
15
|
+
# `code_obj` (the builder never built a base), so the URN carried it by
|
|
16
|
+
# accident; now that the number lives on `base` where it belongs, the
|
|
17
|
+
# URN generator has to be pointed at it or the URN silently loses the
|
|
18
|
+
# document number. `code_obj` is a plain attr_accessor, not a lutaml
|
|
19
|
+
# attribute, so overriding it as a method is safe.
|
|
20
|
+
def code_obj
|
|
21
|
+
super || base&.code_obj
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# MR supplement suffix: `int.{year}` — mirrors Corrigendum/Amendment.
|
|
25
|
+
# Without it the MrString renderer slugs an interpretation FLAT off
|
|
26
|
+
# attributes a supplement does not have, instead of recursing into
|
|
27
|
+
# `base`, so every interpretation of every standard collapsed onto
|
|
28
|
+
# "ieee.std.{year}" with no document number at all — and `to_slug` is
|
|
29
|
+
# an output FILENAME.
|
|
30
|
+
def mr_supplement_suffix
|
|
31
|
+
segments = ["int"]
|
|
32
|
+
segments << year.to_s if year
|
|
33
|
+
segments.join(".")
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# TYPED_STAGES for interpretation
|
|
37
|
+
# Interpretation uses "INT" abbreviation
|
|
38
|
+
TYPED_STAGES = [
|
|
39
|
+
Components::TypedStage.new(
|
|
40
|
+
abbr: ["INT"],
|
|
41
|
+
type_code: "interpretation",
|
|
42
|
+
stage_code: "published",
|
|
43
|
+
),
|
|
44
|
+
].freeze
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Ieee
|
|
5
|
+
module Identifiers
|
|
6
|
+
# Handles ISO/IEC/IEEE joint development identifiers
|
|
7
|
+
# Supports bidirectional format conversion between IEEE and ISO representations
|
|
8
|
+
#
|
|
9
|
+
# Joint development standards can be represented in two formats based on lead party:
|
|
10
|
+
#
|
|
11
|
+
# IEEE-led Format (lead_party: "IEEE"):
|
|
12
|
+
# ISO/IEC/IEEE P26511/D8-2018
|
|
13
|
+
# - Publishers: ISO/IEC/IEEE (slash-separated)
|
|
14
|
+
# - Lead party: IEEE (drives development)
|
|
15
|
+
# - P prefix indicates IEEE project (draft)
|
|
16
|
+
# - /D8 indicates IEEE draft notation
|
|
17
|
+
# - Dash before year
|
|
18
|
+
#
|
|
19
|
+
# ISO-led Format (lead_party: "ISO"):
|
|
20
|
+
# ISO/IEC/IEEE FDIS 26511:2018
|
|
21
|
+
# - Publishers: ISO/IEC/IEEE (slash-separated)
|
|
22
|
+
# - Lead party: ISO (drives development)
|
|
23
|
+
# - ISO stage code (FDIS) instead of P/D notation
|
|
24
|
+
# - Colon before year
|
|
25
|
+
#
|
|
26
|
+
# Key principles:
|
|
27
|
+
# - Lead party determines canonical format
|
|
28
|
+
# - NO equivalence mapping (as per IEEE staff guidance)
|
|
29
|
+
# - "P" prefix means IEEE project (any stage)
|
|
30
|
+
# - ISO stages and IEEE drafts can coexist but are not equivalent
|
|
31
|
+
# - Format conversion preserves semantic meaning within each system
|
|
32
|
+
class JointDevelopment < Identifier
|
|
33
|
+
# Split index columns (number/prefix/parts/separator) instead of a
|
|
34
|
+
# `code` string, like every IEEE leaf — see CodeNumber. Rendering reads
|
|
35
|
+
# `code` (base #code → code_obj), which CodeNumber rebuilds from the
|
|
36
|
+
# split fields, so to_ieee_format / to_iso_format are unaffected.
|
|
37
|
+
include CodeNumber
|
|
38
|
+
|
|
39
|
+
attribute :publishers, :string, collection: true
|
|
40
|
+
attribute :lead_party, :string # "IEEE", "ISO", "IEC", etc.
|
|
41
|
+
attribute :typed_stage, Components::TypedStage
|
|
42
|
+
attribute :year, :string
|
|
43
|
+
attribute :iso_stage, :string # For ISO stage if present
|
|
44
|
+
attribute :ieee_draft, :string # For IEEE P/D notation if present
|
|
45
|
+
|
|
46
|
+
# Accepts keyword args or a single positional hash (the base
|
|
47
|
+
# #exclude/matching rebuild passes the latter) — see
|
|
48
|
+
# Identifier#initialize.
|
|
49
|
+
def initialize(args = {}, **kwargs)
|
|
50
|
+
args = args.merge(kwargs) unless kwargs.empty?
|
|
51
|
+
# Call super FIRST to initialize Lutaml::Model attributes
|
|
52
|
+
super(args)
|
|
53
|
+
|
|
54
|
+
# Then handle typed_stage
|
|
55
|
+
if args[:typed_stage].is_a?(Components::TypedStage)
|
|
56
|
+
self.typed_stage = args[:typed_stage]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Set publishers
|
|
60
|
+
if args[:publishers]
|
|
61
|
+
self.publishers = args[:publishers]
|
|
62
|
+
elsif args[:publisher] && args[:copublisher]
|
|
63
|
+
# Combine publisher and copublisher into publishers array
|
|
64
|
+
self.publishers = [args[:publisher], *args[:copublisher]].compact
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Set lead_party if not provided - default to first publisher
|
|
68
|
+
if args[:lead_party]
|
|
69
|
+
self.lead_party = args[:lead_party]
|
|
70
|
+
elsif publishers && !publishers.empty?
|
|
71
|
+
# Lead party defaults to first publisher if not explicitly set
|
|
72
|
+
# Builder should override this with detected lead party
|
|
73
|
+
self.lead_party = publishers.first
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Canonical format based on lead party
|
|
78
|
+
# @return [Symbol] :ieee or :iso
|
|
79
|
+
def canonical_format
|
|
80
|
+
case lead_party
|
|
81
|
+
when "IEEE", "AIEE"
|
|
82
|
+
:ieee
|
|
83
|
+
when "ISO", "IEC"
|
|
84
|
+
:iso
|
|
85
|
+
else
|
|
86
|
+
:ieee # default to IEEE format
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Convert to string representation
|
|
91
|
+
# JointDevelopment has its own dual-format logic (IEEE vs ISO)
|
|
92
|
+
# that doesn't go through the format registry renderer.
|
|
93
|
+
# @param format [Symbol] :ieee or :iso (defaults to canonical_format)
|
|
94
|
+
# @param trademark [Boolean] append the IEEE trademark symbol (™/®)
|
|
95
|
+
# @return [String] formatted identifier
|
|
96
|
+
# `**_opts` absorbs render flags this list does not name (`annotated:`),
|
|
97
|
+
# which the closed keyword list used to reject outright.
|
|
98
|
+
def to_s(format: canonical_format, trademark: false, **opts)
|
|
99
|
+
# The mark goes after the code number, before the draft and the year
|
|
100
|
+
# ("ISO/IEC/IEEE P26511™/D8-2018"), so it is threaded into the
|
|
101
|
+
# format builders rather than appended to the finished string.
|
|
102
|
+
mark = if trademark
|
|
103
|
+
Pubid::Ieee.trademark_symbol_for(code&.number,
|
|
104
|
+
code&.prefix,
|
|
105
|
+
publishers: publishers)
|
|
106
|
+
else
|
|
107
|
+
""
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
result = case format
|
|
111
|
+
when :iso
|
|
112
|
+
to_iso_format(mark)
|
|
113
|
+
else
|
|
114
|
+
to_ieee_format(mark)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
annotate_plain_render(result, **opts)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
private
|
|
121
|
+
|
|
122
|
+
# Convert to ISO format representation
|
|
123
|
+
# ISO/IEC/IEEE FDIS 26511:2018
|
|
124
|
+
# @return [String] ISO format string
|
|
125
|
+
def to_iso_format(mark = "")
|
|
126
|
+
parts = []
|
|
127
|
+
|
|
128
|
+
# Publishers (slash-separated)
|
|
129
|
+
parts << publishers.join("/") if publishers && !publishers.empty?
|
|
130
|
+
|
|
131
|
+
# ISO stage code (only if this was originally ISO-led)
|
|
132
|
+
# For IEEE-led conversions, we skip the stage since we don't have ISO equivalent
|
|
133
|
+
if lead_party == "ISO" && (typed_stage || iso_stage)
|
|
134
|
+
if typed_stage
|
|
135
|
+
parts << typed_stage.to_iso_format
|
|
136
|
+
elsif iso_stage
|
|
137
|
+
parts << iso_stage
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Code (NO P prefix in ISO format, NO draft notation)
|
|
142
|
+
code_str = code.to_s.gsub(/^P/, "")
|
|
143
|
+
code_str += mark unless code_str.empty?
|
|
144
|
+
parts << code_str if code_str && !code_str.empty?
|
|
145
|
+
|
|
146
|
+
# Join with space and add year with colon
|
|
147
|
+
result = parts.join(" ")
|
|
148
|
+
result += ":#{year}" if year
|
|
149
|
+
|
|
150
|
+
result
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Convert to IEEE format representation
|
|
154
|
+
# ISO/IEC/IEEE P26511/D8-2018
|
|
155
|
+
# @return [String] IEEE format string
|
|
156
|
+
def to_ieee_format(mark = "")
|
|
157
|
+
parts = []
|
|
158
|
+
|
|
159
|
+
# Publishers (slash-separated)
|
|
160
|
+
parts << publishers.join("/") if publishers && !publishers.empty?
|
|
161
|
+
|
|
162
|
+
# Build code part
|
|
163
|
+
code_str = code.to_s.gsub(/^P/, "") # Remove any existing P first
|
|
164
|
+
|
|
165
|
+
# Add P prefix for projects (IEEE format always shows P for drafts)
|
|
166
|
+
if typed_stage&.project_status || type == "P"
|
|
167
|
+
code_str = "P#{code_str}"
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Mark after the number, before the draft and the year
|
|
171
|
+
code_str += mark unless code_str.empty?
|
|
172
|
+
|
|
173
|
+
# Add IEEE draft notation if available (e.g., /D8)
|
|
174
|
+
if ieee_draft
|
|
175
|
+
code_str += "/#{ieee_draft}"
|
|
176
|
+
elsif typed_stage&.ieee_draft_equivalent
|
|
177
|
+
code_str += "/#{typed_stage.ieee_draft_equivalent}"
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
parts << code_str if code_str && !code_str.empty?
|
|
181
|
+
|
|
182
|
+
# Join with space and add year with dash
|
|
183
|
+
result = parts.join(" ")
|
|
184
|
+
result += "-#{year}" if year
|
|
185
|
+
|
|
186
|
+
result
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Public again: these override base accessors and MUST be public — lutaml
|
|
190
|
+
# serialization calls `public_send(:publisher)`, so leaving them under the
|
|
191
|
+
# `private` above made JointDevelopment#to_hash raise (it could not be
|
|
192
|
+
# serialized or round-tripped / indexed at all).
|
|
193
|
+
public
|
|
194
|
+
|
|
195
|
+
# Override to ensure proper publisher handling
|
|
196
|
+
def publisher
|
|
197
|
+
publishers&.first || super
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Override to ensure proper copublisher handling
|
|
201
|
+
def copublisher
|
|
202
|
+
publishers&.drop(1) || super
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# `publisher`/`copublisher` are *derived* from `publishers` (the source
|
|
206
|
+
# of truth, which IS serialized). Emitting them too breaks the canonical
|
|
207
|
+
# round-trip: the derived `publisher` is default-omitted on the parse
|
|
208
|
+
# path but re-emitted after from_hash (the override returns
|
|
209
|
+
# publishers.first, not the default). Drop both — publishers rebuilds
|
|
210
|
+
# them. (JointDevelopment is a top-level root, never nested, so a
|
|
211
|
+
# to_hash-level drop is sufficient.)
|
|
212
|
+
def to_hash(*args)
|
|
213
|
+
hash = super
|
|
214
|
+
if hash.is_a?(::Hash)
|
|
215
|
+
hash.delete("publisher")
|
|
216
|
+
hash.delete("copublisher")
|
|
217
|
+
end
|
|
218
|
+
hash
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Ieee
|
|
5
|
+
module Identifiers
|
|
6
|
+
# Multi-Numbered Identifier
|
|
7
|
+
# Represents a single document published under multiple numbers
|
|
8
|
+
# Examples:
|
|
9
|
+
# - "IEEE Std 1299/C62.22.1-1996" (same document, two numbers)
|
|
10
|
+
# - "IEEE Std 960-1989, Std 1177-1989" (same document, two numbers)
|
|
11
|
+
class MultiNumberedIdentifier < Identifier
|
|
12
|
+
# Both designations are real lutaml attributes.
|
|
13
|
+
#
|
|
14
|
+
# They used to be `attr_accessor`s, which lutaml cannot see — so
|
|
15
|
+
# `to_hash` emitted {"_type" => "pubid:ieee:multi-numbered-identifier"}
|
|
16
|
+
# and NOTHING else, `from_hash` could not rebuild either member, and
|
|
17
|
+
# `#exclude` (which iterates self.class.attributes) skipped them. The
|
|
18
|
+
# whole identity was dropped. That is the CSA container defect recorded
|
|
19
|
+
# in CLAUDE.md, and the fix is the same: make the members attributes.
|
|
20
|
+
#
|
|
21
|
+
# The type is the CROSS-FLAVOR ::Pubid::Identifier, not IEEE's own:
|
|
22
|
+
# `polymorphic: true` widens only to subclasses, and the second
|
|
23
|
+
# designation may belong to another body — the same reason
|
|
24
|
+
# AdoptedStandard's members carry that type.
|
|
25
|
+
attribute :primary_identifier, ::Pubid::Identifier, polymorphic: true
|
|
26
|
+
attribute :secondary_identifier, ::Pubid::Identifier, polymorphic: true
|
|
27
|
+
|
|
28
|
+
# One document under two numbers, neither of them held here, so
|
|
29
|
+
# `root.number` was "". Walk to the primary designation.
|
|
30
|
+
def root
|
|
31
|
+
primary_identifier ? primary_identifier.root : self
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Carry the number onto the URN and the MR slug as well as #root — see
|
|
35
|
+
# AdoptedStandard#code_obj.
|
|
36
|
+
def code_obj
|
|
37
|
+
primary_identifier&.code_obj
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# See AdoptedStandard#mr_year. `year` below already delegates, so this
|
|
41
|
+
# only stringifies — it is kept explicit so the hook survives if that
|
|
42
|
+
# delegation is ever removed in favour of the URN generator's
|
|
43
|
+
# `year_component` root fallback.
|
|
44
|
+
def mr_year
|
|
45
|
+
year&.to_s
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def publisher
|
|
49
|
+
primary_identifier&.publisher
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def code
|
|
53
|
+
primary_identifier&.code
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def year
|
|
57
|
+
primary_identifier&.year
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# `publisher` and `year` are DERIVED from primary_identifier — and,
|
|
61
|
+
# since that member became a serialized attribute above, the derived
|
|
62
|
+
# values are now re-emitted after from_hash materializes the attribute
|
|
63
|
+
# defaults, while the parse path omits them as unset. That asymmetry
|
|
64
|
+
# breaks `from_hash(to_hash) == to_hash`, the gate relaton's index
|
|
65
|
+
# build uses to decide whether to keep a document.
|
|
66
|
+
#
|
|
67
|
+
# It is latent rather than live for the one corpus id (its primary is
|
|
68
|
+
# IEEE-published with no year, so both derived values match their
|
|
69
|
+
# defaults and are dropped anyway), but the class documents that its
|
|
70
|
+
# members may belong to another body — and a synthetic AIEE primary
|
|
71
|
+
# reproduces it immediately. Dropping the keys is lossless:
|
|
72
|
+
# primary_identifier rebuilds both. Same treatment as
|
|
73
|
+
# AdoptedStandard#to_hash and DualPublished#to_hash.
|
|
74
|
+
def to_hash(*args)
|
|
75
|
+
hash = super
|
|
76
|
+
return hash unless hash.is_a?(::Hash)
|
|
77
|
+
|
|
78
|
+
hash.delete("publisher")
|
|
79
|
+
hash.delete("year")
|
|
80
|
+
hash
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Ieee
|
|
7
|
+
module Identifiers
|
|
8
|
+
module Nesc
|
|
9
|
+
# Base class for National Electrical Safety Code (NESC) identifiers
|
|
10
|
+
#
|
|
11
|
+
# NESC is published by IEEE Standards Association and covers electrical
|
|
12
|
+
# safety standards for utilities and communication systems.
|
|
13
|
+
#
|
|
14
|
+
# @example Standard format
|
|
15
|
+
# nesc = Pubid::Ieee.parse("C2-1997 National Electric Safety Code")
|
|
16
|
+
# nesc.code.number # => "2" (prefix "C")
|
|
17
|
+
# nesc.year # => "1997"
|
|
18
|
+
#
|
|
19
|
+
# @example Handbook format
|
|
20
|
+
# nesc = Pubid::Ieee.parse("2017 NESC Handbook, Premier Edition")
|
|
21
|
+
# nesc.year # => "2017"
|
|
22
|
+
# nesc.variant # => "Handbook"
|
|
23
|
+
# nesc.edition # => "Premier Edition"
|
|
24
|
+
#
|
|
25
|
+
# Reparented onto Pubid::Ieee::Identifier (it used to descend from bare
|
|
26
|
+
# Lutaml::Model::Serializable) so NESC shares `#root`, a polymorphic
|
|
27
|
+
# `_type` and from_hash routing with every other IEEE type — see
|
|
28
|
+
# Pubid::Ieee::Aiee::Identifier for the same migration. Three
|
|
29
|
+
# attributes were reconciled against the base to avoid type collisions:
|
|
30
|
+
#
|
|
31
|
+
# `code` -> travels as the runtime `code_obj` (base #code returns
|
|
32
|
+
# it); the concrete leaves serialize the flat split
|
|
33
|
+
# columns via the CodeNumber mixin.
|
|
34
|
+
# `year` -> the base's plain `:string` year (was a
|
|
35
|
+
# Pubid::Components::Date), matching IEEE's scalar-date
|
|
36
|
+
# convention. `nesc.year` is now "2017", not a component.
|
|
37
|
+
# `draft` -> dropped; the base declares a `:string` `draft` (the draft
|
|
38
|
+
# *designator*), so a boolean here would corrupt it. Test
|
|
39
|
+
# draft-ness with `#draft?` / the Nesc::Draft class.
|
|
40
|
+
#
|
|
41
|
+
# This class is abstract and enforces it in #initialize: the builder
|
|
42
|
+
# always instantiates a concrete leaf (Nesc::Edition for the plain
|
|
43
|
+
# year-first form), because only leaves may redefine `number` as a
|
|
44
|
+
# :string (see the CodeNumber mixin) and only leaves declare the
|
|
45
|
+
# NESC-specific `polymorphic_name` that from_hash routes on.
|
|
46
|
+
class Base < Pubid::Ieee::Identifier
|
|
47
|
+
attribute :variant, :string # Handbook, Redline, etc.
|
|
48
|
+
# Registered-trademark "(R)" after the full name or abbreviation
|
|
49
|
+
attribute :registered, :boolean
|
|
50
|
+
# Whether the "(NESC)"/"(NESC(R))" abbreviation suffix was present
|
|
51
|
+
attribute :abbr_suffix, :boolean
|
|
52
|
+
# Registered-trademark "(R)" inside the "(NESC(R))" suffix
|
|
53
|
+
attribute :abbr_suffix_registered, :boolean
|
|
54
|
+
|
|
55
|
+
# Guards the abstract contract — see the class docs. Ruby has no
|
|
56
|
+
# `abstract`, and an instantiated Base would carry the derived
|
|
57
|
+
# `_type` "pubid:ieee:base" (which from_hash cannot resolve back to
|
|
58
|
+
# NESC) and a nil `number` (the empty relaton index key).
|
|
59
|
+
def initialize(args = {}, **kwargs)
|
|
60
|
+
if instance_of?(Base)
|
|
61
|
+
raise NotImplementedError,
|
|
62
|
+
"#{self.class} is abstract; instantiate a concrete NESC " \
|
|
63
|
+
"type (Standard, Edition, Handbook, Redline, Draft)"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
super
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Publisher portion for NESC identifiers
|
|
70
|
+
#
|
|
71
|
+
# @return [String] Always returns "NESC"
|
|
72
|
+
def publisher_portion
|
|
73
|
+
"NESC"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Whether this is a draft of the code. NESC has no `draft` attribute
|
|
77
|
+
# of its own (the base's `draft` is the draft designator string), so
|
|
78
|
+
# draft-ness lives in the class.
|
|
79
|
+
#
|
|
80
|
+
# @return [Boolean]
|
|
81
|
+
def draft?
|
|
82
|
+
is_a?(Nesc::Draft)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Rendering for year-first NESC identifiers (the C2-code standard form
|
|
86
|
+
# overrides this in Nesc::Standard). IEEE catalogues the year-first
|
|
87
|
+
# editions with the "IEEE Std" prefix, so it is prepended here.
|
|
88
|
+
#
|
|
89
|
+
# @param trademark [Boolean] append the IEEE trademark symbol (™/®)
|
|
90
|
+
# @return [String] String representation
|
|
91
|
+
def to_s(trademark: false, **opts)
|
|
92
|
+
result = ["IEEE Std", year, name_portion].compact.join(" ")
|
|
93
|
+
result += trademark_symbol if trademark
|
|
94
|
+
annotate_plain_render(result, **opts)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Trademark symbol for this document's own code. A NESC string starts
|
|
98
|
+
# with the publication *year*, so the string-scanning
|
|
99
|
+
# Pubid::Ieee.trademark_symbol would pick the wrong field — an
|
|
100
|
+
# edition year of 2030 would silently render ®.
|
|
101
|
+
#
|
|
102
|
+
# @return [String] "®" or "™"
|
|
103
|
+
def trademark_symbol
|
|
104
|
+
Pubid::Ieee.trademark_symbol_for(code_obj&.number,
|
|
105
|
+
code_obj&.prefix,
|
|
106
|
+
publishers: [publisher])
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# The document-name portion, including the registered marks and the
|
|
110
|
+
# optional "(NESC(R))" abbreviation suffix.
|
|
111
|
+
#
|
|
112
|
+
# @return [String] e.g. "National Electrical Safety Code(R) (NESC(R))"
|
|
113
|
+
def name_portion
|
|
114
|
+
name = "National Electrical Safety Code"
|
|
115
|
+
name += "(R)" if registered
|
|
116
|
+
if abbr_suffix
|
|
117
|
+
suffix = "NESC"
|
|
118
|
+
suffix += "(R)" if abbr_suffix_registered
|
|
119
|
+
name += " (#{suffix})"
|
|
120
|
+
end
|
|
121
|
+
name
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|