pubid 2.0.0.pre.alpha.26 → 2.0.0.pre.alpha.28
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/data/ieee/update_codes.yaml +6 -3
- data/data/parg/iec.json +1 -1
- data/data/parg/ieee.json +1 -1
- data/data/parg/nesc.parg +1 -1
- data/data/parg/nist.json +1 -1
- data/lib/pubid/format_registry.rb +37 -0
- data/lib/pubid/ieee/aiee/builder.rb +5 -2
- data/lib/pubid/ieee/aiee/identifier.rb +18 -13
- data/lib/pubid/ieee/builder.rb +132 -14
- data/lib/pubid/ieee/components/draft.rb +29 -3
- data/lib/pubid/ieee/identifiers/joint_development.rb +11 -2
- data/lib/pubid/ieee/long_renderer.rb +18 -0
- data/lib/pubid/ieee/renderer.rb +48 -3
- data/lib/pubid/ieee.rb +2 -0
- data/lib/pubid/nist/components/edition.rb +22 -1
- data/lib/pubid/nist/components/translation.rb +4 -2
- data/lib/pubid/nist/identifiers/base.rb +55 -22
- data/lib/pubid/nist/parser.rb +1 -0
- data/lib/pubid/version.rb +1 -1
- metadata +3 -2
|
@@ -438,32 +438,42 @@ module Pubid
|
|
|
438
438
|
end
|
|
439
439
|
|
|
440
440
|
def to_full_style
|
|
441
|
-
# "National Institute of Standards and Technology Special
|
|
441
|
+
# "National Institute of Standards and Technology Special
|
|
442
|
+
# Publication 1000 Part 1 Supplement 3 Section 2 Index Update 5
|
|
443
|
+
# (2021)(en)" - the edition renders its own long form ("Revision
|
|
444
|
+
# 5" / "(2021)"), never the derived revision view alongside it
|
|
442
445
|
result = publisher_full_name
|
|
443
446
|
result += " #{series_full_name}" if series
|
|
444
447
|
result += " #{number}" if number
|
|
445
448
|
result += parts.map { |p| "-#{p}" }.join if parts&.any?
|
|
446
449
|
|
|
447
|
-
#
|
|
450
|
+
# The 1.x corpus order: stage, volume, part, revision, version,
|
|
451
|
+
# supplement, section, update; an edition date trails as the
|
|
452
|
+
# parenthesised date before the translation
|
|
453
|
+
result += " #{stage.to_s(:long)}" if stage
|
|
454
|
+
|
|
455
|
+
# Volume and issue number in long form: "Volume 6, No. 12" - the
|
|
456
|
+
# component's own v-notation must not leak into the worded form
|
|
448
457
|
if volume && issue_number
|
|
449
|
-
result += "
|
|
458
|
+
result += " Volume #{volume.value}, #{issue_number.to_s(:long)}"
|
|
450
459
|
elsif volume
|
|
451
|
-
result += "
|
|
460
|
+
result += " Volume #{volume.value}"
|
|
452
461
|
end
|
|
453
462
|
|
|
454
|
-
|
|
455
|
-
result += " #{edition.to_s(:long)}" if edition
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
463
|
+
result += " Part #{part.value}" if part
|
|
464
|
+
result += " #{edition.to_s(:long)}" if edition && !edition_year?
|
|
465
|
+
# A revision riding on a date edition composes at the revision
|
|
466
|
+
# slot ("... Part 2, Revision 3 ... (2001)")
|
|
467
|
+
if edition&.additional_text.to_s =~ /\Ar(\d+)\z/
|
|
468
|
+
result += " Revision #{Regexp.last_match[1]}"
|
|
469
|
+
end
|
|
460
470
|
result += " #{version_component.to_s(:long)}" if version_component
|
|
461
|
-
|
|
462
|
-
#
|
|
471
|
+
result += " #{supplement.to_s(:long)}" if supplement
|
|
472
|
+
result += " Section #{section}" if section
|
|
473
|
+
result += " Index" if index
|
|
463
474
|
result += " #{update_component.to_s(:long)}" if update_component
|
|
464
475
|
|
|
465
|
-
#
|
|
466
|
-
result += " #{stage.to_s(:long)}" if stage
|
|
476
|
+
result += " #{edition.to_s(:long)}" if edition && edition_year?
|
|
467
477
|
|
|
468
478
|
# V2: Use translation_component (already includes space)
|
|
469
479
|
result += translation_component.to_s(:long) if translation_component
|
|
@@ -478,10 +488,9 @@ module Pubid
|
|
|
478
488
|
result += " #{number}" if number
|
|
479
489
|
result += " Part #{parts.first}" if parts&.any?
|
|
480
490
|
|
|
481
|
-
#
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
result += ", Revision #{revision}" if revision
|
|
491
|
+
# The edition renders its own form ("Revision 5" / "(2021)");
|
|
492
|
+
# the derived revision view never renders alongside it
|
|
493
|
+
result += " #{edition.to_s(:long)}" if edition
|
|
485
494
|
|
|
486
495
|
# V2: Use version_component
|
|
487
496
|
result += " #{version_component.to_s(:abbrev)}" if version_component
|
|
@@ -565,7 +574,8 @@ module Pubid
|
|
|
565
574
|
|
|
566
575
|
# Volume and Part components (v6n1 notation for CSM, pt1 for SP)
|
|
567
576
|
if volume.is_a?(Components::Volume) && effective_part.is_a?(Components::Part)
|
|
568
|
-
#
|
|
577
|
+
# the volume keeps its leading space before the part
|
|
578
|
+
# ("535 v1pt1"), the corpus form (testsuite 10491/10492)
|
|
569
579
|
result += " #{volume}#{effective_part}"
|
|
570
580
|
elsif effective_part.is_a?(Components::Part)
|
|
571
581
|
# SP and other series: use Part.type to determine format
|
|
@@ -578,6 +588,11 @@ module Pubid
|
|
|
578
588
|
# Render volume and issue number in short form: "v6n12"
|
|
579
589
|
vol_str = volume.is_a?(Components::Volume) ? volume.to_s : "v#{volume}"
|
|
580
590
|
result += "#{vol_str}n#{issue_number.number}"
|
|
591
|
+
elsif issue_number
|
|
592
|
+
# A standalone issue renders its own short form (pubid#497 -
|
|
593
|
+
# the metanorma-nist port passes the index here; n4 must not
|
|
594
|
+
# silently drop).
|
|
595
|
+
result += issue_number.to_s(:short)
|
|
581
596
|
end
|
|
582
597
|
|
|
583
598
|
# Use edition component properly (e2, e2021, r5, -3)
|
|
@@ -615,9 +630,12 @@ module Pubid
|
|
|
615
630
|
|
|
616
631
|
# Add other attributes
|
|
617
632
|
result += errata.to_s if errata
|
|
618
|
-
result += "index" if index
|
|
619
633
|
result += "insert" if insert
|
|
634
|
+
# The 1.x order is section before index ("sup3sec2indx"); the index
|
|
635
|
+
# spelling is the abbreviated indx (pubid#497) — the full "index"
|
|
636
|
+
# input spelling canonicalizes onto it.
|
|
620
637
|
result += "sec#{section}" if section
|
|
638
|
+
result += "indx" if index
|
|
621
639
|
result += "app" if appendix
|
|
622
640
|
|
|
623
641
|
# Add addendum - render as " Add." suffix
|
|
@@ -694,6 +712,9 @@ module Pubid
|
|
|
694
712
|
elsif volume && issue_number
|
|
695
713
|
vol_str = volume.is_a?(Components::Volume) ? volume.to_s : "v#{volume}"
|
|
696
714
|
result += "#{vol_str}n#{issue_number.number}"
|
|
715
|
+
elsif issue_number
|
|
716
|
+
# A standalone issue renders its own short form (pubid#497)
|
|
717
|
+
result += issue_number.to_s(:mr)
|
|
697
718
|
end
|
|
698
719
|
|
|
699
720
|
# With a number, the edition glues to it per the NIST spec
|
|
@@ -727,19 +748,31 @@ module Pubid
|
|
|
727
748
|
result += ".Add."
|
|
728
749
|
end
|
|
729
750
|
|
|
751
|
+
# Section and index travel with the identifier in MR form too
|
|
752
|
+
# (pubid#497 - sec<N> / indx must not drop)
|
|
753
|
+
result += ".sec#{section}" if section
|
|
754
|
+
result += ".indx" if index
|
|
755
|
+
|
|
730
756
|
# Use translation_component
|
|
731
757
|
result += translation_component.to_s(:mr) if translation_component
|
|
732
758
|
|
|
733
759
|
result
|
|
734
760
|
end
|
|
735
761
|
|
|
762
|
+
# An e-type edition whose id is a date (year or full date)
|
|
763
|
+
# composes as the trailing parenthesised date
|
|
764
|
+
def edition_year?
|
|
765
|
+
edition&.type == "e" && edition.id.to_s =~ /\A\d{4}(\d{2}(\d{2})?)?\z/
|
|
766
|
+
end
|
|
767
|
+
|
|
736
768
|
def series_full_name
|
|
737
769
|
{
|
|
738
770
|
"SP" => "Special Publication",
|
|
739
|
-
"FIPS" => "Federal Information Processing Standards",
|
|
771
|
+
"FIPS" => "Federal Information Processing Standards Publication",
|
|
740
772
|
"IR" => "Interagency Report",
|
|
741
773
|
"TN" => "Technical Note",
|
|
742
|
-
|
|
774
|
+
"CSWP" => "Cybersecurity White Papers",
|
|
775
|
+
}[series.to_s] || series.to_s
|
|
743
776
|
end
|
|
744
777
|
|
|
745
778
|
def series_abbreviated_name
|
data/lib/pubid/nist/parser.rb
CHANGED
data/lib/pubid/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pubid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.0.pre.alpha.
|
|
4
|
+
version: 2.0.0.pre.alpha.28
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -652,6 +652,7 @@ files:
|
|
|
652
652
|
- lib/pubid/ieee/ire/builder.rb
|
|
653
653
|
- lib/pubid/ieee/ire/identifier.rb
|
|
654
654
|
- lib/pubid/ieee/ire/parser.rb
|
|
655
|
+
- lib/pubid/ieee/long_renderer.rb
|
|
655
656
|
- lib/pubid/ieee/nesc.rb
|
|
656
657
|
- lib/pubid/ieee/nesc/builder.rb
|
|
657
658
|
- lib/pubid/ieee/nesc/parser.rb
|