metanorma-iso 1.9.5 → 1.9.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -158,133 +158,133 @@ RSpec.describe Asciidoctor::ISO do
158
158
  :pub-fax: 4444444
159
159
  :pub-email: x@example.com
160
160
  :pub-uri: http://www.example.com
161
- :docstage:
162
- :docsubstage:
161
+ :docstage:
162
+ :docsubstage:
163
163
  INPUT
164
164
  expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
165
165
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
166
- <?xml version="1.0" encoding="UTF-8"?>
167
- <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
168
- <bibdata type="standard">
169
- <docidentifier type="ISO">ISO/IEC/IETF/TR 1000-1-1:2001</docidentifier>
170
- <docidentifier type="iso-with-lang">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
171
- <docidentifier type="iso-reference">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
172
- <docidentifier type="iso-tc">2000</docidentifier>
173
- <docidentifier type="iso-tc">2003</docidentifier>
174
- <docnumber>1000</docnumber>
175
- <contributor>
176
- <role type="author"/>
177
- <organization>
178
- <name>International Electrotechnical Commission</name>
179
- <abbreviation>IEC</abbreviation>
180
- </organization>
181
- </contributor>
182
- <contributor>
183
- <role type="author"/>
184
- <organization>
185
- <name>IETF</name>
186
- </organization>
187
- </contributor>
188
- <contributor>
189
- <role type="author"/>
190
- <organization>
191
- <name>International Organization for Standardization</name>
192
- <abbreviation>ISO</abbreviation>
193
- </organization>
194
- </contributor>
195
- <contributor>
196
- <role type="publisher"/>
197
- <organization>
198
- <name>International Electrotechnical Commission</name>
199
- <abbreviation>IEC</abbreviation>
200
- <address>
201
- <formattedAddress>1 Infinity Loop + California</formattedAddress>
202
- </address>
203
- <phone>3333333</phone>
204
- <phone type='fax'>4444444</phone>
205
- <email>x@example.com</email>
206
- <uri>http://www.example.com</uri>
207
- </organization>
208
- </contributor>
209
- <contributor>
210
- <role type="publisher"/>
211
- <organization>
212
- <name>IETF</name>
213
- <address>
214
- <formattedAddress>1 Infinity Loop + California</formattedAddress>
215
- </address>
216
- <phone>3333333</phone>
217
- <phone type='fax'>4444444</phone>
218
- <email>x@example.com</email>
219
- <uri>http://www.example.com</uri>
220
- </organization>
221
- </contributor>
222
- <contributor>
223
- <role type="publisher"/>
224
- <organization>
225
- <name>International Organization for Standardization</name>
226
- <abbreviation>ISO</abbreviation>
227
- <address>
228
- <formattedAddress>1 Infinity Loop + California</formattedAddress>
229
- </address>
230
- <phone>3333333</phone>
231
- <phone type='fax'>4444444</phone>
232
- <email>x@example.com</email>
233
- <uri>http://www.example.com</uri>
234
- </organization>
235
- </contributor>
236
- <language>el</language>
237
- <script>Grek</script>
238
- <status>
239
- <stage abbreviation="IS">60</stage>
240
- <substage>60</substage>
241
- </status>
242
- <copyright>
243
- <from>2001</from>
244
- <owner>
245
- <organization>
246
- <name>International Organization for Standardization</name>
247
- <abbreviation>ISO</abbreviation>
248
- <address>
249
- <formattedAddress>1 Infinity Loop + California</formattedAddress>
250
- </address>
251
- <phone>3333333</phone>
252
- <phone type='fax'>4444444</phone>
253
- <email>x@example.com</email>
254
- <uri>http://www.example.com</uri>
255
- </organization>
256
- </owner>
257
- </copyright>
258
- <copyright>
259
- <from>2001</from>
260
- <owner>
261
- <organization>
262
- <name>IETF</name>
263
- <address>
264
- <formattedAddress>1 Infinity Loop + California</formattedAddress>
265
- </address>
266
- <phone>3333333</phone>
267
- <phone type='fax'>4444444</phone>
268
- <email>x@example.com</email>
269
- <uri>http://www.example.com</uri>
270
- </organization>
271
- </owner>
272
- </copyright>
273
- <ext>
274
- <doctype>technical-report</doctype>
275
- <editorialgroup>
276
- <technical-committee/>
277
- <subcommittee/>
278
- <workgroup/>
279
- </editorialgroup>
280
- <structuredidentifier>
281
- <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
282
- </structuredidentifier>
283
- <stagename>International standard</stagename>
284
- </ext>
285
- </bibdata>
286
- <sections/>
287
- </iso-standard>
166
+ <?xml version="1.0" encoding="UTF-8"?>
167
+ <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
168
+ <bibdata type="standard">
169
+ <docidentifier type="ISO">ISO/IEC/IETF/TR 1000-1-1:2001</docidentifier>
170
+ <docidentifier type="iso-with-lang">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
171
+ <docidentifier type="iso-reference">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
172
+ <docidentifier type="iso-tc">2000</docidentifier>
173
+ <docidentifier type="iso-tc">2003</docidentifier>
174
+ <docnumber>1000</docnumber>
175
+ <contributor>
176
+ <role type="author"/>
177
+ <organization>
178
+ <name>International Electrotechnical Commission</name>
179
+ <abbreviation>IEC</abbreviation>
180
+ </organization>
181
+ </contributor>
182
+ <contributor>
183
+ <role type="author"/>
184
+ <organization>
185
+ <name>IETF</name>
186
+ </organization>
187
+ </contributor>
188
+ <contributor>
189
+ <role type="author"/>
190
+ <organization>
191
+ <name>International Organization for Standardization</name>
192
+ <abbreviation>ISO</abbreviation>
193
+ </organization>
194
+ </contributor>
195
+ <contributor>
196
+ <role type="publisher"/>
197
+ <organization>
198
+ <name>International Electrotechnical Commission</name>
199
+ <abbreviation>IEC</abbreviation>
200
+ <address>
201
+ <formattedAddress>1 Infinity Loop + California</formattedAddress>
202
+ </address>
203
+ <phone>3333333</phone>
204
+ <phone type='fax'>4444444</phone>
205
+ <email>x@example.com</email>
206
+ <uri>http://www.example.com</uri>
207
+ </organization>
208
+ </contributor>
209
+ <contributor>
210
+ <role type="publisher"/>
211
+ <organization>
212
+ <name>IETF</name>
213
+ <address>
214
+ <formattedAddress>1 Infinity Loop + California</formattedAddress>
215
+ </address>
216
+ <phone>3333333</phone>
217
+ <phone type='fax'>4444444</phone>
218
+ <email>x@example.com</email>
219
+ <uri>http://www.example.com</uri>
220
+ </organization>
221
+ </contributor>
222
+ <contributor>
223
+ <role type="publisher"/>
224
+ <organization>
225
+ <name>International Organization for Standardization</name>
226
+ <abbreviation>ISO</abbreviation>
227
+ <address>
228
+ <formattedAddress>1 Infinity Loop + California</formattedAddress>
229
+ </address>
230
+ <phone>3333333</phone>
231
+ <phone type='fax'>4444444</phone>
232
+ <email>x@example.com</email>
233
+ <uri>http://www.example.com</uri>
234
+ </organization>
235
+ </contributor>
236
+ <language>el</language>
237
+ <script>Grek</script>
238
+ <status>
239
+ <stage abbreviation="IS">60</stage>
240
+ <substage>60</substage>
241
+ </status>
242
+ <copyright>
243
+ <from>2001</from>
244
+ <owner>
245
+ <organization>
246
+ <name>International Organization for Standardization</name>
247
+ <abbreviation>ISO</abbreviation>
248
+ <address>
249
+ <formattedAddress>1 Infinity Loop + California</formattedAddress>
250
+ </address>
251
+ <phone>3333333</phone>
252
+ <phone type='fax'>4444444</phone>
253
+ <email>x@example.com</email>
254
+ <uri>http://www.example.com</uri>
255
+ </organization>
256
+ </owner>
257
+ </copyright>
258
+ <copyright>
259
+ <from>2001</from>
260
+ <owner>
261
+ <organization>
262
+ <name>IETF</name>
263
+ <address>
264
+ <formattedAddress>1 Infinity Loop + California</formattedAddress>
265
+ </address>
266
+ <phone>3333333</phone>
267
+ <phone type='fax'>4444444</phone>
268
+ <email>x@example.com</email>
269
+ <uri>http://www.example.com</uri>
270
+ </organization>
271
+ </owner>
272
+ </copyright>
273
+ <ext>
274
+ <doctype>technical-report</doctype>
275
+ <editorialgroup>
276
+ <technical-committee/>
277
+ <subcommittee/>
278
+ <workgroup/>
279
+ </editorialgroup>
280
+ <structuredidentifier>
281
+ <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
282
+ </structuredidentifier>
283
+ <stagename>International standard</stagename>
284
+ </ext>
285
+ </bibdata>
286
+ <sections/>
287
+ </iso-standard>
288
288
  OUTPUT
