pubid 2.0.0.pre.alpha.60 → 2.0.0.pre.alpha.62

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: 5eca3717e04c846ae3c29745d1b0fdb93f99e329d5894d30a5505c19d164623f
4
- data.tar.gz: 7da82d26c66ffa02b2ba7036dbba361f5b43eabc7e3cb4d1920cb1773076641c
3
+ metadata.gz: e7afdb690b76d32cc60abd371dd8936f0e79054e472150a6ec05f6fea1931fd7
4
+ data.tar.gz: 458c87cedd25491b9022e1053d72a799ec108bf9721d4103df44965b526855f7
5
5
  SHA512:
6
- metadata.gz: 77f1e4684926e5e1adf6ff8f50c87302899f4524f07f2ff260c51c8b953345548226c5e4f824828b87b702d6a8fed505eba933d23a7837c1be893d7dbfa97091
7
- data.tar.gz: d36b84762ae0d69fbe2ec11fc60e964748c76304a6ea34bd84857a311d279653e0ca2ba2ce771faf7fd4774636a5a610098642949fe823b74d6eb8981a4f5e00
6
+ metadata.gz: 8d0e50ff1df89fe98825e6427d0a4a0be18d8b74c7ddd396499fcd927f96ecb67c5b6cf4503b0b95ad7ef87f8d6a5463e8793140b4185c9aeb0f4cb5b5aa3244
7
+ data.tar.gz: 774ed8600701853d1fcd875fe589eee063b31ff8b319e0b1ce90d1e42ac8bcc20d18259c1602f9c8fa7c16aeb9bcd1246d151ce1c3086b656e8ff48755c488cf
@@ -1349,10 +1349,25 @@ module Pubid
1349
1349
  end
1350
1350
  end
1351
1351
 
1352
+ # Self is a wrapped record of exactly the edition +other+ names: the
1353
+ # wrapped document resolves to that edition (pubid#580 — a dated
1354
+ # base query must reach the wrapped record of that edition, whose
1355
+ # identity is one level down). Only wrappers answer true: a bare
1356
+ # record is its own edition and is matched directly by ===. The
1357
+ # resolution is exact — the wrapped base must equal the edition the
1358
+ # query names, no wildcards.
1359
+ def wrapped_edition_of?(other)
1360
+ return false unless other.is_a?(::Pubid::Identifier)
1361
+ return false unless wrapped_document
1362
+
1363
+ base_document == other
1364
+ end
1365
+
1352
1366
  # Any relational predicate holds.
1353
1367
  def related_to?(other)
1354
1368
  %i[supplement_of? has_supplement? dated_version_of? edition_of?
1355
- revision_of? sibling_of? includes? draft_of?].any? do |m|
1369
+ revision_of? sibling_of? includes? draft_of?
1370
+ wrapped_edition_of?].any? do |m|
1356
1371
  public_send(m, other)
1357
1372
  end
1358
1373
  end
@@ -70,6 +70,13 @@ module Pubid
70
70
  def typed_stage
71
71
  base&.typed_stage
72
72
  end
73
+
74
+ # The wrapped document the VAP record is a view of (pubid#580):
75
+ # the peel lets a dated base query resolve the edition through
76
+ # the wrapper's relational predicates.
77
+ def base_document
78
+ base&.base_document || base
79
+ end
73
80
  end
74
81
  end
75
82
  end
@@ -1349,6 +1349,26 @@ module Pubid
1349
1349
  Regexp.last_match(0)
1350
1350
  end
1351
1351
  end
1352
+ # The crawl glues the month onto the stage after the code's slash
1353
+ # ("IEEE/IEC/ISO P80005-1/FDIS_March 2012", and its canonical
1354
+ # comma form "… Draft P80005-1/FDIS_March, 2012"): the stage is
1355
+ # the ISO/IEC token and the month belongs to the date (the
1356
+ # 2026-10-25 ruling) — decode onto the D= designator face. Scoped
1357
+ # to a real month name glued to a stage token; stage iteration
1358
+ # ("_CDV/V3", "_CDV July 2015") has its own routes.
1359
+ cleaned = cleaned.gsub(
1360
+ %r{\A((?:IEEE|ISO|IEC)(?:/(?:IEEE|ISO|IEC))*\s+(?:Draft\s+)?P?[A-Z0-9][A-Z0-9.-]*/)(FDIS|FCD|CDV|DIS|CD|WD|PWI|NP)_([A-Za-z]+),?\s+(\d{4})\z}
1361
+ ) do
1362
+ month = ::Pubid::Ieee::Builder::REV_MONTH_NUMBERS[
1363
+ Regexp.last_match(3).capitalize
1364
+ ]
1365
+ if month
1366
+ "#{Regexp.last_match(1)}D=#{Regexp.last_match(2)}-" \
1367
+ "#{Regexp.last_match(4)}#{month}"
1368
+ else
1369
+ Regexp.last_match(0)
1370
+ end
1371
+ end
1352
1372
  # The lettered REV spellings glue to the number ("P1310Rev3",
1353
1373
  # "P1722Rev1") or carry an after-word separator ("REV.ma",
1354
1374
  # "REV-ma"); the rev rules read a space or a bare word
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.60"
4
+ VERSION = "2.0.0.pre.alpha.62"
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.0.pre.alpha.60
4
+ version: 2.0.0.pre.alpha.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.