metanorma-iso 1.8.2 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iso/biblio.rng +1 -0
- data/lib/asciidoctor/iso/isodoc.rng +1 -3
- data/lib/asciidoctor/iso/validate_section.rb +16 -9
- data/lib/isodoc/iso/iso.amendment.xsl +166 -111
- data/lib/isodoc/iso/iso.international-standard.xsl +166 -111
- data/lib/isodoc/iso/xref.rb +3 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/asciidoctor/blocks_spec.rb +96 -34
- data/spec/asciidoctor/validate_spec.rb +47 -0
- data/spec/spec_helper.rb +16 -15
- metadata +4 -4
@@ -1144,6 +1144,53 @@ RSpec.describe Asciidoctor::ISO do
|
|
1144
1144
|
.not_to include "Document must include (references) Normative References"
|
1145
1145
|
end
|
1146
1146
|
|
1147
|
+
it "Warning if there are two Terms sections" do
|
1148
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1149
|
+
#{VALIDATING_BLANK_HDR}
|
1150
|
+
|
1151
|
+
== Scope
|
1152
|
+
|
1153
|
+
== Terms and definitions
|
1154
|
+
|
1155
|
+
== A Clause
|
1156
|
+
|
1157
|
+
[heading=terms and definitions]
|
1158
|
+
== Terms related to clinical psychology
|
1159
|
+
|
1160
|
+
INPUT
|
1161
|
+
expect(File.read("test.err"))
|
1162
|
+
.to include "Only annexes and references can follow clauses"
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
it "No warning if there are two Terms sections in a Vocabulary document" do
|
1166
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1167
|
+
= Document title
|
1168
|
+
Author
|
1169
|
+
:docfile: test.adoc
|
1170
|
+
:nodoc:
|
1171
|
+
:no-isobib:
|
1172
|
+
:docsubtype: vocabulary
|
1173
|
+
|
1174
|
+
== Scope
|
1175
|
+
|
1176
|
+
== Terms and definitions
|
1177
|
+
|
1178
|
+
== A Clause
|
1179
|
+
|
1180
|
+
[heading=terms and definitions]
|
1181
|
+
== Terms related to clinical psychology
|
1182
|
+
|
1183
|
+
[heading=symbols and abbreviated terms]
|
1184
|
+
== Symbols related to clinical psychology
|
1185
|
+
|
1186
|
+
INPUT
|
1187
|
+
expect(File.read("test.err"))
|
1188
|
+
.not_to include "Only annexes and references can follow clauses"
|
1189
|
+
expect(File.read("test.err"))
|
1190
|
+
.to include "Only terms, annexes and references can follow clauses"
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
|
1147
1194
|
it "Warning if final section is not named Bibliography" do
|
1148
1195
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1149
1196
|
#{VALIDATING_BLANK_HDR}
|
data/spec/spec_helper.rb
CHANGED
@@ -24,16 +24,14 @@ RSpec.configure do |config|
|
|
24
24
|
c.syntax = :expect
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
36
|
-
=end
|
27
|
+
# config.around do |example|
|
28
|
+
# Dir.mktmpdir("rspec-") do |dir|
|
29
|
+
# tmp_assets = File.join(dir, "spec/assets/")
|
30
|
+
# FileUtils.mkdir_p tmp_assets
|
31
|
+
# FileUtils.cp_r Dir.glob("spec/assets/*"), tmp_assets
|
32
|
+
# Dir.chdir(dir) { example.run }
|
33
|
+
# end
|
34
|
+
# end
|
37
35
|
end
|
38
36
|
|
39
37
|
def strip_guid(xml)
|
@@ -120,22 +118,25 @@ VALIDATING_BLANK_HDR = <<~"HDR".freeze
|
|
120
118
|
:no-isobib:
|
121
119
|
HDR
|
122
120
|
|
123
|
-
ASCIIDOCTOR_ISO_DIR = Pathname
|
121
|
+
ASCIIDOCTOR_ISO_DIR = Pathname
|
122
|
+
.new(File.dirname(__FILE__)) / "../lib/asciidoctor/iso"
|
124
123
|
|
125
124
|
BOILERPLATE =
|
126
125
|
HTMLEntities.new.decode(
|
127
126
|
File.read(ASCIIDOCTOR_ISO_DIR / "boilerplate.xml", encoding: "utf-8")
|
128
|
-
.gsub(/\{\{ agency \}\}/, "ISO")
|
127
|
+
.gsub(/\{\{ agency \}\}/, "ISO")
|
128
|
+
.gsub(/\{\{ docyear \}\}/, Date.today.year.to_s)
|
129
129
|
.gsub(/\{% if unpublished %\}.*\{% endif %\}/m, "")
|
130
|
-
.gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’")
|
130
|
+
.gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’"),
|
131
131
|
)
|
132
132
|
|
133
133
|
BOILERPLATE_FR =
|
134
134
|
HTMLEntities.new.decode(
|
135
135
|
File.read(ASCIIDOCTOR_ISO_DIR / "boilerplate-fr.xml", encoding: "utf-8")
|
136
|
-
.gsub(/\{\{ agency \}\}/, "ISO")
|
136
|
+
.gsub(/\{\{ agency \}\}/, "ISO")
|
137
|
+
.gsub(/\{\{ docyear \}\}/, Date.today.year.to_s)
|
137
138
|
.gsub(/\{% if unpublished %\}.*\{% endif %\}/m, "")
|
138
|
-
.gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’")
|
139
|
+
.gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’"),
|
139
140
|
)
|
140
141
|
|
141
142
|
BLANK_HDR1 = <<~"HDR".freeze
|
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.8.
|
4
|
+
version: 1.8.3
|
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-05-
|
11
|
+
date: 2021-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: isodoc
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.8.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: 1.
|
54
|
+
version: 1.8.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: ruby-jing
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|