metanorma 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/input/asciidoc.rb +23 -4
- data/lib/metanorma/version.rb +1 -1
- 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: 42020b6888a6b5d4d11678cc5d3d217e93ced978e477d05fee31a6593722f78b
|
4
|
+
data.tar.gz: 4379ba9bcf18655c119598b44ead30f223d843edb33ce53205d4ad6c16826904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67525ff08b409c36a90cc8725dc150a518b2c3888f0b3518cc83113b51dcc739ba89120681fe0c2e36c4c6b8771178afe1abe25c64887aee93b29fb055c82a4e
|
7
|
+
data.tar.gz: c0f35a9f5f0e3b0397fb0f81eaf84b90be85f09af4cb99a25e9ac146e0b9658c0b0c26883015c0a8979d656f12d57f5dc0cb24f1af92fa1cb9c58ba7f5e13a90
|
@@ -7,8 +7,7 @@ module Metanorma
|
|
7
7
|
|
8
8
|
def process(file, filename, type, options = {})
|
9
9
|
require "asciidoctor"
|
10
|
-
|
11
|
-
file,
|
10
|
+
out_opts = {
|
12
11
|
to_file: false,
|
13
12
|
safe: :safe,
|
14
13
|
backend: type,
|
@@ -16,8 +15,28 @@ module Metanorma
|
|
16
15
|
attributes: [
|
17
16
|
"nodoc", "stem", "xrefstyle=short", "docfile=#{filename}",
|
18
17
|
"output_dir=#{options[:"output-dir"]}"
|
19
|
-
]
|
20
|
-
|
18
|
+
]
|
19
|
+
}
|
20
|
+
unless asciidoctor_validate(file, filename, out_opts)
|
21
|
+
warn "Cannot continue compiling Asciidoctor document"
|
22
|
+
abort
|
23
|
+
end
|
24
|
+
::Asciidoctor.convert(file, out_opts)
|
25
|
+
end
|
26
|
+
|
27
|
+
def asciidoctor_validate(file, filename, options)
|
28
|
+
err = nil
|
29
|
+
begin
|
30
|
+
previous_stderr, $stderr = $stderr, StringIO.new
|
31
|
+
::Asciidoctor.load(file, options)
|
32
|
+
%r{(\n|^)asciidoctor: ERROR: ['"]?#{Regexp.escape(filename ||
|
33
|
+
"<empty>")}['"]?: line \d+: include file not found: }.match($stderr.string) and
|
34
|
+
err = $stderr.string
|
35
|
+
ensure
|
36
|
+
$stderr = previous_stderr
|
37
|
+
end
|
38
|
+
warn err unless err.nil?
|
39
|
+
err.nil?
|
21
40
|
end
|
22
41
|
|
23
42
|
def extract_metanorma_options(file)
|
data/lib/metanorma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
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-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|