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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 185124a260b71738ef7c333b0f9ceb23f867cd3886cece12810ed6420aff7a46
4
- data.tar.gz: '081f7312e5c76b76bdd7fc8c61d4a7e5c70c1de4a70f2491c69227f1fa7b8f70'
3
+ metadata.gz: d2bbeed2065311312a5f62f6315be2f0d29cf03245755bf5a95b741567e08a96
4
+ data.tar.gz: cd32eefaf7a17f10fae7b4a78055e3f241758e544848d4b1dac239a0d1ff30c1
5
5
  SHA512:
6
- metadata.gz: 07d685cf60518b38c66d21e65186aa942df8a279536ddf1907edd4bb5fb0eb2b52eb9de627c44994aee7a520d51aeedf05de9f917992c194cfc829883eef587d
7
- data.tar.gz: 9c153f3a31750860224084b31802eb65654af9948b9688b5493ca51cb946a18da5601710d3c74b18c7250d1edba33d855020bead796558c087a772ba16a99174
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,
@@ -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).
@@ -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 — `Components::TypedStage` ignores `original_abbr`
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.18"
4
+ VERSION = "2.0.19"
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.18
4
+ version: 2.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.