pubid-iso 1.15.17 → 1.15.18

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: cacdca9f11e7be5d1c4e3cd5c85fb851abece42c3b74fd3bade4af732c186296
4
- data.tar.gz: 026fdc88fd9b3243707564262c68f446871c9b6d364a3e3442c13952c5daf069
3
+ metadata.gz: e9151e27432eab593cff08a03303fcdc23c81ac9c1ab93d9a2f125378dbe1bba
4
+ data.tar.gz: b014094046f3bf7a8dbbde5c5abf22cef38d5f654fac9635b4ba690199075b8f
5
5
  SHA512:
6
- metadata.gz: 99d4e00507e95a5a6bce075dffe60f77b5295c136f08ee483ba3975e741fce605ebd75e4ed08a1dbec6ae7d3c6936e55304b44a15f637e0219adddc134c3b30d
7
- data.tar.gz: 131419d340751b3aa2404c2043194b381774fd08cd103ab294493778f6b4f7389c0b0300b9162c24ab6f659f9f79cd3b63f9312b3bec2444e9d13fabf9181124
6
+ metadata.gz: cca0ed419663de09ec03fe57e733be53783010cc8565d79a7319d021ab0524b0ce0a1a7935b8e1d098430e3443da595c33f2c98fc96735b81744a9ae767b1267
7
+ data.tar.gz: 26a4dbf7df2b2212b27e5c83028966f2b3512c537b28a9b3e868ce70c9020acd24d8b42b7987a4bb7ffeb17389518cfba27056e9328aedb684ad067bb3ce77a7
@@ -98,7 +98,14 @@ module Pubid::Iso
98
98
  rule(:part_matcher) do
99
99
  year_digits.absent? >>
100
100
  supplements.absent? >>
101
- staged_addenda.absent? >> ((roman_numerals >> digits.absent?) | match['[\dA-Z]'].repeat(1)).as(:part)
101
+ staged_supplement.absent? >>
102
+ staged_addenda.absent? >>
103
+ (str("Add") | str("ADD")).absent? >>
104
+ # Stage-prefixed supplements like `WD Amd`, `DIS Cor`, `PWI Add`
105
+ # must reach the supplement/addendum rules, not be greedily eaten
106
+ # here as a part code.
107
+ ((stage | typed_stage) >> space >> (supplements | str("Add") | str("ADD"))).absent? >>
108
+ ((roman_numerals >> digits.absent? >> match['[A-Z]'].absent?) | match['[\dA-Z]'].repeat(1)).as(:part)
102
109
  end
103
110
 
104
111
  rule(:part) do
@@ -130,7 +137,9 @@ module Pubid::Iso
130
137
 
131
138
  rule(:addendum) do
132
139
  (
133
- (((str("/") >> (str("Add") | str("ADD")).as(:type)) | (str(" — ") >> str("Addendum").as(:type))) |
140
+ (((str("/") >> (stage.as(:typed_stage) >> space).maybe >>
141
+ (str("Add") | str("ADD")).as(:type)) |
142
+ (str(" — ") >> str("Addendum").as(:type))) |
134
143
  (str("/") >> staged_addenda.as(:typed_stage))) >>
135
144
  space >> digits.as(:number) >> (str(":") >> digits.as(:year)).maybe
136
145
  ).repeat(1).as(:supplements)
@@ -188,8 +197,11 @@ module Pubid::Iso
188
197
 
189
198
  rule(:std_document_body) do
190
199
  (type | (stage.as(:stage) >> digits.as(:iteration).maybe)).maybe >>
191
- # for ISO/IEC WD TS 25025
192
- space? >> ((stage.as(:stage) | typed_stage.as(:stage) | type) >> space).maybe >>
200
+ # for ISO/IEC WD TS 25025 and ISO/IEC DIS ISP 12060-6 — both shapes
201
+ # `<stage> <type>` and `<typed_stage> <type>` need to fit before the
202
+ # number, so allow an optional stage/typed_stage followed by an
203
+ # optional type.
204
+ space? >> (((stage.as(:stage) | typed_stage.as(:stage)) >> space).maybe >> (type >> space).maybe) >>
193
205
  digits.as(:number) >>
194
206
  # for identifiers like ISO 5537/IDF 26
195
207
  (str("|") >> (str("IDF").as(:publisher) >> space >> digits.as(:number)).as(:joint_document)).maybe >>
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Iso
3
- VERSION = "1.15.17".freeze
3
+ VERSION = "1.15.18".freeze
4
4
  end
5
5
  end
data/update_codes.yaml CHANGED
@@ -2,3 +2,24 @@ ISO/R 657/IV: ISO/R 657-4:1969
2
2
  ISO/IEC/IEEE 8802-22.2:2015/Amd.2:2017(E): ISO/IEC/IEEE 8802-22:2015/Amd.2:2017(E)
3
3
  ISO/TR 17716.2: ISO/TR 17716
4
4
  ISO/TR 17716.2(E): ISO/TR 17716(E)
5
+ ISO/NP 10303-5a: ISO/NP 10303-5A
6
+ ISO/NP 10303-5b: ISO/NP 10303-5B
7
+ ISO/NP 10303-1xx: ISO/NP 10303-1XX
8
+ ISO/NP 10303-2xx: ISO/NP 10303-2XX
9
+ # Long-form draft typed stages (DIS TR, FDIS PAS, ...) → canonical short
10
+ # typed-stage abbrs (DTR, FDPAS, ...). Pattern matches at start of string
11
+ # with the publisher prefix preserved.
12
+ "/^(ISO[\\w/]*) DIS (TR|TS|PAS|ISP) /": '\1 D\2 '
13
+ "/^(ISO[\\w/]*) FDIS (TR|TS|PAS|ISP) /": '\1 FD\2 '
14
+ # Long-form draft supplements (DIS Amd → DAM, DIS Cor → DCOR, DIS Suppl →
15
+ # DSuppl, DIS Add → DAD; FDIS Amd → FDAM, FDIS Cor → FDCOR). Applies in
16
+ # supplement position (after `/`), so the prefix has already been parsed.
17
+ "//DIS Amd /": '/DAM '
18
+ "//FDIS Amd /": '/FDAM '
19
+ "//DIS Cor /": '/DCOR '
20
+ "//FDIS Cor /": '/FDCOR '
21
+ "//DIS Suppl /": '/DSuppl '
22
+ "//DIS Add /": '/DAD '
23
+ # `DAdd` is a legacy long-form spelling of the canonical `DAD` (Draft
24
+ # Addendum) staged-addendum token.
25
+ "//DAdd /": '/DAD '
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.17
4
+ version: 1.15.18
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-05-01 00:00:00.000000000 Z
11
+ date: 2026-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.15.17
33
+ version: 1.15.18
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.15.17
40
+ version: 1.15.18
41
41
  description: Library to generate, parse and manipulate ISO PubID.
42
42
  email:
43
43
  - open.source@ribose.com