pubid 2.0.0.pre.alpha.39 → 2.0.0.pre.alpha.40

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: e53b03c87c2a04f877d8eba11d5689984de9c0af641258c68c8c03377d762f12
4
- data.tar.gz: 5bdad1686cf8cd3709ea1494eef8c78dd7c6974bae2802ccc669db939f788731
3
+ metadata.gz: c1e4c5a6889f61e535b4d05517aff5798eb5307c79bf7e318ab21822ebfe73ae
4
+ data.tar.gz: f129c70c4c9c646318c58e12d7a5e1097299c5698a083a0710e2866a2e7ad692
5
5
  SHA512:
6
- metadata.gz: 822faa7030a35d1e87901785b0d22bb0716c1b997985c6b9d616c1eb75f3e7fe3436ca61c427c4d8abd44d14fe2e173b7a8c5ab3bc26941bb68e75f308862965
7
- data.tar.gz: e636567ecb22497f4cf0c0cafdfe68d06f83e593bc15483c168cbc25053a61221d6738ac16730f2bbe0e05c88ce6d91bb3166da7386ac1ca4004363fea390a5a
6
+ metadata.gz: d2e7e5cea5f0749a2aa5715521a2d6c192b43395bcb9f72470207629f6e7d1f0b9a7dbb089a1cc8e23c41a6ffc61a1e1424ce2546618249ed3eb074d611b3e4f
7
+ data.tar.gz: c4ee9f3166fa9caffb6f3b85d4684c11b6f08ac615ecf302af94831a9e7538a29264c2a862ffefa161fbeb4dbabc11b82405730c2435d5d666ab42c257fe2a61
@@ -1762,6 +1762,7 @@ module Pubid
1762
1762
  end
1763
1763
 
1764
1764
  # Check for specific draft notation (D1, D2, etc.)
1765
+ draft_version_present = false
1765
1766
  if parsed[:draft]
1766
1767
  draft_data = parsed[:draft]
1767
1768
  if draft_data.is_a?(Array)
@@ -1769,8 +1770,12 @@ module Pubid
1769
1770
  r.merge(e)
1770
1771
  end
1771
1772
  end
1773
+ # A verbatim draft designator ("/D2.1.1") is a version in itself;
1774
+ # only an attribute-less date hash ("{month:, year:}") lacks one.
1775
+ draft_version_present = true unless draft_data.is_a?(Hash)
1772
1776
 
1773
1777
  if draft_data.is_a?(Hash) && draft_data[:draft_version]
1778
+ draft_version_present = true
1774
1779
  dv = draft_data[:draft_version]
1775
1780
  version = if dv.is_a?(Array)
1776
1781
  dv.map do |v|
@@ -1781,6 +1786,21 @@ module Pubid
1781
1786
  end
1782
1787
 
1783
1788
  if version
1789
+ # A draft version that IS an ISO stage token ("/DCD1" and
1790
+ # "/CD1" both capture version "CD1") takes that stage on a
1791
+ # PLAIN IEEE document: the stage token outranks the ordinal
1792
+ # ladder (docs/IEEE-DRAFT-STAGES.md §1.3, "DDIS" = DIS), so
1793
+ # the render drops the Draft word. A joint ISO-led
1794
+ # stage-word draft keeps its generic project stage — its
1795
+ # publishers block composes the same face through the
1796
+ # typed-stage project branch.
1797
+ copubs = parsed[:publishers].is_a?(Hash) ? parsed[:publishers][:copublishers] : nil
1798
+ joint = copubs && !(copubs.respond_to?(:empty?) ? copubs.empty? : copubs.nil?)
1799
+ if !joint &&
1800
+ (m = version.to_s.match(/\A(FDIS|FCD|CDV|DIS|CD|WD|PWI|NP)\d*\z/))
1801
+ return m[1]
1802
+ end
1803
+
1784
1804
  # relaton's hyphenated "/D-2" spelling captures the dash inside
1785
1805
  # draft_version; the stage registry keys on "D2". A date-embedded
1786
1806
  # version ("3-2017-07") keys on its leading ordinal.
@@ -1802,13 +1822,17 @@ module Pubid
1802
1822
  return "P"
1803
1823
  elsif type_value == "Std"
1804
1824
  return "Std"
1805
- elsif type_value == "Draft Std" && parsed[:draft].nil? && parsed[:digit_draft].nil?
1825
+ elsif type_value == "Draft Std" && !draft_version_present && parsed[:digit_draft].nil?
1806
1826
  # A version-less "Draft Std" fabricates /D1 (issue #205);
1807
1827
  # deriving the stage from that fabricated version renders the
1808
1828
  # same P-prefixed form as an explicit "/D1" spelling, so the
1809
1829
  # render reaches its fixed point in one round (pubid#318).
1810
- # Gated on no-draft: a dotted version ("D2.0") fails the registry
1811
- # lookup above and must fall through, keeping "Draft Std".
1830
+ # Gated on no captured VERSION: a dotted version ("D2.0")
1831
+ # fails the registry lookup above and must fall through,
1832
+ # keeping "Draft Std". A draft-version-less tree that carries
1833
+ # only a date ("IEEE Draft Std P754/D1.2.6 Nov 2006") takes
1834
+ # the same fabricated D1, the version the render already
1835
+ # implies.
1812
1836
  return "D1"
1813
1837
  elsif type_value.match?(/^No\.?$/)
1814
1838
  return type_value
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.39"
4
+ VERSION = "2.0.0.pre.alpha.40"
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.39
4
+ version: 2.0.0.pre.alpha.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.