metanorma-standoc 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/standoc/cleanup_ref.rb +5 -5
- data/lib/asciidoctor/standoc/ref.rb +8 -3
- data/lib/asciidoctor/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +3 -3
- data/spec/asciidoctor-standoc/cleanup_spec.rb +6 -6
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +39 -39
- data/spec/asciidoctor-standoc/refs_spec.rb +5 -5
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1453d5a4693d43ed4e32a5a97d1ac72760b055c961bf9977d50f6732ffcd6b7
|
4
|
+
data.tar.gz: ad33298dc46235a94b759bbdd07124f30f1f0b7a233a5e0e8675c3fa8b73f725
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786e9ede1e35e90a2d523c17dcb623b35d9a6039e20c2808cb176bf0a54f2cfa2e83026514f672bccb9771ab863214d9a6ed4275f6b388ac9d1f31ae26f85d49
|
7
|
+
data.tar.gz: 2ffc403caa148b2b2248bf33bbb12284dd7331781abc173a8e858b66a8a1a212e6f23e68b7c9156ccdbab0432387400f42191c0369c070d6b4f463efbfc028e9
|
@@ -116,11 +116,11 @@ module Asciidoctor
|
|
116
116
|
xmldoc.xpath("//bibitem[not(ancestor::bibitem)]").each do |ref|
|
117
117
|
isopub = ref.at(ISO_PUBLISHER_XPATH)
|
118
118
|
docid = ref.at("./docidentifier[not(@type = 'DOI')]")
|
119
|
-
date = ref.at("./date[@type = 'published']")
|
120
|
-
allparts = ref.at("./allparts")
|
119
|
+
#date = ref.at("./date[@type = 'published']")
|
120
|
+
#allparts = ref.at("./allparts")
|
121
121
|
reference = format_ref(docid.text, isopub)
|
122
|
-
reference += ":#{date_range(date)}" if date
|
123
|
-
reference += " (all parts)" if allparts
|
122
|
+
#reference += ":#{date_range(date)}" if date
|
123
|
+
#reference += " (all parts)" if allparts
|
124
124
|
@anchors[ref["id"]] = { xref: reference }
|
125
125
|
end
|
126
126
|
end
|
@@ -155,7 +155,7 @@ module Asciidoctor
|
|
155
155
|
|
156
156
|
# call after xref_cleanup and origin_cleanup
|
157
157
|
def iev_cleanup(xmldoc)
|
158
|
-
iev = xmldoc.at("//bibitem[docidentifier = 'IEC 60050']") || return
|
158
|
+
iev = xmldoc.at("//bibitem[docidentifier = 'IEC 60050:2011']") || return
|
159
159
|
parts = linksIev2iec60050part(xmldoc)
|
160
160
|
refsIev2iec60050part(parts, iev)
|
161
161
|
end
|
@@ -38,12 +38,17 @@ module Asciidoctor
|
|
38
38
|
ref
|
39
39
|
end
|
40
40
|
|
41
|
+
def id_and_year(id, year)
|
42
|
+
return id unless year
|
43
|
+
"#{id}:#{year}"
|
44
|
+
end
|
45
|
+
|
41
46
|
def isorefmatches(xml, m)
|
42
47
|
ref = fetch_ref xml, m[:code], m[:year]
|
43
48
|
return use_my_anchor(ref, m[:anchor]) if ref
|
44
49
|
xml.bibitem **attr_code(ref_attributes(m)) do |t|
|
45
50
|
t.title(**plaintxt) { |i| i << ref_normalise(m[:text]) }
|
46
|
-
t.docidentifier m[:code]
|
51
|
+
t.docidentifier id_and_year(m[:code], m[:year])
|
47
52
|
m[:year] and t.date **{ type: "published" } do |d|
|
48
53
|
set_date_range(d, m[:year])
|
49
54
|
end
|
@@ -56,7 +61,7 @@ module Asciidoctor
|
|
56
61
|
return use_my_anchor(ref, m[:anchor]) if ref
|
57
62
|
xml.bibitem **attr_code(ref_attributes(m)) do |t|
|
58
63
|
t.title(**plaintxt) { |i| i << ref_normalise(m[:text]) }
|
59
|
-
t.docidentifier m[:code]
|
64
|
+
t.docidentifier id_and_year(m[:code], "--")
|
60
65
|
t.date **{ type: "published" } do |d|
|
61
66
|
d.on "--"
|
62
67
|
end
|
@@ -82,7 +87,7 @@ module Asciidoctor
|
|
82
87
|
return use_my_anchor(ref, m[:anchor]) if ref
|
83
88
|
xml.bibitem(**attr_code(ref_attributes(m))) do |t|
|
84
89
|
t.title(**plaintxt) { |i| i << ref_normalise(m[:text]) }
|
85
|
-
t.docidentifier
|
90
|
+
t.docidentifier(id_and_year(m[:code], m[:year]) + " (all parts)")
|
86
91
|
conditional_date(t, m, noyr)
|
87
92
|
iso_publisher(t, m[:code])
|
88
93
|
t.note(**plaintxt) { |p| p << "ISO DATE: #{m[:fn]}" } if m.names.include?("fn") && m[:fn]
|
data/metanorma-standoc.gemspec
CHANGED
@@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency "asciidoctor", "~> 1.5.7"
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
|
-
spec.add_dependency "isodoc", "~> 0.
|
31
|
+
spec.add_dependency "isodoc", "~> 0.9.0"
|
32
32
|
spec.add_dependency "iev", "~> 0.2.0"
|
33
|
-
spec.add_dependency "relaton", "~> 0.
|
33
|
+
spec.add_dependency "relaton", "~> 0.2.0"
|
34
34
|
|
35
35
|
spec.add_development_dependency "bundler", "~> 1.15"
|
36
36
|
spec.add_development_dependency "byebug"
|
@@ -43,5 +43,5 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
44
44
|
spec.add_development_dependency "timecop", "~> 0.9"
|
45
45
|
spec.add_development_dependency "metanorma", "~> 0.2.6"
|
46
|
-
spec.add_development_dependency "isobib", "~> 0.
|
46
|
+
spec.add_development_dependency "isobib", "~> 0.3.0"
|
47
47
|
end
|
@@ -189,7 +189,7 @@ r = 1 %</stem>
|
|
189
189
|
<title>Normative References</title>
|
190
190
|
<bibitem id="iso216" type="standard">
|
191
191
|
<title format="text/plain">Reference</title>
|
192
|
-
<docidentifier>ISO 216</docidentifier>
|
192
|
+
<docidentifier>ISO 216:2001</docidentifier>
|
193
193
|
<date type="published">
|
194
194
|
<on>2001</on>
|
195
195
|
</date>
|
@@ -652,7 +652,7 @@ r = 1 %</stem>
|
|
652
652
|
<title>Normative References</title>
|
653
653
|
<bibitem id="iso123" type="standard">
|
654
654
|
<title format="text/plain">Standard</title>
|
655
|
-
<docidentifier>ISO 123
|
655
|
+
<docidentifier>ISO 123:--</docidentifier>
|
656
656
|
<date type="published">
|
657
657
|
<on>--</on>
|
658
658
|
</date>
|
@@ -852,9 +852,9 @@ r = 1 %</stem>
|
|
852
852
|
</termsource>
|
853
853
|
</term></terms></sections><bibliography><references id="_" obligation="informative">
|
854
854
|
<title>Normative References</title>
|
855
|
-
<bibitem type="international-standard" id="IEC60050-102">
|
855
|
+
<bibitem type="international-standard" id="IEC60050-102-2011">
|
856
856
|
<title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
|
857
|
-
<docidentifier>IEC 60050-102</docidentifier>
|
857
|
+
<docidentifier>IEC 60050-102:2011</docidentifier>
|
858
858
|
<date type="published">
|
859
859
|
<on>2011</on>
|
860
860
|
</date>
|
@@ -882,9 +882,9 @@ r = 1 %</stem>
|
|
882
882
|
</organization>
|
883
883
|
</owner>
|
884
884
|
</copyright>
|
885
|
-
</bibitem><bibitem type="international-standard" id="IEC60050-103">
|
885
|
+
</bibitem><bibitem type="international-standard" id="IEC60050-103-2011">
|
886
886
|
<title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
|
887
|
-
<docidentifier>IEC 60050-103</docidentifier>
|
887
|
+
<docidentifier>IEC 60050-103:2011</docidentifier>
|
888
888
|
<date type="published">
|
889
889
|
<on>2011</on>
|
890
890
|
</date>
|
@@ -6,7 +6,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
6
6
|
ISO_123_SHORT = <<~EOS
|
7
7
|
<bibitem type="international-standard" id="ISO123">
|
8
8
|
<title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title>
|
9
|
-
<docidentifier>ISO 123</docidentifier>
|
9
|
+
<docidentifier type="ISO">ISO 123</docidentifier>
|
10
10
|
<contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor>
|
11
11
|
<status>Published</status>
|
12
12
|
</bibitem>
|
@@ -15,7 +15,7 @@ EOS
|
|
15
15
|
ISO_124_SHORT = <<~EOS
|
16
16
|
<bibitem type="international-standard" id="ISO124">
|
17
17
|
<title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content</title>
|
18
|
-
<docidentifier>ISO 124</docidentifier>
|
18
|
+
<docidentifier type="ISO">ISO 124</docidentifier>
|
19
19
|
<contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor>
|
20
20
|
<status>Published</status>
|
21
21
|
</bibitem>
|
@@ -24,23 +24,23 @@ EOS
|
|
24
24
|
ISO_124_SHORT_ALT = <<~EOS
|
25
25
|
<bibitem type="international-standard" id="ISO124">
|
26
26
|
<title format="text/plain" language="en" script="Latn">Latex, rubber -- Replacement</title>
|
27
|
-
<docidentifier>ISO 124</docidentifier>
|
27
|
+
<docidentifier type="ISO">ISO 124</docidentifier>
|
28
28
|
<contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor>
|
29
29
|
<status>Published</status>
|
30
30
|
</bibitem>
|
31
31
|
EOS
|
32
32
|
|
33
|
-
|
34
|
-
<bibitem type="international-standard" id="ISO123"> <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- ?chantillonnage</title> <uri type="src">https://www.iso.org/standard/23281.html</uri> <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri> <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri> <docidentifier>ISO 123</docidentifier> <date type="published"> <on>2001</on> </date> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>3</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status>Published</status> <copyright> <from>2001</from> <owner> <organization> <name>ISO</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem> <formattedref>ISO 123:1985</formattedref> </bibitem> </relation> <relation type="updates"> <bibitem> <formattedref>ISO 123:2001</formattedref> </bibitem> </relation></bibitem>
|
33
|
+
ISO_123_DATED = <<~EOS
|
34
|
+
<bibitem type="international-standard" id="ISO123-2001"> <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- ?chantillonnage</title> <uri type="src">https://www.iso.org/standard/23281.html</uri> <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri> <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri> <docidentifier type="ISO">ISO 123:2001</docidentifier> <date type="published"> <on>2001</on> </date> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>3</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status>Published</status> <copyright> <from>2001</from> <owner> <organization> <name>ISO</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem> <formattedref>ISO 123:1985</formattedref> </bibitem> </relation> <relation type="updates"> <bibitem> <formattedref>ISO 123:2001</formattedref> </bibitem> </relation></bibitem>
|
35
35
|
EOS
|
36
36
|
|
37
|
-
|
38
|
-
<bibitem type="international-standard" id="ISO123"> <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- ?chantillonnage</title> <uri type="src">https://www.iso.org/standard/23281.html</uri> <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri> <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri> <docidentifier>ISO 123</docidentifier> <date type="published"> <on>2001</on> </date> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>3</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status>Published</status> <copyright> <from>2001</from> <owner> <organization> <name>ISO</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem> <formattedref>ISO 123:1985</formattedref> </bibitem> </relation> <relation type="updates"> <bibitem> <formattedref>ISO 123:2001</formattedref> </bibitem> </relation></bibitem>
|
37
|
+
ISO_123_UNDATED = <<~EOS
|
38
|
+
<bibitem type="international-standard" id="ISO123"> <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- ?chantillonnage</title> <uri type="src">https://www.iso.org/standard/23281.html</uri> <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri> <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri> <docidentifier type="ISO">ISO 123</docidentifier> <date type="published"> <on>2001</on> </date> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>3</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status>Published</status> <copyright> <from>2001</from> <owner> <organization> <name>ISO</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem> <formattedref>ISO 123:1985</formattedref> </bibitem> </relation> <relation type="updates"> <bibitem> <formattedref>ISO 123:2001</formattedref> </bibitem> </relation></bibitem>
|
39
39
|
EOS
|
40
40
|
|
41
41
|
|
42
|
-
|
43
|
-
<bibitem type="international-standard" id="ISO124"> <title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content</title> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Détermination des matières solides totales</title> <uri type="src">https://www.iso.org/standard/61884.html</uri> <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri> <uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri> <docidentifier>ISO 124</docidentifier> <date type="published"> <on>2014</on> </date> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>7</edition> <language>en</language> <language>fr</language> <script>Latn</script> <abstract format="plain" language="en" script="Latn">ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber.</abstract> <abstract format="plain" language="fr" script="Latn">L'ISO 124:2014 spécifie des méthodes pour la détermination des matières solides totales dans le latex de plantation, le latex de concentré de caoutchouc naturel et le latex de caoutchouc synthétique. Ces méthodes ne conviennent pas nécessairement au latex d'origine naturelle autre que celui de l'Hevea brasiliensis, au latex vulcanisé, aux mélanges de latex, ou aux dispersions artificielles de caoutchouc.</abstract> <status>Published</status> <copyright> <from>2014</from> <owner> <organization> <name>ISO</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem> <formattedref>ISO 124:2011</formattedref> </bibitem> </relation></bibitem>
|
42
|
+
ISO_124_DATED = <<~EOS
|
43
|
+
<bibitem type="international-standard" id="ISO124-2014"> <title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content</title> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Détermination des matières solides totales</title> <uri type="src">https://www.iso.org/standard/61884.html</uri> <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri> <uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri> <docidentifier type="ISO">ISO 124:2014</docidentifier> <date type="published"> <on>2014</on> </date> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>7</edition> <language>en</language> <language>fr</language> <script>Latn</script> <abstract format="plain" language="en" script="Latn">ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber.</abstract> <abstract format="plain" language="fr" script="Latn">L'ISO 124:2014 spécifie des méthodes pour la détermination des matières solides totales dans le latex de plantation, le latex de concentré de caoutchouc naturel et le latex de caoutchouc synthétique. Ces méthodes ne conviennent pas nécessairement au latex d'origine naturelle autre que celui de l'Hevea brasiliensis, au latex vulcanisé, aux mélanges de latex, ou aux dispersions artificielles de caoutchouc.</abstract> <status>Published</status> <copyright> <from>2014</from> <owner> <organization> <name>ISO</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem> <formattedref>ISO 124:2011</formattedref> </bibitem> </relation></bibitem>
|
44
44
|
EOS
|
45
45
|
|
46
46
|
it "does not activate biblio caches if isobib disabled" do
|
@@ -109,9 +109,9 @@ EOS
|
|
109
109
|
expect(File.exist?("#{Dir.home}/.iev.pstore")).to be true
|
110
110
|
|
111
111
|
db = Relaton::Db.new "#{Dir.home}/.relaton-bib.pstore", nil
|
112
|
-
entry = db.load_entry("ISO 123:2001")
|
112
|
+
entry = db.load_entry("ISO(ISO 123:2001)")
|
113
113
|
expect(entry["fetched"].to_s).to eq(Date.today.to_s)
|
114
|
-
expect(entry["bib"].to_xml).to be_equivalent_to(
|
114
|
+
expect(entry["bib"].to_xml).to be_equivalent_to(ISO_123_DATED)
|
115
115
|
|
116
116
|
system "rm ~/.relaton-bib.pstore"
|
117
117
|
system "rm ~/.iev.pstore"
|
@@ -134,7 +134,7 @@ EOS
|
|
134
134
|
expect(File.exist?("test.relaton.pstore")).to be false
|
135
135
|
|
136
136
|
db = Relaton::Db.new "#{Dir.home}/.relaton-bib.pstore", nil
|
137
|
-
entry = db.load_entry("ISO 123:2001")
|
137
|
+
entry = db.load_entry("ISO(ISO 123:2001)")
|
138
138
|
expect(entry).to_not be nil
|
139
139
|
|
140
140
|
system "rm ~/.relaton-bib.pstore"
|
@@ -156,11 +156,11 @@ EOS
|
|
156
156
|
expect(File.exist?("test.relaton.pstore")).to be true
|
157
157
|
|
158
158
|
db = Relaton::Db.new "#{Dir.home}/.relaton-bib.pstore", nil
|
159
|
-
entry = db.load_entry("ISO 123:2001")
|
159
|
+
entry = db.load_entry("ISO(ISO 123:2001)")
|
160
160
|
expect(entry).to_not be nil
|
161
161
|
|
162
162
|
db = Relaton::Db.new "test.relaton.pstore", nil
|
163
|
-
entry = db.load_entry("ISO 123:2001")
|
163
|
+
entry = db.load_entry("ISO(ISO 123:2001)")
|
164
164
|
expect(entry).to_not be nil
|
165
165
|
|
166
166
|
system "rm ~/.relaton-bib.pstore"
|
@@ -171,10 +171,10 @@ EOS
|
|
171
171
|
it "fetches uncached references" do
|
172
172
|
system "mv ~/.relaton-bib.pstore ~/.relaton-bib.pstore1"
|
173
173
|
db = Relaton::Db.new "#{Dir.home}/.relaton-bib.pstore", nil
|
174
|
-
db.save_entry("ISO 123:2001",
|
174
|
+
db.save_entry("ISO(ISO 123:2001)",
|
175
175
|
{
|
176
176
|
"fetched" => Date.today.to_s,
|
177
|
-
"bib" => IsoBibItem.from_xml(
|
177
|
+
"bib" => IsoBibItem.from_xml(ISO_123_DATED)
|
178
178
|
}
|
179
179
|
)
|
180
180
|
|
@@ -189,12 +189,12 @@ EOS
|
|
189
189
|
* [[[iso124,ISO 124:2014]]] _Standard_
|
190
190
|
INPUT
|
191
191
|
|
192
|
-
entry = db.load_entry("ISO 123:2001")
|
192
|
+
entry = db.load_entry("ISO(ISO 123:2001)")
|
193
193
|
expect(entry["fetched"].to_s).to eq(Date.today.to_s)
|
194
|
-
expect(entry["bib"].to_xml).to be_equivalent_to(
|
195
|
-
entry = db.load_entry("ISO 124:2014")
|
194
|
+
expect(entry["bib"].to_xml).to be_equivalent_to(ISO_123_DATED)
|
195
|
+
entry = db.load_entry("ISO(ISO 124:2014)")
|
196
196
|
expect(entry["fetched"].to_s).to eq(Date.today.to_s)
|
197
|
-
expect(entry["bib"].to_xml).to be_equivalent_to(
|
197
|
+
expect(entry["bib"].to_xml).to be_equivalent_to(ISO_124_DATED)
|
198
198
|
|
199
199
|
system "rm ~/.relaton-bib.pstore"
|
200
200
|
system "mv ~/.relaton-bib.pstore1 ~/.relaton-bib.pstore"
|
@@ -221,9 +221,9 @@ EOS
|
|
221
221
|
* [[[iso123,ISO 123]]] _Standard_
|
222
222
|
INPUT
|
223
223
|
|
224
|
-
entry = db.load_entry("ISO 123")
|
224
|
+
entry = db.load_entry("ISO(ISO 123)")
|
225
225
|
expect(entry["fetched"].to_s).to eq(Date.today.to_s)
|
226
|
-
expect(entry["bib"].to_xml).to be_equivalent_to(
|
226
|
+
expect(entry["bib"].to_xml).to be_equivalent_to(ISO_123_UNDATED)
|
227
227
|
|
228
228
|
system "rm ~/.relaton-bib.pstore"
|
229
229
|
system "mv ~/.relaton-bib.pstore1 ~/.relaton-bib.pstore"
|
@@ -233,10 +233,10 @@ EOS
|
|
233
233
|
system "mv ~/.relaton-bib.pstore ~/.relaton-bib.pstore1"
|
234
234
|
|
235
235
|
db = Relaton::Db.new "#{Dir.home}/.relaton-bib.pstore", nil
|
236
|
-
db.save_entry("ISO 123:2001",
|
236
|
+
db.save_entry("ISO(ISO 123:2001)",
|
237
237
|
{
|
238
238
|
"fetched" => (Date.today - 90),
|
239
|
-
"bib" => IsoBibItem.from_xml(
|
239
|
+
"bib" => IsoBibItem.from_xml(ISO_123_DATED)
|
240
240
|
}
|
241
241
|
)
|
242
242
|
|
@@ -248,9 +248,9 @@ EOS
|
|
248
248
|
* [[[iso123,ISO 123:2001]]] _Standard_
|
249
249
|
INPUT
|
250
250
|
|
251
|
-
entry = db.load_entry("ISO 123:2001")
|
251
|
+
entry = db.load_entry("ISO(ISO 123:2001)")
|
252
252
|
expect(entry["fetched"].to_s).to eq((Date.today - 90).to_s)
|
253
|
-
expect(entry["bib"].to_xml).to be_equivalent_to(
|
253
|
+
expect(entry["bib"].to_xml).to be_equivalent_to(ISO_123_DATED)
|
254
254
|
|
255
255
|
system "rm ~/.relaton-bib.pstore"
|
256
256
|
system "mv ~/.relaton-bib.pstore1 ~/.relaton-bib.pstore"
|
@@ -261,13 +261,13 @@ EOS
|
|
261
261
|
system "rm test.relaton.pstore"
|
262
262
|
|
263
263
|
db = Relaton::Db.new "#{Dir.home}/.relaton-bib.pstore", nil
|
264
|
-
db.save_entry("ISO 123:2001",
|
264
|
+
db.save_entry("ISO(ISO 123:2001)",
|
265
265
|
{
|
266
266
|
"fetched" => Date.today,
|
267
|
-
"bib" => IsoBibItem.from_xml(
|
267
|
+
"bib" => IsoBibItem.from_xml(ISO_123_DATED)
|
268
268
|
}
|
269
269
|
)
|
270
|
-
db.save_entry("ISO 124",
|
270
|
+
db.save_entry("ISO(ISO 124)",
|
271
271
|
{
|
272
272
|
"fetched" => Date.today,
|
273
273
|
"bib" => IsoBibItem.from_xml(ISO_124_SHORT)
|
@@ -275,7 +275,7 @@ EOS
|
|
275
275
|
)
|
276
276
|
|
277
277
|
localdb = Relaton::Db.new "test.relaton.pstore", nil
|
278
|
-
localdb.save_entry("ISO 124",
|
278
|
+
localdb.save_entry("ISO(ISO 124)",
|
279
279
|
{
|
280
280
|
"fetched" => Date.today,
|
281
281
|
"bib" => IsoBibItem.from_xml(ISO_124_SHORT_ALT)
|
@@ -287,7 +287,7 @@ EOS
|
|
287
287
|
[bibliography]
|
288
288
|
== Normative References
|
289
289
|
|
290
|
-
* [[[ISO123,ISO 123:2001]]] _Standard_
|
290
|
+
* [[[ISO123-2001,ISO 123:2001]]] _Standard_
|
291
291
|
* [[[ISO124,ISO 124]]] _Standard_
|
292
292
|
EOS
|
293
293
|
|
@@ -298,7 +298,7 @@ EOS
|
|
298
298
|
<bibliography>
|
299
299
|
<references id="_" obligation="informative">
|
300
300
|
<title>Normative References</title>
|
301
|
-
#{
|
301
|
+
#{ISO_123_DATED}
|
302
302
|
#{ISO_124_SHORT_ALT}
|
303
303
|
</references></bibliography>
|
304
304
|
</standard-document>
|
@@ -306,10 +306,10 @@ EOS
|
|
306
306
|
|
307
307
|
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to(output)
|
308
308
|
|
309
|
-
expect(db.load_entry("ISO 123:2001")["bib"].to_xml).to be_equivalent_to(
|
310
|
-
expect(db.load_entry("ISO 124")["bib"].to_xml).to be_equivalent_to(ISO_124_SHORT)
|
311
|
-
expect(localdb.load_entry("ISO 123:2001")["bib"].to_xml).to be_equivalent_to(
|
312
|
-
expect(localdb.load_entry("ISO 124")["bib"].to_xml).to be_equivalent_to(ISO_124_SHORT_ALT)
|
309
|
+
expect(db.load_entry("ISO(ISO 123:2001)")["bib"].to_xml).to be_equivalent_to(ISO_123_DATED)
|
310
|
+
expect(db.load_entry("ISO(ISO 124)")["bib"].to_xml).to be_equivalent_to(ISO_124_SHORT)
|
311
|
+
expect(localdb.load_entry("ISO(ISO 123:2001)")["bib"].to_xml).to be_equivalent_to(ISO_123_DATED)
|
312
|
+
expect(localdb.load_entry("ISO(ISO 124)")["bib"].to_xml).to be_equivalent_to(ISO_124_SHORT_ALT)
|
313
313
|
|
314
314
|
system "rm ~/.relaton-bib.pstore"
|
315
315
|
system "mv ~/.relaton-bib.pstore1 ~/.relaton-bib.pstore"
|
@@ -318,15 +318,15 @@ EOS
|
|
318
318
|
private
|
319
319
|
|
320
320
|
def mock_isobib_get_123
|
321
|
-
expect(Isobib::IsoBibliography).to receive(:get).with("ISO 123", "2001", {}).and_return(IsoBibItem.from_xml(
|
321
|
+
expect(Isobib::IsoBibliography).to receive(:get).with("ISO 123", "2001", {}).and_return(IsoBibItem.from_xml(ISO_123_DATED))
|
322
322
|
end
|
323
323
|
|
324
324
|
def mock_isobib_get_123_undated
|
325
|
-
expect(Isobib::IsoBibliography).to receive(:get).with("ISO 123", nil, {}).and_return(IsoBibItem.from_xml(
|
325
|
+
expect(Isobib::IsoBibliography).to receive(:get).with("ISO 123", nil, {}).and_return(IsoBibItem.from_xml(ISO_123_UNDATED))
|
326
326
|
end
|
327
327
|
|
328
328
|
def mock_isobib_get_124
|
329
|
-
expect(Isobib::IsoBibliography).to receive(:get).with("ISO 124", "2014", {}).and_return(IsoBibItem.from_xml(
|
329
|
+
expect(Isobib::IsoBibliography).to receive(:get).with("ISO 124", "2014", {}).and_return(IsoBibItem.from_xml(ISO_124_DATED))
|
330
330
|
end
|
331
331
|
|
332
332
|
end
|
@@ -44,7 +44,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
44
44
|
<title>Normative References</title>
|
45
45
|
<bibitem id="iso123" type="standard">
|
46
46
|
<title format="text/plain">Standard</title>
|
47
|
-
<docidentifier>ISO 123</docidentifier>
|
47
|
+
<docidentifier>ISO 123:1066-1067</docidentifier>
|
48
48
|
<date type="published">
|
49
49
|
<from>1066</from>
|
50
50
|
<to>1067</to>
|
@@ -288,7 +288,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
288
288
|
<title>Normative References</title>
|
289
289
|
<bibitem id="iso123" type="standard">
|
290
290
|
<title format="text/plain">Standard</title>
|
291
|
-
<docidentifier>ISO 123
|
291
|
+
<docidentifier>ISO 123:--</docidentifier>
|
292
292
|
<date type="published">
|
293
293
|
<on>--</on>
|
294
294
|
</date>
|
@@ -322,7 +322,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
322
322
|
<title>Normative References</title>
|
323
323
|
<bibitem id="iso123" type="standard">
|
324
324
|
<title format="text/plain">Standard</title>
|
325
|
-
<docidentifier>ISO 123</docidentifier>
|
325
|
+
<docidentifier>ISO 123:1066 (all parts)</docidentifier>
|
326
326
|
<date type="published">
|
327
327
|
<on>1066</on>
|
328
328
|
</date>
|
@@ -347,7 +347,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
347
347
|
[bibliography]
|
348
348
|
== Normative References
|
349
349
|
|
350
|
-
* [[[iso123,IETF
|
350
|
+
* [[[iso123,IETF(RFC 8341)]]], _Standard_
|
351
351
|
|
352
352
|
== Clause 4
|
353
353
|
|
@@ -358,7 +358,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
358
358
|
<clause id="_" inline-header="false" obligation="normative">
|
359
359
|
<title>Clause 4</title>
|
360
360
|
<p id="_">
|
361
|
-
<eref type="inline" bibitemid="iso123" citeas="RFC 8341
|
361
|
+
<eref type="inline" bibitemid="iso123" citeas="RFC 8341"/>
|
362
362
|
</p>
|
363
363
|
</clause>
|
364
364
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-standoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.9.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.9.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: iev
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.2.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,14 +240,14 @@ dependencies:
|
|
240
240
|
requirements:
|
241
241
|
- - "~>"
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 0.
|
243
|
+
version: 0.3.0
|
244
244
|
type: :development
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
248
|
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version: 0.
|
250
|
+
version: 0.3.0
|
251
251
|
description: |
|
252
252
|
metanorma-standoc realises standards following the Metanorma standoc model
|
253
253
|
|