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 +4 -4
- data/lib/pubid/ieee/builder.rb +27 -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: c1e4c5a6889f61e535b4d05517aff5798eb5307c79bf7e318ab21822ebfe73ae
|
|
4
|
+
data.tar.gz: f129c70c4c9c646318c58e12d7a5e1097299c5698a083a0710e2866a2e7ad692
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2e7e5cea5f0749a2aa5715521a2d6c192b43395bcb9f72470207629f6e7d1f0b9a7dbb089a1cc8e23c41a6ffc61a1e1424ce2546618249ed3eb074d611b3e4f
|
|
7
|
+
data.tar.gz: c4ee9f3166fa9caffb6f3b85d4684c11b6f08ac615ecf302af94831a9e7538a29264c2a862ffefa161fbeb4dbabc11b82405730c2435d5d666ab42c257fe2a61
|
data/lib/pubid/ieee/builder.rb
CHANGED
|
@@ -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" &&
|
|
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
|
|
1811
|
-
# lookup above and must fall through,
|
|
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