metanorma-iec 1.2.12 → 1.2.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,8 +13,8 @@ module IsoDoc
13
13
 
14
14
  def default_fonts(options)
15
15
  {
16
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
17
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
16
+ bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Arial",sans-serif'),
17
+ headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Arial",sans-serif'),
18
18
  monospacefont: '"Courier New",monospace',
19
19
  normalfontsize: "10.0pt",
20
20
  footnotefontsize: "8.0pt",
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.2.12"
3
+ VERSION = "1.2.17"
4
4
  end
5
5
  end
6
6
 
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = "metanorma-iec lets you write IEC standards "\
14
14
  "in AsciiDoc."
15
15
  spec.description = <<~DESCRIPTION
16
- metanorma-iso lets you write IEC standards in AsciiDoc syntax.
16
+ metanorma-iec lets you write IEC standards in AsciiDoc syntax.
17
17
 
18
18
  This gem is in active development.
19
19
  DESCRIPTION
@@ -28,16 +28,16 @@ Gem::Specification.new do |spec|
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
29
29
 
30
30
  spec.add_dependency "ruby-jing"
31
- spec.add_dependency "metanorma-iso", "~> 1.6.1"
31
+ spec.add_dependency "metanorma-iso", "~> 1.7.0"
32
32
 
33
33
  spec.add_development_dependency "byebug"
34
34
  spec.add_development_dependency "sassc", "2.4.0"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
36
  spec.add_development_dependency "guard", "~> 2.14"
37
37
  spec.add_development_dependency "guard-rspec", "~> 4.7"
38
- spec.add_development_dependency "rake", "~> 12.0"
38
+ spec.add_development_dependency "rake", "~> 13.0"
39
39
  spec.add_development_dependency "rspec", "~> 3.6"
40
- spec.add_development_dependency "rubocop", "= 0.54.0"
40
+ spec.add_development_dependency "rubocop", "~> 1.5.2"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
43
  spec.add_development_dependency "iev", "~> 0.2.0"
@@ -101,6 +101,7 @@ end
101
101
  :cen-processing: true
102
102
  :secretary: Fred Nerk
103
103
  :interest-to-committees: TC 6121, SC 12
104
+ :obsoletes: ABC; DEF
104
105
  INPUT
105
106
  <?xml version="1.0" encoding="UTF-8"?>
106
107
  <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
@@ -150,6 +151,18 @@ end
150
151
  </organization>
151
152
  </owner>
152
153
  </copyright>
154
+ <relation type='obsoletes'>
155
+ <bibitem>
156
+ <title>--</title>
157
+ <docidentifier>ABC</docidentifier>
158
+ </bibitem>
159
+ </relation>
160
+ <relation type='obsoletes'>
161
+ <bibitem>
162
+ <title>--</title>
163
+ <docidentifier>DEF</docidentifier>
164
+ </bibitem>
165
+ </relation>
153
166
  <ext>
154
167
  <doctype>article</doctype>
155
168
  <horizontal>false</horizontal>
@@ -987,8 +1000,8 @@ OUTPUT
987
1000
  INPUT
988
1001
  html = File.read("test.html", encoding: "utf-8")
989
1002
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
990
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "SimSun", serif;]m)
991
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "SimHei", sans-serif;]m)
1003
+ expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
1004
+ expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
992
1005
  end
993
1006
 
994
1007
  it "uses specified fonts" do
@@ -15,41 +15,42 @@ RSpec.describe Asciidoctor::Iec do
15
15
 
16
16
  it "generates error file" do
17
17
  expect do
18
+ mock_pdf
18
19
  Metanorma::Compile
19
20
  .new
20
- .compile("spec/assets/xref_error.adoc", type: "iec")
21
+ .compile("spec/assets/xref_error.adoc", type: "iec", no_install_fonts: true)
21
22
  end.to(change { File.exist?("spec/assets/xref_error.err") }
22
23
  .from(false).to(true))
23
24
  end
24
25
  end
25
26
 
26
- it "Warns of illegal doctype" do
27
+ it "Warns of illegal doctype" do
27
28
  FileUtils.rm_f "test.err"
28
29
  Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
29
- = Document title
30
- Author
31
- :docfile: test.adoc
32
- :nodoc:
33
- :no-isobib:
34
- :doctype: pizza
30
+ = Document title
31
+ Author
32
+ :docfile: test.adoc
33
+ :nodoc:
34
+ :no-isobib:
35
+ :doctype: pizza
35
36
 
36
- text
37
- INPUT
37
+ text
38
+ INPUT
38
39
  expect(File.read("test.err")).to include "pizza is not a recognised document type"
39
- end
40
+ end
40
41
 
41
- it "Warns of illegal function" do
42
+ it "Warns of illegal function" do
42
43
  FileUtils.rm_f "test.err"
43
44
  Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
44
- = Document title
45
- Author
46
- :docfile: test.adoc
47
- :nodoc:
48
- :no-isobib:
49
- :function: pizza
45
+ = Document title
46
+ Author
47
+ :docfile: test.adoc
48
+ :nodoc:
49
+ :no-isobib:
50
+ :function: pizza
50
51
 
51
- text
52
- INPUT
52
+ text
53
+ INPUT
53
54
  expect(File.read("test.err")).to include "pizza is not a recognised document function"
54
- end
55
+ end
55
56
  end
@@ -32,8 +32,8 @@ RSpec.describe IsoDoc::Iec do
32
32
  INPUT
33
33
  html = File.read("test.html", encoding: "utf-8")
34
34
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
35
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "SimSun", serif;]m)
36
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "SimHei", sans-serif;]m)
35
+ expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
36
+ expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
37
37
  end
38
38
 
39
39
  it "processes isodoc as ISO: user nominated fonts" do
data/spec/spec_helper.rb CHANGED
@@ -261,6 +261,12 @@ def stub_fetch_ref(**opts)
261
261
  end.at_least :once
262
262
  end
263
263
 
264
+ def mock_pdf
265
+ allow(::Mn2pdf).to receive(:convert) do |url, output, c, d|
266
+ FileUtils.cp(url.gsub(/"/, ""), output.gsub(/"/, ""))
267
+ end
268
+ end
269
+
264
270
  private
265
271
 
266
272
  def get_xml(search, code, opts)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.12
4
+ version: 1.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.1
33
+ version: 1.7.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.1
40
+ version: 1.7.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '12.0'
117
+ version: '13.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '12.0'
124
+ version: '13.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '='
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.54.0
145
+ version: 1.5.2
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '='
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.54.0
152
+ version: 1.5.2
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -193,7 +193,7 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: 0.2.0
195
195
  description: |
196
- metanorma-iso lets you write IEC standards in AsciiDoc syntax.
196
+ metanorma-iec lets you write IEC standards in AsciiDoc syntax.
197
197
 
198
198
  This gem is in active development.
199
199
  email:
@@ -307,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  - !ruby/object:Gem::Version
308
308
  version: '0'
309
309
  requirements: []
310
- rubygems_version: 3.0.3
310
+ rubygems_version: 3.1.4
311
311
  signing_key:
312
312
  specification_version: 4
313
313
  summary: metanorma-iec lets you write IEC standards in AsciiDoc.