metanorma-iso 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +1 -1
- data/lib/asciidoctor/iso/front.rb +4 -4
- data/lib/asciidoctor/iso/validate_section.rb +10 -0
- data/lib/isodoc/iso/i18n-en.yaml +0 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/base_spec.rb +3 -11
- data/spec/asciidoctor-iso/validate_spec.rb +87 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc868b1792a227210079cc57a26f3d6a149738feb8cc1003a081f2db6a8c035
|
4
|
+
data.tar.gz: 4ce69ed98d486e5618ad68bbac05b6b8589d8ac7b1b76bff90c4bed08b242315
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a759e049bbc37f0b3027a7ff7ed012e123645c28099e9b4c9af86cc3da964e7b121f69c4ae0d4b0d9d9a804009bb93c368716ad115ff45a761fa0d3cec89245
|
7
|
+
data.tar.gz: cc1c85767b13826f10d1289621379892722166aa38008009577be1c6703b3ad194870db780f050457e73e0f76b301186d64469c935007c56539c23f78651bc17
|
@@ -39,7 +39,7 @@ jobs:
|
|
39
39
|
polling_interval_seconds: 5
|
40
40
|
timeout_minutes: 5
|
41
41
|
max_attempts: 3
|
42
|
-
command: sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
|
42
|
+
command: sudo apt-get update -y && sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
|
43
43
|
- name: Run specs
|
44
44
|
run: |
|
45
45
|
bundle exec rake
|
@@ -34,7 +34,7 @@ module Asciidoctor
|
|
34
34
|
|
35
35
|
def metadata_author(node, xml)
|
36
36
|
publishers = node.attr("publisher") || "ISO"
|
37
|
-
publishers
|
37
|
+
csv_split(publishers).each do |p|
|
38
38
|
xml.contributor do |c|
|
39
39
|
c.role **{ type: "author" }
|
40
40
|
c.organization { |a| organization(a, p) }
|
@@ -44,7 +44,7 @@ module Asciidoctor
|
|
44
44
|
|
45
45
|
def metadata_publisher(node, xml)
|
46
46
|
publishers = node.attr("publisher") || "ISO"
|
47
|
-
publishers
|
47
|
+
csv_split(publishers).each do |p|
|
48
48
|
xml.contributor do |c|
|
49
49
|
c.role **{ type: "publisher" }
|
50
50
|
c.organization { |a| organization(a, p) }
|
@@ -53,8 +53,8 @@ module Asciidoctor
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def metadata_copyright(node, xml)
|
56
|
-
publishers = node.attr("publisher") || "ISO"
|
57
|
-
publishers
|
56
|
+
publishers = node.attr("copyright-holder") || node.attr("publisher") || "ISO"
|
57
|
+
csv_split(publishers).each do |p|
|
58
58
|
xml.copyright do |c|
|
59
59
|
c.from (node.attr("copyright-year") || Date.today.year)
|
60
60
|
c.owner do |owner|
|
@@ -7,6 +7,7 @@ module Asciidoctor
|
|
7
7
|
foreword_validate(doc.root)
|
8
8
|
normref_validate(doc.root)
|
9
9
|
symbols_validate(doc.root)
|
10
|
+
sections_presence_validate(doc.root)
|
10
11
|
sections_sequence_validate(doc.root)
|
11
12
|
section_style(doc.root)
|
12
13
|
subclause_validate(doc.root)
|
@@ -55,6 +56,15 @@ module Asciidoctor
|
|
55
56
|
names
|
56
57
|
end
|
57
58
|
|
59
|
+
def sections_presence_validate(root)
|
60
|
+
root.at("//sections/clause[@type = 'scope']") or
|
61
|
+
@log.add("Style", nil, "Scope clause missing")
|
62
|
+
root.at("//references[@normative = 'true']") or
|
63
|
+
@log.add("Style", nil, "Normative references missing")
|
64
|
+
root.at("//terms") or
|
65
|
+
@log.add("Style", nil, "Terms & definitions missing")
|
66
|
+
end
|
67
|
+
|
58
68
|
# spec of permissible section sequence
|
59
69
|
# we skip normative references, it goes to end of list
|
60
70
|
SEQ =
|
data/lib/isodoc/iso/i18n-en.yaml
CHANGED
@@ -186,6 +186,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
186
186
|
:language: el
|
187
187
|
:script: Grek
|
188
188
|
:publisher: IEC,IETF,ISO
|
189
|
+
:copyright-holder: ISO,IETF
|
189
190
|
:copyright-year: 2001
|
190
191
|
:doctype: technical-report
|
191
192
|
INPUT
|
@@ -248,8 +249,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
248
249
|
<from>2001</from>
|
249
250
|
<owner>
|
250
251
|
<organization>
|
251
|
-
<name>International
|
252
|
-
<abbreviation>
|
252
|
+
<name>International Organization for Standardization</name>
|
253
|
+
<abbreviation>ISO</abbreviation>
|
253
254
|
</organization>
|
254
255
|
</owner>
|
255
256
|
</copyright>
|
@@ -261,15 +262,6 @@ RSpec.describe Asciidoctor::ISO do
|
|
261
262
|
</organization>
|
262
263
|
</owner>
|
263
264
|
</copyright>
|
264
|
-
<copyright>
|
265
|
-
<from>2001</from>
|
266
|
-
<owner>
|
267
|
-
<organization>
|
268
|
-
<name>International Organization for Standardization</name>
|
269
|
-
<abbreviation>ISO</abbreviation>
|
270
|
-
</organization>
|
271
|
-
</owner>
|
272
|
-
</copyright>
|
273
265
|
<ext>
|
274
266
|
<doctype>technical-report</doctype>
|
275
267
|
<editorialgroup>
|
@@ -3,6 +3,93 @@ require "fileutils"
|
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::ISO do
|
5
5
|
|
6
|
+
it "Warns of missing scope" do
|
7
|
+
FileUtils.rm_f "test.err"
|
8
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
9
|
+
= Document title
|
10
|
+
Author
|
11
|
+
:docfile: test.adoc
|
12
|
+
:nodoc:
|
13
|
+
:no-isobib:
|
14
|
+
:doctype: pizza
|
15
|
+
|
16
|
+
text
|
17
|
+
INPUT
|
18
|
+
expect(File.read("test.err")).to include "Scope clause missing"
|
19
|
+
FileUtils.rm_f "test.err"
|
20
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
21
|
+
= Document title
|
22
|
+
Author
|
23
|
+
:docfile: test.adoc
|
24
|
+
:nodoc:
|
25
|
+
:no-isobib:
|
26
|
+
:doctype: pizza
|
27
|
+
|
28
|
+
== Scope
|
29
|
+
INPUT
|
30
|
+
expect(File.read("test.err")).not_to include "Scope clause missing"
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
it "Warns of missing normative references" do
|
35
|
+
FileUtils.rm_f "test.err"
|
36
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
37
|
+
= Document title
|
38
|
+
Author
|
39
|
+
:docfile: test.adoc
|
40
|
+
:nodoc:
|
41
|
+
:no-isobib:
|
42
|
+
:doctype: pizza
|
43
|
+
|
44
|
+
text
|
45
|
+
INPUT
|
46
|
+
expect(File.read("test.err")).to include "Normative references missing"
|
47
|
+
FileUtils.rm_f "test.err"
|
48
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
49
|
+
= Document title
|
50
|
+
Author
|
51
|
+
:docfile: test.adoc
|
52
|
+
:nodoc:
|
53
|
+
:no-isobib:
|
54
|
+
:doctype: pizza
|
55
|
+
|
56
|
+
[bibliography]
|
57
|
+
== Normative references
|
58
|
+
INPUT
|
59
|
+
expect(File.read("test.err")).not_to include "Normative references missing"
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
it "Warns of missing terms & definitions" do
|
64
|
+
FileUtils.rm_f "test.err"
|
65
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
66
|
+
= Document title
|
67
|
+
Author
|
68
|
+
:docfile: test.adoc
|
69
|
+
:nodoc:
|
70
|
+
:no-isobib:
|
71
|
+
:doctype: pizza
|
72
|
+
|
73
|
+
text
|
74
|
+
INPUT
|
75
|
+
expect(File.read("test.err")).to include "Terms & definitions missing"
|
76
|
+
FileUtils.rm_f "test.err"
|
77
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
78
|
+
= Document title
|
79
|
+
Author
|
80
|
+
:docfile: test.adoc
|
81
|
+
:nodoc:
|
82
|
+
:no-isobib:
|
83
|
+
:doctype: pizza
|
84
|
+
|
85
|
+
== Terms and definitions
|
86
|
+
=== Term 1
|
87
|
+
INPUT
|
88
|
+
expect(File.read("test.err")).not_to include "Terms & definitions missing"
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
|
6
93
|
it "Warns of illegal doctype" do
|
7
94
|
FileUtils.rm_f "test.err"
|
8
95
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
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.5.
|
4
|
+
version: 1.5.2
|
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-
|
11
|
+
date: 2020-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|