pubid 1.15.19 → 2.0.0.pre.alpha.2
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 +2041 -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/ccsds/update_codes.yaml +1 -0
- data/data/iec/update_codes.yaml +67 -0
- data/data/ieee/update_codes.yaml +104 -0
- data/data/iso/update_codes.yaml +21 -0
- data/data/nist/update_codes.yaml +89 -0
- data/data/plateau/update_codes.yaml +6 -0
- data/lib/pubid/amca/builder.rb +176 -0
- data/lib/pubid/amca/identifier.rb +57 -0
- data/lib/pubid/amca/identifiers/base.rb +64 -0
- data/lib/pubid/amca/identifiers/interpretation.rb +51 -0
- data/lib/pubid/amca/identifiers/publication.rb +47 -0
- data/lib/pubid/amca/identifiers/standard.rb +22 -0
- data/lib/pubid/amca/identifiers.rb +12 -0
- data/lib/pubid/amca/parser.rb +153 -0
- data/lib/pubid/amca/scheme.rb +16 -0
- data/lib/pubid/amca/single_identifier.rb +33 -0
- data/lib/pubid/amca/urn_generator.rb +50 -0
- data/lib/pubid/amca.rb +26 -0
- data/lib/pubid/ansi/builder.rb +52 -0
- data/lib/pubid/ansi/identifier.rb +55 -0
- data/lib/pubid/ansi/identifiers/american_national_standard.rb +12 -0
- data/lib/pubid/ansi/identifiers/standard.rb +16 -0
- data/lib/pubid/ansi/identifiers.rb +11 -0
- data/lib/pubid/ansi/parser.rb +91 -0
- data/lib/pubid/ansi/scheme.rb +15 -0
- data/lib/pubid/ansi/single_identifier.rb +45 -0
- data/lib/pubid/ansi/urn_generator.rb +76 -0
- data/lib/pubid/ansi.rb +27 -0
- data/lib/pubid/api/builder.rb +85 -0
- data/lib/pubid/api/components/code.rb +9 -0
- data/lib/pubid/api/identifier.rb +68 -0
- data/lib/pubid/api/identifiers/base.rb +24 -0
- data/lib/pubid/api/identifiers/bulletin.rb +15 -0
- data/lib/pubid/api/identifiers/continuous_operations_standard.rb +15 -0
- data/lib/pubid/api/identifiers/mpms.rb +44 -0
- data/lib/pubid/api/identifiers/publication.rb +15 -0
- data/lib/pubid/api/identifiers/recommended_practice.rb +15 -0
- data/lib/pubid/api/identifiers/specification.rb +15 -0
- data/lib/pubid/api/identifiers/standard.rb +15 -0
- data/lib/pubid/api/identifiers/technical_report.rb +15 -0
- data/lib/pubid/api/identifiers/typeless_standard.rb +27 -0
- data/lib/pubid/api/parser.rb +140 -0
- data/lib/pubid/api/scheme.rb +66 -0
- data/lib/pubid/api/single_identifier.rb +46 -0
- data/lib/pubid/api/urn_generator.rb +41 -0
- data/lib/pubid/api.rb +17 -0
- data/lib/pubid/ashrae/builder.rb +498 -0
- data/lib/pubid/ashrae/identifier.rb +57 -0
- data/lib/pubid/ashrae/identifiers/addenda_package.rb +46 -0
- data/lib/pubid/ashrae/identifiers/addendum.rb +55 -0
- data/lib/pubid/ashrae/identifiers/base.rb +23 -0
- data/lib/pubid/ashrae/identifiers/combined_addenda.rb +51 -0
- data/lib/pubid/ashrae/identifiers/errata.rb +40 -0
- data/lib/pubid/ashrae/identifiers/guideline.rb +38 -0
- data/lib/pubid/ashrae/identifiers/interpretation.rb +39 -0
- data/lib/pubid/ashrae/identifiers/standard.rb +38 -0
- data/lib/pubid/ashrae/identifiers.rb +16 -0
- data/lib/pubid/ashrae/parser.rb +724 -0
- data/lib/pubid/ashrae/scheme.rb +53 -0
- data/lib/pubid/ashrae/single_identifier.rb +23 -0
- data/lib/pubid/ashrae/supplement_identifier.rb +23 -0
- data/lib/pubid/ashrae/urn_generator.rb +59 -0
- data/lib/pubid/ashrae.rb +21 -0
- data/lib/pubid/asme/builder.rb +153 -0
- data/lib/pubid/asme/components/code.rb +18 -0
- data/lib/pubid/asme/identifier.rb +61 -0
- data/lib/pubid/asme/identifiers/base.rb +70 -0
- data/lib/pubid/asme/identifiers/standard.rb +12 -0
- data/lib/pubid/asme/identifiers.rb +10 -0
- data/lib/pubid/asme/parser.rb +308 -0
- data/lib/pubid/asme/scheme.rb +37 -0
- data/lib/pubid/asme/single_identifier.rb +29 -0
- data/lib/pubid/asme/urn_generator.rb +133 -0
- data/lib/pubid/asme.rb +21 -0
- data/lib/pubid/astm/builder.rb +159 -0
- data/lib/pubid/astm/components/code.rb +33 -0
- data/lib/pubid/astm/identifier.rb +92 -0
- data/lib/pubid/astm/identifiers/adjunct.rb +21 -0
- data/lib/pubid/astm/identifiers/base.rb +13 -0
- data/lib/pubid/astm/identifiers/data_series.rb +25 -0
- data/lib/pubid/astm/identifiers/iso_dual_published.rb +74 -0
- data/lib/pubid/astm/identifiers/manual.rb +40 -0
- data/lib/pubid/astm/identifiers/monograph.rb +25 -0
- data/lib/pubid/astm/identifiers/research_report.rb +18 -0
- data/lib/pubid/astm/identifiers/standard.rb +52 -0
- data/lib/pubid/astm/identifiers/technical_report.rb +23 -0
- data/lib/pubid/astm/identifiers/work_in_progress.rb +21 -0
- data/lib/pubid/astm/parser.rb +244 -0
- data/lib/pubid/astm/scheme.rb +55 -0
- data/lib/pubid/astm/single_identifier.rb +25 -0
- data/lib/pubid/astm/urn_generator.rb +99 -0
- data/lib/pubid/astm.rb +38 -0
- data/lib/pubid/bsi/builder.rb +1483 -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 +87 -0
- data/lib/pubid/bsi/identifiers/addendum_document.rb +64 -0
- data/lib/pubid/bsi/identifiers/adopted_european_norm.rb +95 -0
- data/lib/pubid/bsi/identifiers/adopted_international_standard.rb +82 -0
- data/lib/pubid/bsi/identifiers/aerospace_standard.rb +118 -0
- data/lib/pubid/bsi/identifiers/amendment.rb +40 -0
- data/lib/pubid/bsi/identifiers/base.rb +11 -0
- data/lib/pubid/bsi/identifiers/british_industrial_practice.rb +27 -0
- data/lib/pubid/bsi/identifiers/british_standard.rb +33 -0
- data/lib/pubid/bsi/identifiers/bundled_identifier.rb +114 -0
- data/lib/pubid/bsi/identifiers/committee_document.rb +51 -0
- data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +152 -0
- data/lib/pubid/bsi/identifiers/corrigendum.rb +28 -0
- data/lib/pubid/bsi/identifiers/detailed_specification.rb +69 -0
- data/lib/pubid/bsi/identifiers/disc.rb +56 -0
- data/lib/pubid/bsi/identifiers/draft_document.rb +71 -0
- data/lib/pubid/bsi/identifiers/electronic_book.rb +52 -0
- data/lib/pubid/bsi/identifiers/expert_commentary.rb +47 -0
- data/lib/pubid/bsi/identifiers/explanatory_supplement.rb +82 -0
- data/lib/pubid/bsi/identifiers/flex.rb +61 -0
- data/lib/pubid/bsi/identifiers/handbook.rb +39 -0
- data/lib/pubid/bsi/identifiers/index.rb +62 -0
- data/lib/pubid/bsi/identifiers/method.rb +76 -0
- data/lib/pubid/bsi/identifiers/national_annex.rb +73 -0
- data/lib/pubid/bsi/identifiers/practice_guide.rb +27 -0
- data/lib/pubid/bsi/identifiers/publicly_available_specification.rb +79 -0
- data/lib/pubid/bsi/identifiers/published_document.rb +79 -0
- data/lib/pubid/bsi/identifiers/section.rb +62 -0
- data/lib/pubid/bsi/identifiers/set.rb +46 -0
- data/lib/pubid/bsi/identifiers/standalone_amendment.rb +40 -0
- data/lib/pubid/bsi/identifiers/supplement_document.rb +51 -0
- data/lib/pubid/bsi/identifiers/supplementary_index.rb +81 -0
- data/lib/pubid/bsi/identifiers/technical_specification.rb +79 -0
- data/lib/pubid/bsi/identifiers/test_method.rb +67 -0
- data/lib/pubid/bsi/identifiers/value_added_publication.rb +52 -0
- data/lib/pubid/bsi/identifiers.rb +52 -0
- data/lib/pubid/bsi/model.rb +196 -0
- data/lib/pubid/bsi/parser.rb +659 -0
- data/lib/pubid/bsi/scheme.rb +243 -0
- data/lib/pubid/bsi/single_identifier.rb +129 -0
- data/lib/pubid/bsi/urn_generator.rb +84 -0
- data/lib/pubid/bsi.rb +32 -0
- data/lib/pubid/builder/base.rb +138 -0
- data/lib/pubid/bundled_identifier.rb +126 -0
- data/lib/pubid/ccsds/builder.rb +56 -0
- data/lib/pubid/ccsds/identifier.rb +84 -0
- data/lib/pubid/ccsds/identifiers/base.rb +89 -0
- data/lib/pubid/ccsds/identifiers/base_BASE_88929.rb +70 -0
- data/lib/pubid/ccsds/identifiers/corrigendum.rb +39 -0
- data/lib/pubid/ccsds/identifiers.rb +10 -0
- data/lib/pubid/ccsds/parser.rb +71 -0
- data/lib/pubid/ccsds/scheme.rb +57 -0
- data/lib/pubid/ccsds/single_identifier.rb +77 -0
- data/lib/pubid/ccsds/supplement_identifier.rb +33 -0
- data/lib/pubid/ccsds/urn_generator.rb +115 -0
- data/lib/pubid/ccsds.rb +21 -0
- data/lib/pubid/cen_cenelec/builder.rb +330 -0
- data/lib/pubid/cen_cenelec/identifier.rb +52 -0
- data/lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb +40 -0
- data/lib/pubid/cen_cenelec/identifiers/amendment.rb +29 -0
- data/lib/pubid/cen_cenelec/identifiers/base.rb +75 -0
- data/lib/pubid/cen_cenelec/identifiers/cen_report.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/cen_workshop_agreement.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/cenelec_harmonization_document.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +61 -0
- data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +35 -0
- data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +41 -0
- data/lib/pubid/cen_cenelec/identifiers/european_prestandard.rb +37 -0
- data/lib/pubid/cen_cenelec/identifiers/european_specification.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/fragment.rb +22 -0
- data/lib/pubid/cen_cenelec/identifiers/guide.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/harmonization_document.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/technical_report.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/technical_specification.rb +35 -0
- data/lib/pubid/cen_cenelec/identifiers.rb +32 -0
- data/lib/pubid/cen_cenelec/parser.rb +144 -0
- data/lib/pubid/cen_cenelec/scheme.rb +164 -0
- data/lib/pubid/cen_cenelec/single_identifier.rb +130 -0
- data/lib/pubid/cen_cenelec/supplement_identifier.rb +48 -0
- data/lib/pubid/cen_cenelec/urn_generator.rb +129 -0
- data/lib/pubid/cen_cenelec.rb +21 -0
- data/lib/pubid/cie/builder.rb +399 -0
- data/lib/pubid/cie/components/code.rb +72 -0
- data/lib/pubid/cie/components/language.rb +58 -0
- data/lib/pubid/cie/identifier.rb +71 -0
- data/lib/pubid/cie/identifiers/bundle.rb +20 -0
- data/lib/pubid/cie/identifiers/conference.rb +32 -0
- data/lib/pubid/cie/identifiers/corrigendum.rb +40 -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/standard.rb +58 -0
- data/lib/pubid/cie/identifiers/supplement.rb +45 -0
- data/lib/pubid/cie/identifiers/tutorial_bundle.rb +20 -0
- data/lib/pubid/cie/identifiers.rb +17 -0
- data/lib/pubid/cie/parser.rb +347 -0
- data/lib/pubid/cie/scheme.rb +64 -0
- data/lib/pubid/cie/single_identifier.rb +30 -0
- data/lib/pubid/cie/supplement_identifier.rb +26 -0
- data/lib/pubid/cie/urn_generator.rb +123 -0
- data/lib/pubid/cie.rb +28 -0
- data/lib/pubid/components/code.rb +33 -0
- data/lib/pubid/components/date.rb +49 -0
- data/lib/pubid/components/edition.rb +32 -0
- data/lib/pubid/components/factory.rb +50 -0
- data/lib/pubid/components/language.rb +37 -0
- data/lib/pubid/components/locality.rb +10 -0
- data/lib/pubid/components/publisher.rb +36 -0
- data/lib/pubid/components/stage.rb +54 -0
- data/lib/pubid/components/type.rb +58 -0
- data/lib/pubid/components/typed_stage.rb +59 -0
- data/lib/pubid/components.rb +16 -0
- data/lib/pubid/core/pattern_doc_generator.rb +272 -0
- data/lib/pubid/core/update_codes.rb +77 -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 +27 -0
- data/lib/pubid/csa/identifier.rb +513 -0
- data/lib/pubid/csa/identifiers/base.rb +133 -0
- data/lib/pubid/csa/identifiers/bundled.rb +125 -0
- data/lib/pubid/csa/identifiers/canadian_adopted.rb +82 -0
- data/lib/pubid/csa/identifiers/cec.rb +129 -0
- data/lib/pubid/csa/identifiers/combined.rb +130 -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 +127 -0
- data/lib/pubid/csa/identifiers/standard.rb +10 -0
- data/lib/pubid/csa/identifiers.rb +17 -0
- data/lib/pubid/csa/parser.rb +445 -0
- data/lib/pubid/csa/scheme.rb +44 -0
- data/lib/pubid/csa/single_identifier.rb +30 -0
- data/lib/pubid/csa/urn_generator.rb +80 -0
- data/lib/pubid/csa/wrapper_identifier.rb +31 -0
- data/lib/pubid/csa.rb +25 -0
- data/lib/pubid/etsi/builder.rb +133 -0
- data/lib/pubid/etsi/components/code.rb +42 -0
- data/lib/pubid/etsi/components/version.rb +37 -0
- data/lib/pubid/etsi/components.rb +10 -0
- data/lib/pubid/etsi/identifier.rb +57 -0
- data/lib/pubid/etsi/identifiers/amendment.rb +15 -0
- data/lib/pubid/etsi/identifiers/base.rb +38 -0
- data/lib/pubid/etsi/identifiers/corrigendum.rb +15 -0
- data/lib/pubid/etsi/identifiers/etsi_standard.rb +19 -0
- data/lib/pubid/etsi/identifiers/supplement_identifier.rb +91 -0
- data/lib/pubid/etsi/identifiers.rb +14 -0
- data/lib/pubid/etsi/parser.rb +133 -0
- data/lib/pubid/etsi/scheme.rb +42 -0
- data/lib/pubid/etsi/urn_generator.rb +76 -0
- data/lib/pubid/etsi.rb +21 -0
- data/lib/pubid/export/auditor.rb +89 -0
- data/lib/pubid/export/data_class_exporter.rb +59 -0
- data/lib/pubid/export/exporter.rb +74 -0
- data/lib/pubid/export/flavor_exporter.rb +402 -0
- data/lib/pubid/export/ieee_exporter.rb +78 -0
- data/lib/pubid/export/itu_exporter.rb +66 -0
- data/lib/pubid/export/nist_exporter.rb +64 -0
- data/lib/pubid/export/registry_exporter.rb +90 -0
- data/lib/pubid/export/result.rb +97 -0
- data/lib/pubid/export/scheme_exporter.rb +70 -0
- data/lib/pubid/export.rb +18 -0
- data/lib/pubid/format_detector.rb +16 -0
- data/lib/pubid/format_registry.rb +42 -0
- data/lib/pubid/identifier.rb +242 -0
- data/lib/pubid/identifier_metadata.rb +148 -0
- data/lib/pubid/identifier_registry.rb +198 -0
- data/lib/pubid/idf/builder.rb +82 -0
- data/lib/pubid/idf/identifier.rb +129 -0
- data/lib/pubid/idf/identifiers/amendment.rb +27 -0
- data/lib/pubid/idf/identifiers/corrigendum.rb +27 -0
- data/lib/pubid/idf/identifiers/international_standard.rb +123 -0
- data/lib/pubid/idf/identifiers/reviewed_method.rb +100 -0
- data/lib/pubid/idf/identifiers.rb +13 -0
- data/lib/pubid/idf/parser.rb +143 -0
- data/lib/pubid/idf/scheme.rb +61 -0
- data/lib/pubid/idf/single_identifier.rb +19 -0
- data/lib/pubid/idf/supplement_identifier.rb +43 -0
- data/lib/pubid/idf/urn_generator.rb +84 -0
- data/lib/pubid/idf.rb +25 -0
- data/lib/pubid/iec/builder.rb +458 -0
- data/lib/pubid/iec/components/code.rb +60 -0
- data/lib/pubid/iec/components/consolidated_amendment.rb +59 -0
- data/lib/pubid/iec/components/publisher.rb +36 -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/identifier.rb +256 -0
- data/lib/pubid/iec/identifiers/amendment.rb +94 -0
- data/lib/pubid/iec/identifiers/base.rb +82 -0
- data/lib/pubid/iec/identifiers/component_specification.rb +39 -0
- data/lib/pubid/iec/identifiers/conformity_assessment.rb +39 -0
- data/lib/pubid/iec/identifiers/consolidated_identifier.rb +82 -0
- data/lib/pubid/iec/identifiers/corrigendum.rb +94 -0
- data/lib/pubid/iec/identifiers/fragment_identifier.rb +137 -0
- data/lib/pubid/iec/identifiers/guide.rb +104 -0
- data/lib/pubid/iec/identifiers/international_standard.rb +147 -0
- data/lib/pubid/iec/identifiers/interpretation_sheet.rb +104 -0
- data/lib/pubid/iec/identifiers/operational_document.rb +39 -0
- data/lib/pubid/iec/identifiers/publicly_available_specification.rb +101 -0
- data/lib/pubid/iec/identifiers/sheet_identifier.rb +62 -0
- data/lib/pubid/iec/identifiers/societal_technology_trend_report.rb +40 -0
- data/lib/pubid/iec/identifiers/systems_reference_document.rb +40 -0
- data/lib/pubid/iec/identifiers/technical_report.rb +132 -0
- data/lib/pubid/iec/identifiers/technical_specification.rb +132 -0
- data/lib/pubid/iec/identifiers/technology_report.rb +39 -0
- data/lib/pubid/iec/identifiers/test_report_form.rb +78 -0
- data/lib/pubid/iec/identifiers/vap_identifier.rb +73 -0
- data/lib/pubid/iec/identifiers/white_paper.rb +39 -0
- data/lib/pubid/iec/identifiers/working_document.rb +96 -0
- data/lib/pubid/iec/parser.rb +417 -0
- data/lib/pubid/iec/rendering_style.rb +113 -0
- data/lib/pubid/iec/scheme.rb +71 -0
- data/lib/pubid/iec/single_identifier.rb +80 -0
- data/lib/pubid/iec/supplement_identifier.rb +161 -0
- data/lib/pubid/iec/urn_generator.rb +79 -0
- data/lib/pubid/iec/urn_parser.rb +90 -0
- data/lib/pubid/iec.rb +85 -0
- data/lib/pubid/ieee/aiee/builder.rb +71 -0
- data/lib/pubid/ieee/aiee/identifier.rb +105 -0
- data/lib/pubid/ieee/aiee/parser.rb +130 -0
- data/lib/pubid/ieee/aiee.rb +11 -0
- data/lib/pubid/ieee/builder.rb +1237 -0
- data/lib/pubid/ieee/components/code.rb +102 -0
- data/lib/pubid/ieee/components/draft.rb +93 -0
- data/lib/pubid/ieee/components/relationship.rb +157 -0
- data/lib/pubid/ieee/components/typed_stage.rb +100 -0
- data/lib/pubid/ieee/identifier.rb +54 -0
- data/lib/pubid/ieee/identifiers/adopted_standard.rb +33 -0
- data/lib/pubid/ieee/identifiers/base.rb +591 -0
- data/lib/pubid/ieee/identifiers/conformance_identifier.rb +35 -0
- data/lib/pubid/ieee/identifiers/corrigendum.rb +37 -0
- data/lib/pubid/ieee/identifiers/csa_dual_published.rb +51 -0
- data/lib/pubid/ieee/identifiers/dual_identifier.rb +18 -0
- data/lib/pubid/ieee/identifiers/dual_published.rb +28 -0
- data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +27 -0
- data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +34 -0
- data/lib/pubid/ieee/identifiers/joint_development.rb +172 -0
- data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +51 -0
- data/lib/pubid/ieee/identifiers/nesc/base.rb +56 -0
- data/lib/pubid/ieee/identifiers/nesc/draft.rb +28 -0
- data/lib/pubid/ieee/identifiers/nesc/handbook.rb +32 -0
- data/lib/pubid/ieee/identifiers/nesc/redline.rb +26 -0
- data/lib/pubid/ieee/identifiers/nesc/standard.rb +26 -0
- data/lib/pubid/ieee/identifiers/nesc.rb +15 -0
- data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +20 -0
- data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +26 -0
- data/lib/pubid/ieee/identifiers/redlined_standard.rb +33 -0
- data/lib/pubid/ieee/identifiers/si_standard.rb +73 -0
- data/lib/pubid/ieee/identifiers/standard.rb +41 -0
- data/lib/pubid/ieee/identifiers/supplement_identifier.rb +23 -0
- data/lib/pubid/ieee/identifiers.rb +33 -0
- data/lib/pubid/ieee/ire/builder.rb +61 -0
- data/lib/pubid/ieee/ire/identifier.rb +58 -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 +101 -0
- data/lib/pubid/ieee/nesc/parser.rb +154 -0
- data/lib/pubid/ieee/nesc.rb +10 -0
- data/lib/pubid/ieee/parser.rb +1226 -0
- data/lib/pubid/ieee/scheme.rb +90 -0
- data/lib/pubid/ieee/typed_stages.rb +172 -0
- data/lib/pubid/ieee/urn_generator.rb +188 -0
- data/lib/pubid/ieee.rb +32 -0
- data/lib/pubid/ieee_debug.rb +31 -0
- data/lib/pubid/iho/builder.rb +37 -0
- data/lib/pubid/iho/identifier.rb +61 -0
- data/lib/pubid/iho/identifiers/base.rb +41 -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 +14 -0
- data/lib/pubid/iho/parser.rb +68 -0
- data/lib/pubid/iho/scheme.rb +29 -0
- data/lib/pubid/iho/urn_generator.rb +29 -0
- data/lib/pubid/iho.rb +21 -0
- data/lib/pubid/iso/builder.rb +309 -0
- data/lib/pubid/iso/bundled_identifier.rb +85 -0
- data/lib/pubid/iso/combined_identifier.rb +22 -0
- data/lib/pubid/iso/components/code.rb +36 -0
- data/lib/pubid/iso/components/publisher.rb +60 -0
- data/lib/pubid/iso/components.rb +12 -0
- data/lib/pubid/iso/format_resolver.rb +45 -0
- data/lib/pubid/iso/identifier.rb +330 -0
- data/lib/pubid/iso/identifiers/addendum.rb +104 -0
- data/lib/pubid/iso/identifiers/amendment.rb +128 -0
- data/lib/pubid/iso/identifiers/base.rb +115 -0
- data/lib/pubid/iso/identifiers/corrigendum.rb +108 -0
- data/lib/pubid/iso/identifiers/data.rb +76 -0
- data/lib/pubid/iso/identifiers/directives.rb +59 -0
- data/lib/pubid/iso/identifiers/directives_supplement.rb +119 -0
- data/lib/pubid/iso/identifiers/extract.rb +30 -0
- data/lib/pubid/iso/identifiers/guide.rb +100 -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 +89 -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 +87 -0
- data/lib/pubid/iso/identifiers/tc_document.rb +108 -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 +33 -0
- data/lib/pubid/iso/parser.rb +512 -0
- data/lib/pubid/iso/rendering_style.rb +120 -0
- data/lib/pubid/iso/scheme.rb +193 -0
- data/lib/pubid/iso/single_identifier.rb +64 -0
- data/lib/pubid/iso/supplement_identifier.rb +27 -0
- data/lib/pubid/iso/urn_generator.rb +426 -0
- data/lib/pubid/iso/urn_parser.rb +437 -0
- data/lib/pubid/iso/utilities.rb +86 -0
- data/lib/pubid/iso.rb +50 -0
- data/lib/pubid/itu/builder.rb +171 -0
- data/lib/pubid/itu/components/code.rb +39 -0
- data/lib/pubid/itu/components/sector.rb +35 -0
- data/lib/pubid/itu/components/series.rb +29 -0
- data/lib/pubid/itu/i18n.rb +9 -0
- data/lib/pubid/itu/i18n.yaml +30 -0
- data/lib/pubid/itu/identifier.rb +118 -0
- data/lib/pubid/itu/identifiers/amendment.rb +43 -0
- data/lib/pubid/itu/identifiers/annex.rb +74 -0
- data/lib/pubid/itu/identifiers/base.rb +154 -0
- data/lib/pubid/itu/identifiers/combined_identifier.rb +47 -0
- data/lib/pubid/itu/identifiers/corrigendum.rb +44 -0
- data/lib/pubid/itu/identifiers/recommendation.rb +16 -0
- data/lib/pubid/itu/identifiers/special_publication.rb +31 -0
- data/lib/pubid/itu/identifiers/supplement.rb +46 -0
- data/lib/pubid/itu/identifiers.rb +16 -0
- data/lib/pubid/itu/model.rb +111 -0
- data/lib/pubid/itu/parser.rb +225 -0
- data/lib/pubid/itu/scheme.rb +174 -0
- data/lib/pubid/itu/urn_generator.rb +105 -0
- data/lib/pubid/itu.rb +22 -0
- data/lib/pubid/jcgm/builder.rb +88 -0
- data/lib/pubid/jcgm/components/publisher.rb +20 -0
- data/lib/pubid/jcgm/components.rb +9 -0
- data/lib/pubid/jcgm/identifier.rb +54 -0
- data/lib/pubid/jcgm/identifiers/amendment.rb +35 -0
- data/lib/pubid/jcgm/identifiers/guide.rb +21 -0
- data/lib/pubid/jcgm/identifiers/gum_guide.rb +51 -0
- data/lib/pubid/jcgm/identifiers.rb +11 -0
- data/lib/pubid/jcgm/parser.rb +84 -0
- data/lib/pubid/jcgm/scheme.rb +60 -0
- data/lib/pubid/jcgm/single_identifier.rb +48 -0
- data/lib/pubid/jcgm/supplement_identifier.rb +16 -0
- data/lib/pubid/jcgm/urn_generator.rb +110 -0
- data/lib/pubid/jcgm.rb +31 -0
- data/lib/pubid/jis/builder.rb +124 -0
- data/lib/pubid/jis/components/code.rb +59 -0
- data/lib/pubid/jis/components.rb +9 -0
- data/lib/pubid/jis/identifier.rb +61 -0
- data/lib/pubid/jis/identifiers/amendment.rb +16 -0
- data/lib/pubid/jis/identifiers/base.rb +72 -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 +27 -0
- data/lib/pubid/jis/identifiers/technical_report.rb +31 -0
- data/lib/pubid/jis/identifiers/technical_specification.rb +31 -0
- data/lib/pubid/jis/identifiers.rb +17 -0
- data/lib/pubid/jis/parser.rb +109 -0
- data/lib/pubid/jis/scheme.rb +49 -0
- data/lib/pubid/jis/single_identifier.rb +37 -0
- data/lib/pubid/jis/supplement_identifier.rb +47 -0
- data/lib/pubid/jis/urn_generator.rb +25 -0
- data/lib/pubid/jis.rb +23 -0
- data/lib/pubid/lutaml/no_store_registration.rb +30 -0
- data/lib/pubid/nist/builder.rb +2269 -0
- data/lib/pubid/nist/components/code.rb +38 -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/publisher.rb +24 -0
- data/lib/pubid/nist/components/stage.rb +53 -0
- data/lib/pubid/nist/components/supplement.rb +188 -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 +19 -0
- data/lib/pubid/nist/configuration.rb +77 -0
- data/lib/pubid/nist/identifier.rb +62 -0
- data/lib/pubid/nist/identifiers/base.rb +578 -0
- data/lib/pubid/nist/identifiers/circular.rb +68 -0
- data/lib/pubid/nist/identifiers/circular_supplement.rb +50 -0
- data/lib/pubid/nist/identifiers/commercial_standard.rb +41 -0
- data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +56 -0
- data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +56 -0
- data/lib/pubid/nist/identifiers/crpl_report.rb +132 -0
- data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +104 -0
- data/lib/pubid/nist/identifiers/grant_contractor_report.rb +35 -0
- data/lib/pubid/nist/identifiers/handbook.rb +50 -0
- data/lib/pubid/nist/identifiers/internal_report.rb +56 -0
- data/lib/pubid/nist/identifiers/letter_circular.rb +45 -0
- data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +65 -0
- data/lib/pubid/nist/identifiers/monograph.rb +69 -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 +67 -0
- data/lib/pubid/nist/identifiers/special_publication.rb +36 -0
- data/lib/pubid/nist/identifiers/technical_note.rb +90 -0
- data/lib/pubid/nist/identifiers.rb +33 -0
- data/lib/pubid/nist/parser.rb +1117 -0
- data/lib/pubid/nist/scheme.rb +199 -0
- data/lib/pubid/nist/supplement_identifier.rb +67 -0
- data/lib/pubid/nist/urn_generator.rb +133 -0
- data/lib/pubid/nist.rb +37 -0
- data/lib/pubid/oiml/builder.rb +189 -0
- data/lib/pubid/oiml/components/code.rb +20 -0
- data/lib/pubid/oiml/components.rb +9 -0
- data/lib/pubid/oiml/identifier.rb +61 -0
- data/lib/pubid/oiml/identifiers/amendment.rb +13 -0
- data/lib/pubid/oiml/identifiers/annex.rb +62 -0
- data/lib/pubid/oiml/identifiers/base.rb +36 -0
- data/lib/pubid/oiml/identifiers/basic_publication.rb +13 -0
- data/lib/pubid/oiml/identifiers/document.rb +13 -0
- data/lib/pubid/oiml/identifiers/expert_report.rb +13 -0
- data/lib/pubid/oiml/identifiers/guide.rb +13 -0
- data/lib/pubid/oiml/identifiers/recommendation.rb +13 -0
- data/lib/pubid/oiml/identifiers/seminar_report.rb +13 -0
- data/lib/pubid/oiml/identifiers/vocabulary.rb +13 -0
- data/lib/pubid/oiml/identifiers.rb +18 -0
- data/lib/pubid/oiml/parser.rb +173 -0
- data/lib/pubid/oiml/scheme.rb +46 -0
- data/lib/pubid/oiml/single_identifier.rb +90 -0
- data/lib/pubid/oiml/supplement_identifier.rb +43 -0
- data/lib/pubid/oiml/urn_generator.rb +64 -0
- data/lib/pubid/oiml.rb +26 -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.rb +8 -0
- data/lib/pubid/parsers/base.rb +11 -0
- data/lib/pubid/parsers/mr_string.rb +93 -0
- data/lib/pubid/plateau/builder.rb +50 -0
- data/lib/pubid/plateau/identifier.rb +57 -0
- data/lib/pubid/plateau/identifiers/annex.rb +16 -0
- data/lib/pubid/plateau/identifiers/base.rb +51 -0
- data/lib/pubid/plateau/identifiers/handbook.rb +34 -0
- data/lib/pubid/plateau/identifiers/technical_report.rb +20 -0
- data/lib/pubid/plateau/identifiers.rb +12 -0
- data/lib/pubid/plateau/parser.rb +63 -0
- data/lib/pubid/plateau/scheme.rb +45 -0
- data/lib/pubid/plateau/supplement_identifier.rb +72 -0
- data/lib/pubid/plateau/urn_generator.rb +29 -0
- data/lib/pubid/plateau.rb +26 -0
- data/lib/pubid/renderers/base.rb +53 -0
- data/lib/pubid/renderers/directives_renderer.rb +61 -0
- data/lib/pubid/renderers/guide_renderer.rb +24 -0
- data/lib/pubid/renderers/human_readable.rb +70 -0
- data/lib/pubid/renderers/iwa_renderer.rb +20 -0
- data/lib/pubid/renderers/mr_string.rb +16 -0
- data/lib/pubid/renderers/supplement_renderer.rb +36 -0
- data/lib/pubid/renderers/urn.rb +11 -0
- data/lib/pubid/renderers.rb +14 -0
- data/lib/pubid/rendering/base.rb +73 -0
- data/lib/pubid/rendering/common.rb +211 -0
- data/lib/pubid/rendering/context.rb +159 -0
- data/lib/pubid/rendering/date.rb +27 -0
- data/lib/pubid/rendering/format.rb +25 -0
- data/lib/pubid/rendering/language.rb +21 -0
- data/lib/pubid/rendering/numbering.rb +24 -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 +16 -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 +19 -0
- data/lib/pubid/sae/components/type.rb +19 -0
- data/lib/pubid/sae/components.rb +11 -0
- data/lib/pubid/sae/identifier.rb +37 -0
- data/lib/pubid/sae/identifiers/base.rb +42 -0
- data/lib/pubid/sae/identifiers.rb +9 -0
- data/lib/pubid/sae/parser.rb +55 -0
- data/lib/pubid/sae/scheme.rb +47 -0
- data/lib/pubid/sae/urn_generator.rb +38 -0
- data/lib/pubid/sae.rb +19 -0
- data/lib/pubid/scheme.rb +219 -0
- data/lib/pubid/urn_generator/base.rb +110 -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.rb +137 -13
- data/lib/tasks/docs.rake +37 -0
- data/lib/tasks/export.rake +38 -0
- data/lib/tasks/website-data.json +7488 -0
- metadata +616 -171
- data/lib/pubid/registry.rb +0 -30
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Iso
|
|
7
|
+
module Components
|
|
8
|
+
# ISO Publisher with copublisher support
|
|
9
|
+
# Examples: ISO, ISO/IEC, ISO/IEC/IEEE
|
|
10
|
+
class Publisher < Lutaml::Model::Serializable
|
|
11
|
+
attribute :publisher, :string, default: -> { "ISO" }
|
|
12
|
+
attribute :copublisher, :string, collection: true
|
|
13
|
+
|
|
14
|
+
def body
|
|
15
|
+
publisher
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def render(context: nil)
|
|
19
|
+
return publisher unless copublisher&.any?
|
|
20
|
+
|
|
21
|
+
publisher + copublisher.map { |cp| "/#{cp}" }.join
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_s
|
|
25
|
+
result = publisher
|
|
26
|
+
result += copublisher.map { |cp| "/#{cp}" }.join if copublisher&.any?
|
|
27
|
+
result
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def has_copublisher?
|
|
31
|
+
copublisher&.any?
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def copublished?
|
|
35
|
+
copublisher&.any?
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def ==(other)
|
|
39
|
+
return false unless other.is_a?(Publisher)
|
|
40
|
+
|
|
41
|
+
publisher == other.publisher && copublisher == other.copublisher
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns hash code for publisher component
|
|
45
|
+
# @return [Integer] hash code
|
|
46
|
+
# @note Memoized for performance
|
|
47
|
+
def hash
|
|
48
|
+
@hash ||= [publisher, copublisher].compact.map(&:hash).hash
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Checks equality using hash for consistency
|
|
52
|
+
# @param other [Object] object to compare with
|
|
53
|
+
# @return [Boolean] true if equal
|
|
54
|
+
def eql?(other)
|
|
55
|
+
hash == other.hash && self == other
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Iso
|
|
5
|
+
# Resolves format symbols to rendering options
|
|
6
|
+
class FormatResolver
|
|
7
|
+
FORMATS = {
|
|
8
|
+
ref_num_short: {
|
|
9
|
+
with_language_code: :single, # 1-char: E, F, R, A, S, D
|
|
10
|
+
stage_format_long: false, # Short: DAM, COR, FDAM
|
|
11
|
+
with_date: true,
|
|
12
|
+
},
|
|
13
|
+
ref_num_long: {
|
|
14
|
+
with_language_code: :iso, # 2-char: en, fr, ru, ar, es, de
|
|
15
|
+
stage_format_long: true, # Long: DAmd, Cor, FDAmd
|
|
16
|
+
with_date: true,
|
|
17
|
+
},
|
|
18
|
+
ref_dated: {
|
|
19
|
+
with_language_code: :none,
|
|
20
|
+
stage_format_long: false,
|
|
21
|
+
with_date: true,
|
|
22
|
+
},
|
|
23
|
+
ref_dated_long: {
|
|
24
|
+
with_language_code: :none,
|
|
25
|
+
stage_format_long: true,
|
|
26
|
+
with_date: true,
|
|
27
|
+
},
|
|
28
|
+
ref_undated: {
|
|
29
|
+
with_language_code: :none,
|
|
30
|
+
stage_format_long: false,
|
|
31
|
+
with_date: false,
|
|
32
|
+
},
|
|
33
|
+
ref_undated_long: {
|
|
34
|
+
with_language_code: :none,
|
|
35
|
+
stage_format_long: true,
|
|
36
|
+
with_date: false,
|
|
37
|
+
},
|
|
38
|
+
}.freeze
|
|
39
|
+
|
|
40
|
+
def self.resolve(format)
|
|
41
|
+
FORMATS[format] || raise(ArgumentError, "Unknown format: #{format}")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Iso
|
|
5
|
+
class Identifier < ::Pubid::Identifier
|
|
6
|
+
# Override base types with ISO-specific ones
|
|
7
|
+
attribute :publisher, ::Pubid::Iso::Components::Publisher
|
|
8
|
+
attribute :copublishers, ::Pubid::Iso::Components::Publisher,
|
|
9
|
+
collection: true
|
|
10
|
+
attribute :number, ::Pubid::Iso::Components::Code
|
|
11
|
+
attribute :part, ::Pubid::Iso::Components::Code
|
|
12
|
+
attribute :subpart, ::Pubid::Iso::Components::Code
|
|
13
|
+
|
|
14
|
+
# Polymorphic type map for lutaml::Model key_value serialization
|
|
15
|
+
# Maps polymorphic_name → class name for deserialization
|
|
16
|
+
# Validated by spec to stay in sync with Scheme.identifiers
|
|
17
|
+
ISO_TYPE_MAP = {
|
|
18
|
+
"pubid:iso:international-standard" => "Pubid::Iso::Identifiers::InternationalStandard",
|
|
19
|
+
"pubid:iso:international-standardized-profile" => "Pubid::Iso::Identifiers::InternationalStandardizedProfile",
|
|
20
|
+
"pubid:iso:international-workshop-agreement" => "Pubid::Iso::Identifiers::InternationalWorkshopAgreement",
|
|
21
|
+
"pubid:iso:technical-report" => "Pubid::Iso::Identifiers::TechnicalReport",
|
|
22
|
+
"pubid:iso:technical-specification" => "Pubid::Iso::Identifiers::TechnicalSpecification",
|
|
23
|
+
"pubid:iso:pas" => "Pubid::Iso::Identifiers::Pas",
|
|
24
|
+
"pubid:iso:guide" => "Pubid::Iso::Identifiers::Guide",
|
|
25
|
+
"pubid:iso:recommendation" => "Pubid::Iso::Identifiers::Recommendation",
|
|
26
|
+
"pubid:iso:amendment" => "Pubid::Iso::Identifiers::Amendment",
|
|
27
|
+
"pubid:iso:corrigendum" => "Pubid::Iso::Identifiers::Corrigendum",
|
|
28
|
+
"pubid:iso:supplement" => "Pubid::Iso::Identifiers::Supplement",
|
|
29
|
+
"pubid:iso:addendum" => "Pubid::Iso::Identifiers::Addendum",
|
|
30
|
+
"pubid:iso:extract" => "Pubid::Iso::Identifiers::Extract",
|
|
31
|
+
"pubid:iso:directives" => "Pubid::Iso::Identifiers::Directives",
|
|
32
|
+
"pubid:iso:directives-supplement" => "Pubid::Iso::Identifiers::DirectivesSupplement",
|
|
33
|
+
"pubid:iso:data" => "Pubid::Iso::Identifiers::Data",
|
|
34
|
+
"pubid:iso:tc-document" => "Pubid::Iso::Identifiers::TcDocument",
|
|
35
|
+
"pubid:iso:technology-trends-assessments" => "Pubid::Iso::Identifiers::TechnologyTrendsAssessments",
|
|
36
|
+
}.freeze
|
|
37
|
+
|
|
38
|
+
# Build type map from Scheme.identifiers for validation
|
|
39
|
+
def self.build_type_map
|
|
40
|
+
Scheme.identifiers.to_h do |klass|
|
|
41
|
+
[klass.polymorphic_name, klass.name]
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
key_value do
|
|
46
|
+
map "_type", to: :_type, polymorphic_map: ISO_TYPE_MAP
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def self.parse(string, format: :auto)
|
|
50
|
+
format = Pubid::FormatDetector.detect(string) if format == :auto
|
|
51
|
+
|
|
52
|
+
case format
|
|
53
|
+
when :urn
|
|
54
|
+
Pubid::Iso::UrnParser.parse(string)
|
|
55
|
+
when :mr_string
|
|
56
|
+
Pubid::Parsers::MrString.parse(string)
|
|
57
|
+
else
|
|
58
|
+
parsed = Pubid::Iso::Parser.new.parse(string)
|
|
59
|
+
if parsed.nil? || parsed.empty?
|
|
60
|
+
raise Pubid::Iso::Parser::ParseError,
|
|
61
|
+
"Invalid identifier format"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
Pubid::Iso::Builder.new(Pubid::Iso::Scheme).build(parsed)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Factory mirroring pubid 1.x's `Pubid::Iso::Identifier.create` API.
|
|
69
|
+
#
|
|
70
|
+
# Accepts 1.x-style primitive kwargs and dispatches to the correct
|
|
71
|
+
# 2.x `Identifiers::*` subclass via {Pubid::Iso::Scheme}. Coerces
|
|
72
|
+
# primitives into ISO-specific Component objects.
|
|
73
|
+
#
|
|
74
|
+
# Dispatch rules:
|
|
75
|
+
# * `type:` (e.g. `:tr`, `:amd`) → lookup via Scheme
|
|
76
|
+
# * else `stage:` (e.g. `"DIS"`, `"AMD"`) → lookup via Scheme
|
|
77
|
+
# * else → InternationalStandard
|
|
78
|
+
#
|
|
79
|
+
# @param type [Symbol, String, nil] type key (`:is`, `:tr`, `:amd`, …)
|
|
80
|
+
# @param stage [String, Symbol, nil] typed-stage abbreviation
|
|
81
|
+
# @param opts [Hash] remaining attribute primitives:
|
|
82
|
+
# :publisher (String), :number, :part, :subpart, :year, :edition,
|
|
83
|
+
# :language
|
|
84
|
+
# @return [Pubid::Iso::Identifier]
|
|
85
|
+
def self.create(type: nil, stage: nil, base: nil, **opts)
|
|
86
|
+
# A bundled directive (e.g. "ISO/IEC DIR 1 + IEC SUP") is stored by the
|
|
87
|
+
# 1.x index as the base document's fields plus a nested joint_document
|
|
88
|
+
# (or a supplements array). The 2.x model is a separate
|
|
89
|
+
# BundledIdentifier; build that so .create round-trips parse.
|
|
90
|
+
if opts[:joint_document] || opts[:supplements]
|
|
91
|
+
return build_bundled(type: type, stage: stage, base: base, **opts)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
klass = resolve_create_class(type: type, stage: stage, base: base)
|
|
95
|
+
attrs = coerce_create_attrs(opts)
|
|
96
|
+
ts = resolve_create_typed_stage(klass, stage)
|
|
97
|
+
if ts
|
|
98
|
+
# dup the (shared) TYPED_STAGES element before tweaking, and set
|
|
99
|
+
# original_abbr to the canonical abbr so rendering matches a
|
|
100
|
+
# parsed identifier (parse records the spelled abbr, e.g. "Amd"
|
|
101
|
+
# not the upcased short_abbr "AMD").
|
|
102
|
+
ts = ts.dup
|
|
103
|
+
ts.original_abbr ||= Array(ts.abbr).first&.to_s
|
|
104
|
+
attrs[:typed_stage] = ts
|
|
105
|
+
# Parse fills `type` and `stage` Components derived from
|
|
106
|
+
# typed_stage; mirror that here so .create round-trips through
|
|
107
|
+
# Pubid::Identifier#== with a parsed identifier.
|
|
108
|
+
attrs[:type] ||= ::Pubid::Components::Type.new(
|
|
109
|
+
name: ts.name,
|
|
110
|
+
abbr: Array(ts.abbr).first.to_s,
|
|
111
|
+
type_code: ts.type_code&.to_s,
|
|
112
|
+
)
|
|
113
|
+
attrs[:stage] ||= ::Pubid::Components::Stage.new(
|
|
114
|
+
name: ts.name,
|
|
115
|
+
stage_code: ts.stage_code&.to_s,
|
|
116
|
+
abbr: Array(ts.abbr).first.to_s,
|
|
117
|
+
harmonized_stages: Array(ts.harmonized_stages),
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
# Build the base_identifier whenever a `base:` is supplied, regardless
|
|
121
|
+
# of whether the resolved class is registered as a supplement (e.g.
|
|
122
|
+
# DirectivesSupplement holds a base but is not in
|
|
123
|
+
# Scheme#supplement_identifiers). Only classes that *require* a base
|
|
124
|
+
# and were given none raise.
|
|
125
|
+
if base
|
|
126
|
+
attrs[:base_identifier] = build_base_identifier(base)
|
|
127
|
+
elsif supplement_klass?(klass)
|
|
128
|
+
raise ArgumentError, "#{klass} requires a base: identifier"
|
|
129
|
+
end
|
|
130
|
+
# For a DirectivesSupplement the top-level `publisher:` names the
|
|
131
|
+
# supplement's own publisher ("… ISO SUP"), not the document's — the
|
|
132
|
+
# document publisher lives on the base. Mirror parse, which records it
|
|
133
|
+
# as `supplement_publisher`.
|
|
134
|
+
if klass <= Identifiers::DirectivesSupplement && attrs.key?(:publisher)
|
|
135
|
+
attrs[:supplement_publisher] = attrs.delete(:publisher)
|
|
136
|
+
attrs.delete(:copublishers)
|
|
137
|
+
end
|
|
138
|
+
klass.new(**attrs)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Build a BundledIdentifier (base document + supplements) from the 1.x
|
|
142
|
+
# index shape: the top-level fields are the base document, and each
|
|
143
|
+
# joint_document/supplements entry is a joined supplement.
|
|
144
|
+
def self.build_bundled(type:, stage:, base:, **opts)
|
|
145
|
+
raw = opts.delete(:joint_document) || opts.delete(:supplements)
|
|
146
|
+
entries = raw.is_a?(Array) ? raw : [raw]
|
|
147
|
+
base_document = create(type: type, stage: stage, base: base, **opts)
|
|
148
|
+
supplements = entries.map { |j| build_joint_supplement(j) }
|
|
149
|
+
BundledIdentifier.new(base_document: base_document,
|
|
150
|
+
supplements: supplements)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Map a 1.x joint_document hash to a 2.x supplement matching parse. The
|
|
154
|
+
# index nests the supplement's publisher under joint_document.base.publisher
|
|
155
|
+
# (e.g. "IEC" for "+ IEC SUP"), while parse records it as the supplement's
|
|
156
|
+
# own publisher; move it and drop the nested base + empty top publisher.
|
|
157
|
+
def self.build_joint_supplement(joint)
|
|
158
|
+
j = joint.transform_keys(&:to_sym)
|
|
159
|
+
b = (j[:base] || {}).transform_keys(&:to_sym)
|
|
160
|
+
publisher = b[:publisher].to_s.empty? ? j[:publisher] : b[:publisher]
|
|
161
|
+
create(
|
|
162
|
+
type: j[:type],
|
|
163
|
+
publisher: publisher,
|
|
164
|
+
copublisher: b[:copublisher] || j[:copublisher],
|
|
165
|
+
number: (j[:number] unless j[:number].to_s.empty?),
|
|
166
|
+
year: j[:year],
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Build the base_identifier for a supplement from either an already
|
|
171
|
+
# constructed identifier or a 1.x-style attribute hash (the nested
|
|
172
|
+
# `:base` entry in a structured index). Recurses so supplement-of-
|
|
173
|
+
# supplement chains (e.g. a Corrigendum to an Amendment) build cleanly.
|
|
174
|
+
def self.build_base_identifier(base)
|
|
175
|
+
return base if base.is_a?(::Pubid::Identifier)
|
|
176
|
+
|
|
177
|
+
create(**base.transform_keys(&:to_sym))
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# When `stage:` is explicit, look up the matching TypedStage via
|
|
181
|
+
# Scheme. Otherwise default to the chosen class's "published"
|
|
182
|
+
# TypedStage (so e.g. TR renders the "/TR" prefix). Returns nil if
|
|
183
|
+
# neither is available; the renderer then omits the stage prefix.
|
|
184
|
+
def self.resolve_create_typed_stage(klass, stage)
|
|
185
|
+
if stage
|
|
186
|
+
ts = locate_create_typed_stage(stage)
|
|
187
|
+
ts && retype_stage_for_class(klass, ts)
|
|
188
|
+
elsif klass.const_defined?(:TYPED_STAGES)
|
|
189
|
+
klass.const_get(:TYPED_STAGES).find do |ts|
|
|
190
|
+
ts.stage_code.to_sym == :published
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Indexes store a supplement's stage as the bare review-stage abbr
|
|
196
|
+
# ("CD", "WD", "AWI") plus a separate type ("AMD"), so the global lookup
|
|
197
|
+
# resolves the stage to the IS-typed variant (cdis) rather than the
|
|
198
|
+
# amendment-typed one (committee_draft_amd). When the resolved stage's
|
|
199
|
+
# type differs from the class chosen via `type:`, re-pick the equivalent
|
|
200
|
+
# stage from the class's own TYPED_STAGES. harmonized_stages is the
|
|
201
|
+
# stable cross-type key (stage_code/abbr diverge between IS and amd:
|
|
202
|
+
# IS "WD" is :working_draft, the amendment is :wd_amd).
|
|
203
|
+
def self.retype_stage_for_class(klass, ts)
|
|
204
|
+
return ts unless klass.const_defined?(:TYPED_STAGES)
|
|
205
|
+
return ts unless klass.respond_to?(:type) && klass.type
|
|
206
|
+
return ts if ts.type_code.to_s == klass.type[:key].to_s
|
|
207
|
+
|
|
208
|
+
harmonized = Array(ts.harmonized_stages)
|
|
209
|
+
return ts if harmonized.empty?
|
|
210
|
+
|
|
211
|
+
klass.const_get(:TYPED_STAGES).find do |s|
|
|
212
|
+
(Array(s.harmonized_stages) & harmonized).any?
|
|
213
|
+
end || ts
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Resolve a TypedStage from a create() :stage value. The index may
|
|
217
|
+
# supply it as an abbreviation ("DIS"), a generic stage_code (:dis),
|
|
218
|
+
# or a unique per-typed-stage code (:dtr, :fdisp). Try each in turn.
|
|
219
|
+
def self.locate_create_typed_stage(stage)
|
|
220
|
+
Scheme.locate_typed_stage_by_abbr(stage.to_s) ||
|
|
221
|
+
Scheme.locate_typed_stage_by_stage_code(stage) ||
|
|
222
|
+
Scheme.locate_typed_stage_by_code(stage)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
def self.resolve_create_class(type:, stage:, base: nil)
|
|
226
|
+
klass =
|
|
227
|
+
if type
|
|
228
|
+
located = locate_klass_by_type_or_short(type)
|
|
229
|
+
raise ArgumentError, "Unknown ISO type: #{type.inspect}" unless located
|
|
230
|
+
|
|
231
|
+
located
|
|
232
|
+
elsif stage
|
|
233
|
+
ts = locate_create_typed_stage(stage)
|
|
234
|
+
ts && Scheme.locate_identifier_klass_by_type_code(ts.type_code)
|
|
235
|
+
end
|
|
236
|
+
# A bare `base:` with no type/stage is still a supplement; fall back to
|
|
237
|
+
# the generic Supplement (which can hold a base) rather than
|
|
238
|
+
# InternationalStandard (which cannot).
|
|
239
|
+
klass ||= Identifiers::Supplement if base
|
|
240
|
+
klass || Identifiers::InternationalStandard
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Try direct key lookup, then a case-insensitive key lookup (indexes
|
|
244
|
+
# store e.g. "DATA" but the registry key is :data), then fall back to
|
|
245
|
+
# matching the class's :short letter (e.g. type "R" → Recommendation,
|
|
246
|
+
# whose key is :rec and short is "R"). Indexes and legacy data carry
|
|
247
|
+
# either the key, an upper-cased key, or the short form.
|
|
248
|
+
def self.locate_klass_by_type_or_short(type)
|
|
249
|
+
Scheme.locate_identifier_klass_by_type_code(type) ||
|
|
250
|
+
Scheme.locate_identifier_klass_by_type_code(type.to_s.downcase) ||
|
|
251
|
+
Scheme.identifiers.detect { |k| k.type&.dig(:short)&.to_s == type.to_s }
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
def self.supplement_klass?(klass)
|
|
255
|
+
Array(Scheme.instance.supplement_identifiers).include?(klass)
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
def self.coerce_create_attrs(opts)
|
|
259
|
+
out = {}
|
|
260
|
+
if (v = opts[:publisher])
|
|
261
|
+
# Mirror parse: the publisher carries its copublishers in its own
|
|
262
|
+
# copublisher list, and each copublisher is also a standalone entry
|
|
263
|
+
# in the copublishers collection. No copublisher → [] (parity with
|
|
264
|
+
# parsed plain-ISO identifiers).
|
|
265
|
+
cops = Array(opts[:copublisher]).map(&:to_s)
|
|
266
|
+
out[:publisher] = Components::Publisher.new(
|
|
267
|
+
publisher: v.to_s, copublisher: cops,
|
|
268
|
+
)
|
|
269
|
+
end
|
|
270
|
+
if opts[:copublisher]
|
|
271
|
+
out[:copublishers] = Array(opts[:copublisher]).map do |c|
|
|
272
|
+
Components::Publisher.new(publisher: c.to_s)
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
%i[number part subpart].each do |k|
|
|
276
|
+
v = opts[k]
|
|
277
|
+
out[k] = Components::Code.new(number: v.to_s) unless v.nil?
|
|
278
|
+
end
|
|
279
|
+
if (v = opts[:year])
|
|
280
|
+
out[:date] = ::Pubid::Components::Date.new(year: v.to_s)
|
|
281
|
+
end
|
|
282
|
+
if (v = opts[:edition])
|
|
283
|
+
if v.is_a?(Hash)
|
|
284
|
+
# 1.x stored a directive org-variant ("ISO/IEC DIR 2 ISO" /
|
|
285
|
+
# "ISO/IEC DIR 1 IEC:2023") as edition: {publisher:, year:}; parse
|
|
286
|
+
# models the org as `part` and the year as `date`. Map it so create
|
|
287
|
+
# round-trips parse.
|
|
288
|
+
eh = v.transform_keys(&:to_sym)
|
|
289
|
+
out[:part] ||= Components::Code.new(number: eh[:publisher].to_s) if eh[:publisher]
|
|
290
|
+
out[:date] ||= ::Pubid::Components::Date.new(year: eh[:year].to_s) if eh[:year]
|
|
291
|
+
else
|
|
292
|
+
out[:edition] = ::Pubid::Components::Edition.new(number: v)
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
if (v = opts[:language])
|
|
296
|
+
out[:languages] =
|
|
297
|
+
[::Pubid::Components::Language.new(code: v.to_s)]
|
|
298
|
+
end
|
|
299
|
+
# TcDocument committee fields: the 1.x/index shape is the flat
|
|
300
|
+
# tctype/tcnumber/… keys, but the 2.x model stores underscored Code
|
|
301
|
+
# components (mirrors the parser's builder). Without this mapping a
|
|
302
|
+
# TC document round-trips to a bare "ISO N <num>".
|
|
303
|
+
{ tctype: :tc_type, tcnumber: :tc_number,
|
|
304
|
+
sctype: :sc_type, scnumber: :sc_number,
|
|
305
|
+
wgtype: :wg_type, wgnumber: :wg_number }.each do |src, dest|
|
|
306
|
+
v = opts[src]
|
|
307
|
+
out[dest] = Components::Code.new(number: v.to_s) unless v.nil?
|
|
308
|
+
end
|
|
309
|
+
# Directives subgroup (e.g. "ISO/IEC JTC 1 DIR"): the 1.x/index shape
|
|
310
|
+
# is dirtype: "JTC", jtc_dir: "DIR", number: "1"; the 2.x model folds
|
|
311
|
+
# the subgroup into a single `subgroup` Code ("JTC 1") with no
|
|
312
|
+
# directive number, mirroring parse. Without this, .create drops the
|
|
313
|
+
# subgroup and collapses the id into a plain "DIR 1".
|
|
314
|
+
if opts[:dirtype]
|
|
315
|
+
out[:subgroup] = Components::Code.new(
|
|
316
|
+
number: [opts[:dirtype], opts[:number]].compact.join(" "),
|
|
317
|
+
)
|
|
318
|
+
out.delete(:number)
|
|
319
|
+
end
|
|
320
|
+
# TODO(create-shim): 1.x also accepted iteration, amendments,
|
|
321
|
+
# corrigendums, addendum, month, dir. Add as relaton call sites
|
|
322
|
+
# require them.
|
|
323
|
+
out
|
|
324
|
+
end
|
|
325
|
+
private_class_method :resolve_create_class, :supplement_klass?,
|
|
326
|
+
:resolve_create_typed_stage, :coerce_create_attrs,
|
|
327
|
+
:build_bundled, :build_joint_supplement
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Iso
|
|
5
|
+
module Identifiers
|
|
6
|
+
class Addendum < SupplementIdentifier
|
|
7
|
+
attribute :type, ::Pubid::Components::Type, default: -> { self.class.type[:key] }
|
|
8
|
+
|
|
9
|
+
# Override URN supplement type to use generic "sup" instead of "add"
|
|
10
|
+
# This matches the ISO URN specification where addendums use "sup"
|
|
11
|
+
def urn_supplement_type
|
|
12
|
+
"sup"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
TYPED_STAGES = [
|
|
16
|
+
::Pubid::Components::TypedStage.new(
|
|
17
|
+
code: :pwi_add,
|
|
18
|
+
abbr: ["PWI Add"],
|
|
19
|
+
short_abbr: nil,
|
|
20
|
+
long_abbr: nil,
|
|
21
|
+
type_code: :add,
|
|
22
|
+
stage_code: :proposal,
|
|
23
|
+
name: "Proposed Work Item for Addendum",
|
|
24
|
+
harmonized_stages: %w[00.00 00.20 00.60 00.92 00.93 00.98 00.99],
|
|
25
|
+
),
|
|
26
|
+
::Pubid::Components::TypedStage.new(
|
|
27
|
+
code: :np_add,
|
|
28
|
+
abbr: ["NP Add"],
|
|
29
|
+
short_abbr: nil,
|
|
30
|
+
long_abbr: nil,
|
|
31
|
+
type_code: :add,
|
|
32
|
+
stage_code: :proposal,
|
|
33
|
+
name: "New Work Item Proposal for Addendum",
|
|
34
|
+
harmonized_stages: %w[10.00 10.20 10.60 10.92 10.93 10.98],
|
|
35
|
+
),
|
|
36
|
+
::Pubid::Components::TypedStage.new(
|
|
37
|
+
code: :awi_add,
|
|
38
|
+
abbr: ["AWI Add"],
|
|
39
|
+
short_abbr: nil,
|
|
40
|
+
long_abbr: nil,
|
|
41
|
+
type_code: :add,
|
|
42
|
+
stage_code: :preliminary,
|
|
43
|
+
name: "Approved Work Item for Addendum",
|
|
44
|
+
harmonized_stages: %w[10.99 20.00],
|
|
45
|
+
),
|
|
46
|
+
::Pubid::Components::TypedStage.new(
|
|
47
|
+
code: :wd_add,
|
|
48
|
+
abbr: ["WD Add"],
|
|
49
|
+
short_abbr: nil,
|
|
50
|
+
long_abbr: nil,
|
|
51
|
+
type_code: :add,
|
|
52
|
+
stage_code: :working_draft,
|
|
53
|
+
name: "Working Draft for Addendum",
|
|
54
|
+
harmonized_stages: %w[20.20 20.60 20.92 20.93 20.98 20.99],
|
|
55
|
+
),
|
|
56
|
+
::Pubid::Components::TypedStage.new(
|
|
57
|
+
code: :committee_draft_add,
|
|
58
|
+
abbr: ["CD Add"],
|
|
59
|
+
short_abbr: nil,
|
|
60
|
+
long_abbr: nil,
|
|
61
|
+
type_code: :add,
|
|
62
|
+
stage_code: :cd,
|
|
63
|
+
name: "Committee Draft for Addendum",
|
|
64
|
+
harmonized_stages: %w[30.00 30.20 30.60 30.92 30.93 30.98 30.99],
|
|
65
|
+
),
|
|
66
|
+
::Pubid::Components::TypedStage.new(
|
|
67
|
+
code: :dad,
|
|
68
|
+
abbr: ["DAD", "DAdd", "D ADD", "Dad"],
|
|
69
|
+
short_abbr: "DAD",
|
|
70
|
+
long_abbr: "DAdd",
|
|
71
|
+
type_code: :add,
|
|
72
|
+
stage_code: :dad,
|
|
73
|
+
name: "Draft Addendum",
|
|
74
|
+
harmonized_stages: %w[40.00 40.20 40.60 40.92 40.93 40.98 40.99],
|
|
75
|
+
),
|
|
76
|
+
::Pubid::Components::TypedStage.new(
|
|
77
|
+
code: :fdad,
|
|
78
|
+
abbr: ["FDAD", "FDAdd", "FD ADD", "FDad"],
|
|
79
|
+
short_abbr: "FDAD",
|
|
80
|
+
long_abbr: "FDAdd",
|
|
81
|
+
type_code: :add,
|
|
82
|
+
stage_code: :fdad,
|
|
83
|
+
name: "Final Draft Addendum",
|
|
84
|
+
harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
|
|
85
|
+
),
|
|
86
|
+
::Pubid::Components::TypedStage.new(
|
|
87
|
+
code: :published,
|
|
88
|
+
abbr: ["Add", "ADD", "Add.", "Addendum"],
|
|
89
|
+
short_abbr: "ADD",
|
|
90
|
+
long_abbr: "Add",
|
|
91
|
+
type_code: :add,
|
|
92
|
+
stage_code: :published,
|
|
93
|
+
name: "Addendum",
|
|
94
|
+
harmonized_stages: %w[60.00 60.60],
|
|
95
|
+
),
|
|
96
|
+
].freeze
|
|
97
|
+
|
|
98
|
+
def self.type
|
|
99
|
+
{ key: :add, title: "Addendum", short: "ADD" }
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Iso
|
|
5
|
+
module Identifiers
|
|
6
|
+
class Amendment < SupplementIdentifier
|
|
7
|
+
attribute :type, ::Pubid::Components::Type, default: -> { self.class.type[:key] }
|
|
8
|
+
|
|
9
|
+
TYPED_STAGES = [
|
|
10
|
+
::Pubid::Components::TypedStage.new(
|
|
11
|
+
code: :pwi_amd,
|
|
12
|
+
abbr: ["PWI Amd"],
|
|
13
|
+
short_abbr: nil,
|
|
14
|
+
long_abbr: nil,
|
|
15
|
+
type_code: :amd,
|
|
16
|
+
stage_code: :proposal,
|
|
17
|
+
name: "Proposed Work Item for Amendment",
|
|
18
|
+
harmonized_stages: %w[00.00 00.20 00.60 00.92 00.93 00.98 00.99],
|
|
19
|
+
),
|
|
20
|
+
::Pubid::Components::TypedStage.new(
|
|
21
|
+
code: :np_amd,
|
|
22
|
+
abbr: ["NP Amd"],
|
|
23
|
+
short_abbr: nil,
|
|
24
|
+
long_abbr: nil,
|
|
25
|
+
type_code: :amd,
|
|
26
|
+
stage_code: :proposal,
|
|
27
|
+
name: "New Work Item Proposal for Amendment",
|
|
28
|
+
harmonized_stages: %w[10.00 10.20 10.60 10.92 10.93 10.98],
|
|
29
|
+
),
|
|
30
|
+
::Pubid::Components::TypedStage.new(
|
|
31
|
+
code: :awi_amd,
|
|
32
|
+
abbr: ["AWI Amd"],
|
|
33
|
+
short_abbr: nil,
|
|
34
|
+
long_abbr: nil,
|
|
35
|
+
type_code: :amd,
|
|
36
|
+
stage_code: :preliminary,
|
|
37
|
+
name: "Approved Work Item for Amendment",
|
|
38
|
+
harmonized_stages: %w[10.99 20.00],
|
|
39
|
+
),
|
|
40
|
+
::Pubid::Components::TypedStage.new(
|
|
41
|
+
code: :wd_amd,
|
|
42
|
+
abbr: ["WD Amd"],
|
|
43
|
+
short_abbr: nil,
|
|
44
|
+
long_abbr: nil,
|
|
45
|
+
type_code: :amd,
|
|
46
|
+
stage_code: :working_draft,
|
|
47
|
+
name: "Working Draft for Amendment",
|
|
48
|
+
harmonized_stages: %w[20.20 20.60 20.92 20.93 20.98 20.99],
|
|
49
|
+
),
|
|
50
|
+
::Pubid::Components::TypedStage.new(
|
|
51
|
+
code: :committee_draft_amd,
|
|
52
|
+
abbr: ["CD Amd"],
|
|
53
|
+
short_abbr: nil,
|
|
54
|
+
long_abbr: nil,
|
|
55
|
+
type_code: :amd,
|
|
56
|
+
stage_code: :cd,
|
|
57
|
+
name: "Committee Draft for Amendment",
|
|
58
|
+
harmonized_stages: %w[30.00 30.20 30.60 30.92 30.93 30.98 30.99],
|
|
59
|
+
),
|
|
60
|
+
::Pubid::Components::TypedStage.new(
|
|
61
|
+
code: :pdam,
|
|
62
|
+
abbr: ["PDAM"],
|
|
63
|
+
short_abbr: nil,
|
|
64
|
+
long_abbr: nil,
|
|
65
|
+
type_code: :amd,
|
|
66
|
+
stage_code: :cd,
|
|
67
|
+
name: "Proposed Draft Amendment (Legacy)",
|
|
68
|
+
harmonized_stages: %w[30.00 30.20 30.60 30.92 30.93 30.98 30.99],
|
|
69
|
+
),
|
|
70
|
+
::Pubid::Components::TypedStage.new(
|
|
71
|
+
code: :damd,
|
|
72
|
+
abbr: ["DAM", "DAmd"],
|
|
73
|
+
short_abbr: "DAM",
|
|
74
|
+
long_abbr: "DAmd",
|
|
75
|
+
type_code: :amd,
|
|
76
|
+
stage_code: :damd,
|
|
77
|
+
name: "Draft Amendment",
|
|
78
|
+
harmonized_stages: %w[40.00 40.20 40.60 40.92 40.93 40.98 40.99],
|
|
79
|
+
),
|
|
80
|
+
::Pubid::Components::TypedStage.new(
|
|
81
|
+
code: :fdamd,
|
|
82
|
+
abbr: ["FDAM", "FDAmd"],
|
|
83
|
+
short_abbr: "FDAM",
|
|
84
|
+
long_abbr: "FDAmd",
|
|
85
|
+
type_code: :amd,
|
|
86
|
+
stage_code: :fdamd,
|
|
87
|
+
name: "Final Draft Amendment",
|
|
88
|
+
harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
|
|
89
|
+
),
|
|
90
|
+
::Pubid::Components::TypedStage.new(
|
|
91
|
+
code: :fpdam,
|
|
92
|
+
abbr: ["FPDAM"],
|
|
93
|
+
short_abbr: nil,
|
|
94
|
+
long_abbr: nil,
|
|
95
|
+
type_code: :amd,
|
|
96
|
+
stage_code: :fdamd,
|
|
97
|
+
name: "Final Proposed Draft Amendment (Legacy)",
|
|
98
|
+
harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
|
|
99
|
+
),
|
|
100
|
+
::Pubid::Components::TypedStage.new(
|
|
101
|
+
code: :prf_amd,
|
|
102
|
+
abbr: ["PRF Amd"],
|
|
103
|
+
short_abbr: nil,
|
|
104
|
+
long_abbr: nil,
|
|
105
|
+
type_code: :amd,
|
|
106
|
+
stage_code: :prf,
|
|
107
|
+
name: "Proof Amendment",
|
|
108
|
+
harmonized_stages: %w[50.00],
|
|
109
|
+
),
|
|
110
|
+
::Pubid::Components::TypedStage.new(
|
|
111
|
+
code: :published,
|
|
112
|
+
abbr: ["Amd", "AMD", "Amd."],
|
|
113
|
+
short_abbr: "AMD",
|
|
114
|
+
long_abbr: "Amd",
|
|
115
|
+
type_code: :amd,
|
|
116
|
+
stage_code: :published,
|
|
117
|
+
name: "Amendment",
|
|
118
|
+
harmonized_stages: %w[60.00 60.60],
|
|
119
|
+
),
|
|
120
|
+
].freeze
|
|
121
|
+
|
|
122
|
+
def self.type
|
|
123
|
+
{ key: :amd, title: "Amendment", short: "AMD" }
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|