metanorma-utils 1.6.2 → 1.6.4
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/utils/image.rb +5 -10
- data/lib/utils/log.rb +7 -1
- data/lib/utils/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: 57cdd3eb9d930975ba70e75b1a93fa61b071ad0a84f6d9acb9173f39e4ab9461
|
4
|
+
data.tar.gz: 7d7db96c6baf145635b80c7538191582c98acde5d47698e0f5743b706e5c9a8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f32fd8887a434a77e6f99ad81c5dafb8677096787c7fbae70cf4aeac4d5d264913639a9f216aa0793f8f3b7637ff78303372d7c8ee5072c516ca983436a3c47e
|
7
|
+
data.tar.gz: d9434cdece35bd9f95f9366a987d11995c19dca2bf2cd348ab1cf877a3fff96c66f69dc137cebc9d548a3b8c7a01ef3f0d196993b3873e62d58cceea9c277a21
|
data/lib/utils/image.rb
CHANGED
@@ -128,19 +128,14 @@ module Metanorma
|
|
128
128
|
# Check whether just the local path or the other specified relative path
|
129
129
|
# works.
|
130
130
|
def datauri(uri, local_dir = ".")
|
131
|
-
|
132
|
-
|
133
|
-
options = absolute_path?(uri) ? [uri] : [uri, File.join(local_dir, uri)]
|
131
|
+
(datauri?(uri) || url?(uri)) and return uri
|
132
|
+
options = absolute_path?(uri) ? [uri] : [uri, File.join(local_dir, uri)]
|
134
133
|
path = options.detect do |p|
|
135
134
|
File.exist?(p) ? p : nil
|
136
135
|
end
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
return uri # Return original provided location
|
141
|
-
end
|
142
|
-
|
143
|
-
encode_datauri(path)
|
136
|
+
path and return encode_datauri(path)
|
137
|
+
warn "Image specified at `#{uri}` does not exist."
|
138
|
+
uri # Return original provided location
|
144
139
|
end
|
145
140
|
|
146
141
|
def encode_datauri(path)
|
data/lib/utils/log.rb
CHANGED
@@ -17,7 +17,12 @@ module Metanorma
|
|
17
17
|
item = create_entry(loc, msg)
|
18
18
|
@log[category] << item
|
19
19
|
loc = loc.nil? ? "" : "(#{current_location(loc)}): "
|
20
|
-
|
20
|
+
suppress_display?(category, loc, msg) or
|
21
|
+
warn "#{category}: #{loc}#{msg}"
|
22
|
+
end
|
23
|
+
|
24
|
+
def suppress_display?(category, _loc, _msg)
|
25
|
+
["Metanorma XML Syntax"].include?(category)
|
21
26
|
end
|
22
27
|
|
23
28
|
def create_entry(loc, msg)
|
@@ -95,6 +100,7 @@ module Metanorma
|
|
95
100
|
def log_hdr(file)
|
96
101
|
<<~HTML
|
97
102
|
<html><head><title>#{file} errors</title>
|
103
|
+
<meta charset="UTF-8"/>
|
98
104
|
<style> pre { white-space: pre-wrap; } </style>
|
99
105
|
</head><body><h1>#{file} errors</h1>
|
100
106
|
HTML
|
data/lib/utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|