pubid 2.0.18 → 2.0.19
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/lib/pubid/components/typed_stage.rb +7 -6
- data/lib/pubid/iso/CLAUDE.md +15 -0
- data/lib/pubid/subset_match.rb +1 -3
- data/lib/pubid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d2bbeed2065311312a5f62f6315be2f0d29cf03245755bf5a95b741567e08a96
|
|
4
|
+
data.tar.gz: cd32eefaf7a17f10fae7b4a78055e3f241758e544848d4b1dac239a0d1ff30c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b543322085f97459a47b0ccd67541b9ae9106695e4779e4e385294460aa9c702f5247623d19762ee33c37810031c3d97e030d5d67e5859fde2e932b18f0e140
|
|
7
|
+
data.tar.gz: e147a8e6484951b7a31db7f013942aae7ebad11fe63b321c325fe71d72025e27415dce3cbcfa85f4159f6d2cedf2369da1a77dbce80702708333b7a4c2f62a0a
|
|
@@ -8,12 +8,7 @@ module Pubid
|
|
|
8
8
|
# URN render: stage code (RFC 5141-bis: stage-XX.XX format handled by urn_generator).
|
|
9
9
|
class TypedStage < Lutaml::Model::Serializable
|
|
10
10
|
include ::Pubid::SubsetMatch
|
|
11
|
-
|
|
12
|
-
# `original_abbr` records the input spelling ("Amd" or "AMD"), not the
|
|
13
|
-
# stage, so a subset match skips it.
|
|
14
|
-
def self.subset_ignored_attributes
|
|
15
|
-
%i[original_abbr]
|
|
16
|
-
end
|
|
11
|
+
include ::Pubid::EqualityIgnored
|
|
17
12
|
|
|
18
13
|
attribute :name, :string
|
|
19
14
|
attribute :code, :string
|
|
@@ -25,6 +20,12 @@ module Pubid
|
|
|
25
20
|
attribute :short_abbr, :string
|
|
26
21
|
attribute :long_abbr, :string
|
|
27
22
|
|
|
23
|
+
# `original_abbr` records the input spelling ("Amd.", "AMD", "DAmd"),
|
|
24
|
+
# not the stage, so `==`, `hash` and `===` skip it (issue #656). It is
|
|
25
|
+
# not serialized: the parse path keeps the input spelling and
|
|
26
|
+
# `from_hash` rebuilds the canonical one, and the two ids must be ==.
|
|
27
|
+
equality_ignored :original_abbr
|
|
28
|
+
|
|
28
29
|
def to_stage
|
|
29
30
|
Stage.new(
|
|
30
31
|
name: name,
|
data/lib/pubid/iso/CLAUDE.md
CHANGED
|
@@ -143,3 +143,18 @@
|
|
|
143
143
|
(`data/parg/iso.parg`) must move together — the twin is the embedded
|
|
144
144
|
source's provenance copy.
|
|
145
145
|
|
|
146
|
+
- **`typed_stage.original_abbr` is spelling, so `==` skips it (issue #656).**
|
|
147
|
+
The parse path stores the input token (`Amd.`, `COR`, `DAmd`, `pDCOR`) and
|
|
148
|
+
`stage_from_kv` stores the canonical one (`Amd`, `Cor`, `DAM`); the value is
|
|
149
|
+
not serialized. Before the fix, 90 pass ids (supplements, Directives,
|
|
150
|
+
Guides, `ISO/NWIP`) were not `==` after `from_hash(to_hash)`, so
|
|
151
|
+
`#matches?` against an index row returned false with no error. ISO cannot
|
|
152
|
+
delete the write as JCGM and IEC did, because `detect_stage_format_long`
|
|
153
|
+
reads it. `Components::TypedStage` now declares
|
|
154
|
+
`equality_ignored :original_abbr`. Since `to_s` reads the value, two `==`
|
|
155
|
+
ids may render differently, which the #656 rule allows. Locked by
|
|
156
|
+
`spec/pubid/iso/typed_stage_round_trip_spec.rb`.
|
|
157
|
+
**Still open, and not covered by that spec**: 14 pass ids stay unequal for
|
|
158
|
+
another reason — `DirectivesSupplement#supplement_publisher` is an
|
|
159
|
+
`Iso::Components::Publisher` after `parse` and a `Pubid::Components::Publisher`
|
|
160
|
+
after `from_hash` (11 supplements, 3 bundles).
|
data/lib/pubid/subset_match.rb
CHANGED
|
@@ -169,9 +169,7 @@ module Pubid
|
|
|
169
169
|
# Exactness composes rather than flattening: a nested value that
|
|
170
170
|
# includes this module is matched in BOTH directions with its own
|
|
171
171
|
# `===`, so the class that owns it keeps its rule. A plain `==` would
|
|
172
|
-
# override it —
|
|
173
|
-
# (the input spelling, `Amd` against `AMD`), and CEN/CENELEC declares
|
|
174
|
-
# `typed_stage` strict.
|
|
172
|
+
# override it — CEN/CENELEC declares `typed_stage` strict.
|
|
175
173
|
# @return [Boolean]
|
|
176
174
|
def self.exact_match?(mine, theirs)
|
|
177
175
|
return true if blank?(mine) && blank?(theirs)
|
data/lib/pubid/version.rb
CHANGED