pubid 2.0.0.pre.alpha.53 → 2.0.0.pre.alpha.55

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.
@@ -1118,9 +1118,14 @@ module Pubid
1118
1118
  printed_attrs[:year] = attributes[:year]
1119
1119
  printed_attrs[:month] = attributes[:month]
1120
1120
  elsif parsed[:draft_month]
1121
- # The date trails the draft itself ("D8, June 2010"); keep it
1122
- # inside the draft so the code stays date-less.
1123
- printed_draft = "#{printed_draft}, #{extract_value(parsed[:draft_month])} " "#{extract_value(parsed[:draft_year])}"
1121
+ # The date trails the draft itself ("D31, Aug 2010"): the
1122
+ # normalization ledger strips the ordinal draft on the
1123
+ # printed joint face and surfaces the date as the printed
1124
+ # date ("11073-10418 D13, January 2011" ->
1125
+ # "11073.10418, January 2011") -- composing it back into the
1126
+ # draft emitted "/D, Aug 2010" remnants.
1127
+ printed_attrs[:year] = extract_value(parsed[:draft_year])
1128
+ printed_attrs[:month] = extract_value(parsed[:draft_month])
1124
1129
  end
1125
1130
  printed_attrs[:code] = printed_code
1126
1131
  printed_attrs[:draft] = printed_draft if printed_draft
@@ -98,18 +98,33 @@ day: nil, iso_stage: nil, iso_iteration: nil)
98
98
  COMPOUND_SUFFIX = /=D?(PWI|NP|WD|CDV|FDIS|DIS|CD)(?:[.-]?(\d+))?\z/.freeze
99
99
  private_constant :COMPOUND_SUFFIX
100
100
 
101
+ # The D-echo aliases ("DDIS3" = D + DIS + iteration 3) normalize
102
+ # through the compound split; every other pure stage token
103
+ # ("CD1", "FCD", "CDV1") restores verbatim -- the compound split
104
+ # would degrade the glued iterations and drop the stages the
105
+ # alias list never knew, so from_hash(row) != parse(row).
106
+ ECHO_SUFFIX = /\AD(=?(PWI|NP|WD|CDV|FDIS|DIS|CD|FCD))(?:[.-]?\d+)?\z/.freeze
107
+ private_constant :ECHO_SUFFIX
108
+
101
109
  def self.parse(value)
102
110
  return value if value.is_a?(Draft)
103
111
 
104
112
  body = strip_prefix(value.to_s)
105
113
  iso_stage = nil
106
114
  iso_iteration = nil
107
- if (m = body.match(COMPOUND_SUFFIX))
115
+ if body.start_with?("=") && body[1..].match?(/\A[A-Z][A-Z0-9]*\z/) &&
116
+ !body[1..].match?(ECHO_SUFFIX)
117
+ iso_stage = body[1..]
118
+ body = ""
119
+ elsif (m = body.match(COMPOUND_SUFFIX))
108
120
  iso_stage = m[1]
109
121
  iso_iteration = m[2]
110
122
  body = body[0...m.begin(0)]
111
123
  end
112
- version, month, day, year, comma = split_date(body)
124
+ # a designator that consumed the whole body carries no date;
125
+ # split_date("") would leave version as "" where the parse
126
+ # path has nil (and != compares them)
127
+ version, month, day, year, comma = body.empty? ? [nil, nil, nil, nil, false] : split_date(body)
113
128
  draft = new(version: version, month: month, day: day, year: year,
114
129
  iso_stage: iso_stage, iso_iteration: iso_iteration)
115
130
  draft.comma_before_month = comma
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.0.pre.alpha.53"
4
+ VERSION = "2.0.0.pre.alpha.55"
5
5
  end
@@ -9,12 +9,16 @@ joint_prefixes:
9
9
  - ISO/IEC
10
10
  - IEC/ISO
11
11
  - ISO/IEC/IEEE
12
+ - ISO/IEEE
12
13
  iec:
13
14
  - ISO/IEC
14
15
  - IEC/ISO
15
16
  - ISO/IEC/IEEE
17
+ - IEC/IEEE
16
18
  ieee:
17
19
  - ISO/IEC/IEEE
20
+ - ISO/IEEE
21
+ - IEC/IEEE
18
22
  ansi:
19
23
  - ANSI/ASHRAE
20
24
  - ANSI/AMCA
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.53
4
+ version: 2.0.0.pre.alpha.55
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-23 00:00:00.000000000 Z
11
+ date: 2026-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model