metanorma-iso 1.3.20 → 1.3.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.3.20".freeze
3
+ VERSION = "1.3.21".freeze
4
4
  end
5
5
  end
@@ -238,7 +238,7 @@ it "warns that term source is not a real reference" do
238
238
  [.source]
239
239
  <<iso123>>
240
240
  INPUT
241
- expect(File.read("test.err")).to include "iso123 is not a real reference"
241
+ expect(File.read("test.err")).to include "iso123 does not have a corresponding anchor ID in the bibliography"
242
242
  end
243
243
 
244
244
  it "warns that undated reference has locality" do
@@ -0,0 +1,115 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc do
4
+ it "processes formulae" do
5
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface><foreword>
8
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true">
9
+ <stem type="AsciiMath">r = 1 %</stem>
10
+ <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
11
+ <dt>
12
+ <stem type="AsciiMath">r</stem>
13
+ </dt>
14
+ <dd>
15
+ <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
16
+ </dd>
17
+ </dl>
18
+ <note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
19
+ <p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
20
+ </note>
21
+ </formula>
22
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
23
+ <stem type="AsciiMath">r = 1 %</stem>
24
+ </formula>
25
+ </foreword></preface>
26
+ </iso-standard>
27
+ INPUT
28
+ #{HTML_HDR}
29
+ <br/>
30
+ <div>
31
+ <h1 class="ForewordTitle">Foreword</h1>
32
+ <div id="_be9158af-7e93-4ee2-90c5-26d31c181934" class="formula"><p><span class="stem">(#(r = 1 %)#)</span></p></div><p style='page-break-after:avoid;'>where</p><dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d" class='formula_dl'><dt>
33
+ <span class="stem">(#(r)#)</span>
34
+ </dt><dd>
35
+ <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
36
+ </dd></dl>
37
+
38
+
39
+ <div id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0" class="Note"><p><span class="note_label">NOTE</span>&#160; [durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p></div>
40
+
41
+ <div id="_be9158af-7e93-4ee2-90c5-26d31c181935" class="formula"><p><span class="stem">(#(r = 1 %)#)</span>&#160; (1)</p></div>
42
+ </div>
43
+ <p class="zzSTDTitle1"/>
44
+ </div>
45
+ </body>
46
+ </html>
47
+ OUTPUT
48
+ end
49
+
50
+ it "processes formulae (Word)" do
51
+ expect((IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{^.*<div>\s*<h1 class="ForewordTitle">}m, '<div><h1 class="ForewordTitle">').sub(%r{<p>\&#160;</p>\s*</div>.*$}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
52
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
53
+ <preface><foreword>
54
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true">
55
+ <stem type="AsciiMath">r = 1 %</stem>
56
+ <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
57
+ <dt>
58
+ <stem type="AsciiMath">r</stem>
59
+ </dt>
60
+ <dd>
61
+ <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
62
+ </dd>
63
+ </dl>
64
+ <note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
65
+ <p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
66
+ </note>
67
+ </formula>
68
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
69
+ <stem type="AsciiMath">r = 1 %</stem>
70
+ </formula>
71
+ </foreword></preface>
72
+ </iso-standard>
73
+ INPUT
74
+ <div>
75
+ <h1 class='ForewordTitle'>Foreword</h1>
76
+ <div id='_be9158af-7e93-4ee2-90c5-26d31c181934' class='formula'>
77
+ <p>
78
+ <span class='stem'>(#(r = 1 %)#)</span>
79
+ </p>
80
+ </div>
81
+ <p>where</p>
82
+ <table class='formula_dl'>
83
+ <tr>
84
+ <td valign='top' align='left'>
85
+ <p align='left' style='margin-left:0pt;text-align:left;'>
86
+ <span class='stem'>(#(r)#)</span>
87
+ </p>
88
+ </td>
89
+ <td valign='top'>
90
+ <p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the repeatability limit.</p>
91
+ </td>
92
+ </tr>
93
+ </table>
94
+ <div id='_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0' class='Note'>
95
+ <p class='Note'>
96
+ <span class='note_label'>NOTE</span>
97
+ <span style='mso-tab-count:1'>&#160; </span>
98
+ [durationUnits] is essentially a duration statement without the "P"
99
+ prefix. "P" is unnecessary because between "G" and "U" duration is
100
+ always expressed.
101
+ </p>
102
+ </div>
103
+ <div id='_be9158af-7e93-4ee2-90c5-26d31c181935' class='formula'>
104
+ <p>
105
+ <span class='stem'>(#(r = 1 %)#)</span>
106
+ <span style='mso-tab-count:1'>&#160; </span>
107
+ (1)
108
+ </p>
109
+ </div>
110
+ </div>
111
+ OUTPUT
112
+ end
113
+
114
+
115
+ end
@@ -39,6 +39,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
39
39
  <contributor>
40
40
  <role type="publisher"/>
41
41
  <organization>
42
+ <name>International Organization for Standardization</name>
42
43
  <abbreviation>ISO</abbreviation>
43
44
  </organization>
44
45
  </contributor>
@@ -72,7 +73,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
72
73
  </bibdata>
73
74
  </iso-standard>
74
75
  INPUT
75
- {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumeric=>"1730", :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part&nbsp;1", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"30", :stage_int=>30, :stageabbr=>"CD", :statusabbr=>"PreCD3", :tc=>"TC 34", :tc_docnumber=>["17301", "17302"], :unpublished=>true, :wg=>"WG 3"}
76
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumeric=>"1730", :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part&nbsp;1", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :publisher=>"International Organization for Standardization", :revdate=>"2016-05-01", :revdate_monthyear=>"May 2016", :sc=>"SC 4", :secretariat=>"GB", :stage=>"30", :stage_int=>30, :stageabbr=>"CD", :statusabbr=>"PreCD3", :tc=>"TC 34", :tc_docnumber=>["17301", "17302"], :unpublished=>true, :wg=>"WG 3"}
76
77
  OUTPUT
77
78
  end
78
79
 
@@ -105,12 +106,14 @@ OUTPUT
105
106
  <contributor>
106
107
  <role type="publisher"/>
107
108
  <organization>
109
+ <name>International Organization for Standardization</name>
108
110
  <abbreviation>ISO</abbreviation>
109
111
  </organization>
110
112
  </contributor>
111
113
  <contributor>
112
114
  <role type="publisher"/>
113
115
  <organization>
116
+ <name>International Electrotechnical Commission</name>
114
117
  <abbreviation>IEC</abbreviation>
115
118
  </organization>
116
119
  </contributor>
@@ -148,7 +151,7 @@ OUTPUT
148
151
  </bibdata>
149
152
  </iso-standard>
150
153
  INPUT
151
- {:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumeric=>nil, :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part&nbsp;1&ndash;3", :doctype=>"International Standard", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :revdate=>nil, :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"60", :stage_int=>60, :statusabbr=>"IS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>false, :wg=>"GHI 3"}
154
+ {:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumeric=>nil, :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part&nbsp;1&ndash;3", :doctype=>"International Standard", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :publisher=>"International Organization for Standardization and International Electrotechnical Commission", :revdate=>nil, :revdate_monthyear=>nil, :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"60", :stage_int=>60, :statusabbr=>"IS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>false, :wg=>"GHI 3"}
152
155
  OUTPUT
153
156
  end
154
157
 
@@ -224,8 +224,8 @@ OUTPUT
224
224
 
225
225
  expect(File.exist?("test.doc")).to be true
226
226
  html = File.read("test.doc").sub(/^.+?<table /m, '<table xmlns:m="m" ').sub(%r{</div>\s*<p class="MsoNormal">.*$}m, "")
227
- expect(("<div>#{html}")).to be_equivalent_to xmlpp(<<~"OUTPUT")
228
- <div><table xmlns:m="m" class="MsoISOTable" style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;" title="tool tip" summary="long desc"><a name="tableD-1" id="tableD-1"></a>
227
+ expect(xmlpp("<div>#{html}")).to be_equivalent_to xmlpp(<<~"OUTPUT")
228
+ <div><table xmlns:m="m" class="MsoISOTable" style="mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;" title="tool tip" summary="long desc"><a name="tableD-1" id="tableD-1"></a>
229
229
  <thead>
230
230
  <tr>
231
231
  <td rowspan="2" align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Description</td>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.20
4
+ version: 1.3.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-20 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -305,6 +305,7 @@ files:
305
305
  - spec/examples/rice_img/rice_image3_1.png
306
306
  - spec/examples/rice_img/rice_image3_2.png
307
307
  - spec/examples/rice_img/rice_image3_3.png
308
+ - spec/isodoc/blocks_spec.rb
308
309
  - spec/isodoc/i18n_spec.rb
309
310
  - spec/isodoc/inline_spec.rb
310
311
  - spec/isodoc/iso_spec.rb