289
289
  end
290
290
 
@@ -667,6 +667,233 @@ RSpec.describe Asciidoctor::ISO do
667
667
  OUTPUT
668
668
  end
669
669
 
670
+ it "processes document relations" do
671
+ VCR.use_cassette "docrels" do
672
+ output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
673
+ = Document title
674
+ Author
675
+ :docfile: test.adoc
676
+ :nodoc:
677
+ :novalid:
678
+ :amends: ISO 123;ISO 124
679
+ :obsoletes: ISO 125;ISO 126
680
+ INPUT
681
+ expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
682
+ .to be_equivalent_to xmlpp(<<~"OUTPUT")
683
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
684
+ <bibdata type='standard'>
685
+ <contributor>
686
+ <role type='author'/>
687
+ <organization>
688
+ <name>International Organization for Standardization</name>
689
+ <abbreviation>ISO</abbreviation>
690
+ </organization>
691
+ </contributor>
692
+ <contributor>
693
+ <role type='publisher'/>
694
+ <organization>
695
+ <name>International Organization for Standardization</name>
696
+ <abbreviation>ISO</abbreviation>
697
+ </organization>
698
+ </contributor>
699
+ <language>en</language>
700
+ <script>Latn</script>
701
+ <status>
702
+ <stage abbreviation='IS'>60</stage>
703
+ <substage>60</substage>
704
+ </status>
705
+ <copyright>
706
+ <from>2021</from>
707
+ <owner>
708
+ <organization>
709
+ <name>International Organization for Standardization</name>
710
+ <abbreviation>ISO</abbreviation>
711
+ </organization>
712
+ </owner>
713
+ </copyright>
714
+ <relation type='obsoletes'>
715
+ <bibitem type='standard'>
716
+ <fetched>2021-10-10</fetched>
717
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
718
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
719
+ <title type='main' format='text/plain' language='en' script='Latn'>
720
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination of
721
+ alkalinity
722
+ </title>
723
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex concentr&#233; de caoutchouc naturel</title>
724
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>D&#233;termination de l&#8217;alcalinit&#233;</title>
725
+ <title type='main' format='text/plain' language='fr' script='Latn'>
726
+ Latex concentr&#233; de caoutchouc
727
+ naturel&#8201;&#8212;&#8201;D&#233;termination de
728
+ l&#8217;alcalinit&#233;
729
+ </title>
730
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
731
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
732
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
733
+ <docidentifier type='ISO'>ISO 125:2020</docidentifier>
734
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en,fr</docidentifier>
735
+ <docnumber>125</docnumber>
736
+ <date type='published'>
737
+ <on>2020-02</on>
738
+ </date>
739
+ <contributor>
740
+ <role type='publisher'/>
741
+ <organization>
742
+ <name>International Organization for Standardization</name>
743
+ <abbreviation>ISO</abbreviation>
744
+ <uri>www.iso.org</uri>
745
+ </organization>
746
+ </contributor>
747
+ <edition>7</edition>
748
+ <language>en</language>
749
+ <language>fr</language>
750
+ <script>Latn</script>
751
+ <abstract format='text/plain' language='en' script='Latn'>
752
+ This document specifies a method for the determination of the
753
+ alkalinity of natural rubber latex concentrate. The method is not
754
+ necessarily suitable for latices from natural sources other than Hevea
755
+ brasiliensis or for synthetic rubber latices, compounded latex,
756
+ vulcanized latex or artificial dispersions of rubber. NOTE A method
757
+ for the determination of the alkalinity of polychloroprene latex is
758
+ specified in ISO 13773.
759
+ </abstract>
760
+ <abstract format='text/plain' language='fr' script='Latn'>
761
+ Le pr&#233;sent document sp&#233;cifie une m&#233;thode de
762
+ d&#233;termination de l&#8217;alcalinit&#233; du latex concentr&#233;
763
+ de caoutchouc naturel. La m&#233;thode ne convient pas
764
+ n&#233;cessairement aux latex d&#8217;origine naturelle autres que
765
+ l&#8217;Hevea brasiliensis ou aux latex de caoutchouc de
766
+ synth&#232;se, aux latex formul&#233;s, aux latex vulcanis&#233;s ou
767
+ aux dispersions artificielles de caoutchouc. NOTE Une m&#233;thode de
768
+ d&#233;termination de l&#8217;alcalinit&#233; du latex de
769
+ polychloropr&#232;ne est sp&#233;cifi&#233;e dans l&#8217;ISO 13773.
770
+ </abstract>
771
+ <status>
772
+ <stage>60</stage>
773
+ <substage>60</substage>
774
+ </status>
775
+ <copyright>
776
+ <from>2020</from>
777
+ <owner>
778
+ <organization>
779
+ <name>ISO</name>
780
+ </organization>
781
+ </owner>
782
+ </copyright>
783
+ <relation type='obsoletes'>
784
+ <bibitem type='standard'>
785
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
786
+ </bibitem>
787
+ </relation>
788
+ <place>Geneva</place>
789
+ </bibitem>
790
+ </relation>
791
+ <relation type='obsoletes'>
792
+ <bibitem type='standard'>
793
+ <fetched>2021-10-10</fetched>
794
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
795
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of dry rubber content</title>
796
+ <title type='main' format='text/plain' language='en' script='Latn'>
797
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination of
798
+ dry rubber content
799
+ </title>
800
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc naturel concentr&#233;</title>
801
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>D&#233;termination de la teneur en caoutchouc sec</title>
802
+ <title type='main' format='text/plain' language='fr' script='Latn'>
803
+ Latex de caoutchouc naturel
804
+ concentr&#233;&#8201;&#8212;&#8201;D&#233;termination de la teneur en
805
+ caoutchouc sec
806
+ </title>
807
+ <uri type='src'>https://www.iso.org/standard/35176.html</uri>
808
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:35176:en</uri>
809
+ <uri type='rss'>https://www.iso.org/contents/data/standard/03/51/35176.detail.rss</uri>
810
+ <docidentifier type='ISO'>ISO 126:2005</docidentifier>
811
+ <docidentifier type='URN'>urn:iso:std:iso:126:stage-90.93:ed-5:en,fr</docidentifier>
812
+ <docnumber>126</docnumber>
813
+ <date type='published'>
814
+ <on>2005-04</on>
815
+ </date>
816
+ <contributor>
817
+ <role type='publisher'/>
818
+ <organization>
819
+ <name>International Organization for Standardization</name>
820
+ <abbreviation>ISO</abbreviation>
821
+ <uri>www.iso.org</uri>
822
+ </organization>
823
+ </contributor>
824
+ <edition>5</edition>
825
+ <language>en</language>
826
+ <language>fr</language>
827
+ <script>Latn</script>
828
+ <abstract format='text/plain' language='en' script='Latn'>
829
+ ISO 126:2005 specifies a method for the determination of the dry
830
+ rubber content of natural rubber latex concentrate. The method is not
831
+ necessarily suitable for latices preserved with potassium hydroxide,
832
+ latices from natural sources other than Hevea brasiliensis, or for
833
+ compounded latex, vulcanized latex or artificial dispersions of rubber
834
+ and it is not applicable to synthetic rubber latices.
835
+ </abstract>
836
+ <abstract format='text/plain' language='fr' script='Latn'>
837
+ L&#8217;ISO 126:2005 sp&#233;cifie une m&#233;thode de
838
+ d&#233;termination de la teneur en caoutchouc sec du latex de
839
+ caoutchouc naturel concentr&#233;. La m&#233;thode ne convient pas
840
+ n&#233;cessairement pour les latex conserv&#233;s dans de
841
+ l&#8217;hydroxyde de potassium, pour les latex d&#8217;origine
842
+ naturelle autres que celui de l&#8217;Hevea brasiliensis ou pour des
843
+ m&#233;langes de latex, pour les latex vulcanis&#233;s ou les
844
+ dispersions artificielles de caoutchouc, et elle n&#8217;est pas
845
+ applicable aux latex d&#8217;&#233;lastom&#232;res.
846
+ </abstract>
847
+ <status>
848
+ <stage>90</stage>
849
+ <substage>93</substage>
850
+ </status>
851
+ <copyright>
852
+ <from>2005</from>
853
+ <owner>
854
+ <organization>
855
+ <name>ISO</name>
856
+ </organization>
857
+ </owner>
858
+ </copyright>
859
+ <relation type='obsoletes'>
860
+ <bibitem type='standard'>
861
+ <formattedref format='text/plain'>ISO 126:1995</formattedref>
862
+ </bibitem>
863
+ </relation>
864
+ <place>Geneva</place>
865
+ </bibitem>
866
+ </relation>
867
+ <relation type='updates'>
868
+ <description>amends</description>
869
+ <bibitem>
870
+ <title>--</title>
871
+ <docidentifier>ISO 123</docidentifier>
872
+ </bibitem>
873
+ </relation>
874
+ <relation type='updates'>
875
+ <description>amends</description>
876
+ <bibitem>
877
+ <title>--</title>
878
+ <docidentifier>ISO 124</docidentifier>
879
+ </bibitem>
880
+ </relation>
881
+ <ext>
882
+ <doctype>article</doctype>
883
+ <editorialgroup>
884
+ <technical-committee/>
885
+ <subcommittee/>
886
+ <workgroup/>
887
+ </editorialgroup>
888
+ <stagename>International standard</stagename>
889
+ </ext>
890
+ </bibdata>
891
+ <sections> </sections>
892
+ </iso-standard>
893
+ OUTPUT
894
+ end
895
+ end
896
+
670
897
  it "reads scripts into blank HTML document" do
671
898
  Asciidoctor.convert(<<~"INPUT", *OPTIONS)
672
899
  = Document title
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,15 @@
1
+ require "vcr"
2
+
3
+ VCR.configure do |config|
4
+ config.cassette_library_dir = "spec/vcr_cassettes"
5
+ config.hook_into :webmock
6
+ config.default_cassette_options = {
7
+ clean_outdated_http_interactions: true,
8
+ re_record_interval: 1512000,
9
+ record: :once,
10
+ }
11
+ end
12
+
1
13
  require "simplecov"
2
14
  SimpleCov.start do
3
15
  add_filter "/spec/"