pubid 2.0.0.pre.alpha.45 → 2.0.0.pre.alpha.46
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e59d6b8d85efbedab5ee3e65fb772d579e53b08df3a5b1fcea783c9e70c005e
|
|
4
|
+
data.tar.gz: 8a757f8f946b2998e984ed915bd60896c14a93f4bbce4368810faef5f70b13e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c03453929b1941309d16b6b87c8bee8dc54594c80a42336b1af5a986197ec6a5ab253451fed9198a67d00337149577d6cae57ed9e727f6a0a22fc26ac42480e
|
|
7
|
+
data.tar.gz: ae7af0fd7a05bb2879d50107ee5d3c1f617e26d2758f0a9a75f28b9ccb124cb914478fe88ec2a3ec64018ab7f8fc391b24e39ab2bfa5905c80fc4e965e6b7d4a
|
data/lib/pubid/cen_cenelec.rb
CHANGED
|
@@ -195,7 +195,21 @@ module Pubid
|
|
|
195
195
|
# @return [Pubid::Components::TypedStage, nil] the matching typed stage
|
|
196
196
|
def self.locate_stage(abbr)
|
|
197
197
|
abbr_str = abbr.to_s.upcase
|
|
198
|
-
all_typed_stages.find { |s| s.abbr.any? { |a| a.to_s.upcase == abbr_str } }
|
|
198
|
+
all_typed_stages.find { |s| s.abbr.any? { |a| a.to_s.upcase == abbr_str } } ||
|
|
199
|
+
# A harmonized stage code ("43.20") names the stage the same way an
|
|
200
|
+
# abbreviation does; consumers query by it (pubid#251), so an
|
|
201
|
+
# unmatched abbreviation falls through to the code tables.
|
|
202
|
+
locate_stage_by_harmonized_code(abbr)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Lookup: harmonized stage code -> typed stage ("43.20" -> the FV EN
|
|
206
|
+
# entry). The codes are the CEN/CENELEC lifecycle ladder; every code a
|
|
207
|
+
# consumer can query must resolve (pubid#251).
|
|
208
|
+
# @param code [String, Symbol] the harmonized stage code to find
|
|
209
|
+
# @return [Pubid::Components::TypedStage, nil] the matching typed stage
|
|
210
|
+
def self.locate_stage_by_harmonized_code(code)
|
|
211
|
+
code_str = code.to_s
|
|
212
|
+
all_typed_stages.find { |s| s.harmonized_stages.to_a.include?(code_str) }
|
|
199
213
|
end
|
|
200
214
|
|
|
201
215
|
# Lookup: typed-stage code -> typed stage ("pren" -> the prEN entry).
|
data/lib/pubid/iso/urn_parser.rb
CHANGED
|
@@ -142,16 +142,31 @@ module Pubid
|
|
|
142
142
|
elsif TYPED_STAGE_REVERSE_MAP.key?(parts.first&.upcase) ||
|
|
143
143
|
(parts.first&.match?(/^[A-Za-z]+\.\d+$/) &&
|
|
144
144
|
TYPED_STAGE_REVERSE_MAP.key?(parts.first.upcase.split(".").first))
|
|
145
|
-
stage_abbr = parts.
|
|
146
|
-
#
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
stage_abbr = parts.first.upcase
|
|
146
|
+
# The family comes from the abbreviation without its iteration
|
|
147
|
+
# ("FDAM.3" is still the amd family).
|
|
148
|
+
family = Pubid::Iso.locate_stage(stage_abbr.split(".").first)&.type_code&.to_s
|
|
149
|
+
# A supplement-family stage directly before its own supplement
|
|
150
|
+
# type token ("...:FDAM:amd:1:v1") names the SUPPLEMENT's stage:
|
|
151
|
+
# consuming it as the base's stage builds the base as a base-less
|
|
152
|
+
# supplement, which cannot render.
|
|
153
|
+
supplement_follows =
|
|
154
|
+
%w[amd cor suppl add].include?(family) &&
|
|
155
|
+
parts.drop(1).any? do |token|
|
|
156
|
+
family == SUPPLEMENT_TYPE_MAP[token.to_s.downcase]&.to_s
|
|
157
|
+
end
|
|
158
|
+
unless supplement_follows
|
|
159
|
+
parts.shift
|
|
160
|
+
# Check for iteration (WD.2 format)
|
|
161
|
+
if stage_abbr.include?(".")
|
|
162
|
+
abbr_part, iteration_part = stage_abbr.split(".")
|
|
163
|
+
stage_code = TYPED_STAGE_REVERSE_MAP[abbr_part]
|
|
164
|
+
stage_from_abbr = stage_code
|
|
165
|
+
stage_iteration = iteration_part.to_i
|
|
166
|
+
else
|
|
167
|
+
stage_code = TYPED_STAGE_REVERSE_MAP[stage_abbr]
|
|
168
|
+
stage_from_abbr = stage_code
|
|
169
|
+
end
|
|
155
170
|
end
|
|
156
171
|
end
|
|
157
172
|
|
|
@@ -397,6 +412,16 @@ module Pubid
|
|
|
397
412
|
# Build supplements recursively (forward order: first supplement wraps base,
|
|
398
413
|
# second wraps first, etc. -- matching URN left-to-right semantics)
|
|
399
414
|
supplements.each do |supp|
|
|
415
|
+
# A bare language token with no supplement identity names the BASE
|
|
416
|
+
# document: wrapping it would build a supplement with no type,
|
|
417
|
+
# number or base attribute, and a plain standard drops its base —
|
|
418
|
+
# the whole document was lost, rendering "ISO (FR)".
|
|
419
|
+
if supp[:type].nil? && supp[:stage].nil? && supp[:number].nil? &&
|
|
420
|
+
supp[:year].nil? && supp[:languages]
|
|
421
|
+
base_hash[:languages] = supp[:languages].join("/")
|
|
422
|
+
next
|
|
423
|
+
end
|
|
424
|
+
|
|
400
425
|
supp_hash = {}
|
|
401
426
|
|
|
402
427
|
if supp[:stage]
|
data/lib/pubid/nist/CLAUDE.md
CHANGED
|
@@ -72,3 +72,11 @@ Read this before you change `lib/pubid/nist/` or `spec/pubid/nist/`. The root
|
|
|
72
72
|
(`"800-38.A.supp.add."` splits with a trailing `""` in JS but not in
|
|
73
73
|
Ruby; keeping it appends a stray `.`). Locked by
|
|
74
74
|
`spec/pubid/nist/urn_parser_spec.rb`.
|
|
75
|
+
|
|
76
|
+
- **FIPS MR keeps the parsed publisher.** `FederalInformationProcessingStandards`
|
|
77
|
+
sets `default_publisher` to `""`, and its `to_mr_style` once started from
|
|
78
|
+
`series_code` alone, so `NIST.FIPS.197-upd1.ipd` rendered `FIPS.197-upd1.ipd`
|
|
79
|
+
— not the DOI suffix NIST publishes. It now mirrors its own
|
|
80
|
+
`to_short_style`: the publisher prefixes only when the input carried one
|
|
81
|
+
(`NIST.`/`NBS.`), and a bare `FIPS 140-3` still renders `FIPS.140-3`.
|
|
82
|
+
Locked by `spec/pubid/nist/identifiers/fips_spec.rb`.
|
|
@@ -37,11 +37,12 @@ module Pubid
|
|
|
37
37
|
""
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
# Override to_mr_style
|
|
40
|
+
# Override to_mr_style so FIPS adds no default "NIST" prefix
|
|
41
41
|
def to_mr_style
|
|
42
|
-
# "FIPS.
|
|
42
|
+
# "NIST.FIPS.197" keeps a parsed publisher (the DOI suffix NIST
|
|
43
|
+
# publishes); "FIPS.46e1977" has none and invents none.
|
|
43
44
|
# Note: edition is appended directly to number without dot for FIPS
|
|
44
|
-
result = series_code
|
|
45
|
+
result = [publisher, series_code].compact.join(".")
|
|
45
46
|
result += ".#{number}" if number
|
|
46
47
|
|
|
47
48
|
# FIPS uses dash notation for parts; render here and skip the generic
|
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.46
|
|
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-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|