pubid 2.0.35 → 2.0.37

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10f4f47a46595c3e5ba212176f9e40f784885b02651b4f7fddf929cd670998d9
4
- data.tar.gz: d0a6c7e6da3c3d8b5588430fa89196fcacef5c258a46f494e6132facc092972e
3
+ metadata.gz: 274f98ac62f065d733cb34f34257bd7603e9b7bb61936dc8c4bc3056207a4a2c
4
+ data.tar.gz: 82cac5f159f49b73c2425b0525349f8ad3b6325d670fdc056ab0379720bd31fe
5
5
  SHA512:
6
- metadata.gz: 2970f1e3bf25171ad9cd39a04f0854e33af6c40a2ded9b5116196622e414ac51e6872ee1877ad0c7ccf18e668fca03bc3dbcf8e84ef7aae672966131cb7f7067
7
- data.tar.gz: 33d1c50ce30986ccf16b16d392f86395f7e38571e4584893506cc03e42a2864aafc16e3f0097e542de4ba79e6fdb82d44d34986a6b09906b22dea6fbda15969f
6
+ metadata.gz: dd017f90210cb5e07bb453beceaae322edb83d4b6895ec07790fa747ae8484d86e3385bc693e839765c909d7340cbb5605038d27d645dd3dc179f9a3ba83ba81
7
+ data.tar.gz: f4ebf2cc2e1acba20b6e6d328455ef48edb820603e90b5045bf84db68ef603ea817ba206b9d46b9bb985556d444bb93932dd6b24708818d904b8221e3c0522f8
@@ -19,13 +19,19 @@ followed by a number whose shape varies per series.
19
19
  | G | Guideline | 4 digits, zero-padded | `IALA G1015 Ed 2.2` |
20
20
  | C | Model Course | 4 digits + `-` part | `IALA C0103-1 Ed 3.0` |
21
21
  | M | Manual (planned) | 4 digits, zero-padded | `IALA M0001 Ed 9.0` |
22
- | A | Advice | dashed, no edition in the corpus | `IALA A12-01` |
23
- | GA | General Assembly resolution | dotted, each segment 2 digits | `IALA GA01.01` |
22
+ | GA | General Assembly resolution | dotted, each segment 2 digits (`GA01.01`); legacy A-session form dashed (`A12-01`) | `IALA GA01.01`, `IALA A12-01` |
24
23
  | L | Letter | dotted + dashed, verbatim | `IALA L2.1.11 Ed 2` |
25
24
  | X | Report (reserved) | 4 digits | `IALA X0123` |
26
25
  | P | Resolution/Council publication (reserved) | 4 digits | `IALA P0123` |
27
26
  | — | Annex wrapper over any base | bare or lettered | `IALA G1128 ANNEX A Ed 1.6` |
28
27
 
28
+ The A letter is GeneralAssembly's legacy session form, not a separate
29
+ series: all 11 A-shaped primary docidentifiers in relaton-data-iala
30
+ (A12-01, A13-01 through A13-04) are GA resolutions, the covers read
31
+ "GA Resolution A12-01", and no Advice-series document exists in the
32
+ catalogue. The letter the input used (GA or A) round-trips verbatim
33
+ through to_s and the URN; there is no Advice type.
34
+
29
35
  The Annex class has no prefix of its own: it wraps a base identifier of
30
36
  another series and preserves the annex marker case (`Annex` vs `ANNEX`).
31
37
  X and P are reserved for future numbered series — today's reports and
@@ -51,7 +51,6 @@ module Pubid
51
51
  "pubid:iala:guideline" => "Pubid::Iala::Identifiers::Guideline",
52
52
  "pubid:iala:manual" => "Pubid::Iala::Identifiers::Manual",
53
53
  "pubid:iala:model-course" => "Pubid::Iala::Identifiers::ModelCourse",
54
- "pubid:iala:advice" => "Pubid::Iala::Identifiers::Advice",
55
54
  "pubid:iala:general-assembly" => "Pubid::Iala::Identifiers::GeneralAssembly",
56
55
  "pubid:iala:letter" => "Pubid::Iala::Identifiers::Letter",
57
56
  "pubid:iala:annex" => "Pubid::Iala::Identifiers::Annex",
@@ -100,6 +99,14 @@ module Pubid
100
99
  def dotted_segment_width(width)
101
100
  @canonical_dotted_segment_width = width
102
101
  end
102
+
103
+ public
104
+
105
+ # Additional type letters that route to this class; empty by
106
+ # default (GeneralAssembly aliases the legacy "A" session letter).
107
+ def type_letter_aliases(*_letters)
108
+ []
109
+ end
103
110
  end
104
111
  end
105
112
  end
@@ -3,8 +3,19 @@
3
3
  module Pubid
4
4
  module Iala
5
5
  module Identifiers
6
- # IALA General Assembly resolutions (GA prefix). Numbering is dotted
7
- # with a series and an index: GA01.01, GA01.13. No edition.
6
+ # IALA General Assembly resolutions. Two printed forms carry the
7
+ # same class:
8
+ #
9
+ # - dotted series.index: GA01.01, GA01.13 — the form the
10
+ # relaton-data-iala catalogue registers for session A-1 onwards
11
+ # (26 primary docidentifiers).
12
+ # - legacy dashed session form: A12-01, A13-04 — the form the
13
+ # catalogue and the published covers use for the A-12/A-13
14
+ # sessions (all 11 A-shaped primary docidentifiers in the
15
+ # catalogue are GA resolutions; the shape carries no Advice).
16
+ # No edition. The two forms are distinguished by number shape
17
+ # (dotted GA numbers vs dashed A numbers) and rendered verbatim
18
+ # through to_s and the MRN URN; no extra attribute is stored.
8
19
  class GeneralAssembly < Identifier
9
20
  number_width 2
10
21
  dotted_segment_width 2
@@ -13,6 +24,21 @@ module Pubid
13
24
  { key: :"general-assembly", title: "General Assembly Resolution",
14
25
  short: "GA" }
15
26
  end
27
+
28
+ # The legacy A-session letter renders for dashed numbers
29
+ # (A12-01); dotted numbers carry the canonical GA letter.
30
+ def type_letter
31
+ number.to_s.include?("-") ? "A" : super
32
+ end
33
+
34
+ # DSL: declare additional type letters that route to this class.
35
+ # The legacy A-session letter resolves here as well.
36
+ def self.type_letter_aliases(*letters)
37
+ @type_letter_aliases = letters if letters.any?
38
+ @type_letter_aliases || []
39
+ end
40
+
41
+ type_letter_aliases "A"
16
42
  end
17
43
  end
18
44
  end
@@ -3,7 +3,6 @@
3
3
  module Pubid
4
4
  module Iala
5
5
  module Identifiers
6
- autoload :Advice, "#{__dir__}/identifiers/advice"
7
6
  autoload :Annex, "#{__dir__}/identifiers/annex"
8
7
  autoload :Standard, "#{__dir__}/identifiers/standard"
9
8
  autoload :Recommendation, "#{__dir__}/identifiers/recommendation"
@@ -13,7 +13,6 @@ module Pubid
13
13
  atom "letter", "letter"
14
14
 
15
15
 
16
- type "pubid:iala:advice", "advice"
17
16
  type "pubid:iala:annex", "annex"
18
17
  type "pubid:iala:general-assembly", "ga"
19
18
  type "pubid:iala:guideline", "g"
data/lib/pubid/iala.rb CHANGED
@@ -60,11 +60,15 @@ module Pubid
60
60
  all_typed_stages.find { |s| s.abbr.any? { |a| a.to_s.upcase == abbr_str } }
61
61
  end
62
62
 
63
- # Look up an identifier class by its IALA type letter (S, R, G, M, C, X, P).
63
+ # Look up an identifier class by its IALA type letter (S, R, G, M,
64
+ # C, X, P, GA) or a class-declared alias of one (GeneralAssembly
65
+ # answers to the legacy "A" session letter).
64
66
  # @param letter [String]
65
67
  # @return [Class<Identifier>]
66
68
  def self.identifier_klass_for_type_letter(letter)
67
- @by_letter ||= identifier_types.to_h { |klass| [klass.type[:short], klass] }
69
+ @by_letter ||= identifier_types.flat_map do |klass|
70
+ ([klass.type[:short]] + Array(klass.type_letter_aliases)).map { |l| [l, klass] }
71
+ end.to_h
68
72
  @by_letter.fetch(letter.to_s.upcase)
69
73
  end
70
74
  end
data/lib/pubid/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.35"
4
+ VERSION = "2.0.37"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.35
4
+ version: 2.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -623,7 +623,6 @@ files:
623
623
  - lib/pubid/iala/builder.rb
624
624
  - lib/pubid/iala/identifier.rb
625
625
  - lib/pubid/iala/identifiers.rb
626
- - lib/pubid/iala/identifiers/advice.rb
627
626
  - lib/pubid/iala/identifiers/annex.rb
628
627
  - lib/pubid/iala/identifiers/general_assembly.rb
629
628
  - lib/pubid/iala/identifiers/guideline.rb
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pubid
4
- module Iala
5
- module Identifiers
6
- # IALA Advices (A prefix). Numbering is dashed: A12-01, A13-04.
7
- # Carries no edition in the corpus.
8
- class Advice < Identifier
9
- def self.type
10
- { key: :advice, title: "Advice", short: "A" }
11
- end
12
- end
13
- end
14
- end
15
- end