metanorma-utils 1.6.1 → 1.6.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/utils/image.rb +5 -10
- data/lib/utils/log.rb +5 -1
- data/lib/utils/main.rb +1 -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: cbe101c56bac70e6543c03f11abc88c0a1ea7645220c0b4f375f679956d507ae
|
4
|
+
data.tar.gz: f9d7c68df7145fa585c6af6a253ccc1e587b841cbdc619fe4ace584026723623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c2cf454f5fdf77753856c0e353b265b0f113a5adfd69cf17d654c774045c0a3623f34fb12255603da238f04448a68160d6c28a87c9ee4f0b2202a4ea4d7a01a
|
7
|
+
data.tar.gz: d851a8005f82a55211329bce7fe957e126a8e913d249919a542a525bbb8119fae9fdb34d243364530db174e7e256dc2286f7c66f112bd274b3648e496e84c5d4
|
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,11 @@ module Metanorma
|
|
17
17
|
item = create_entry(loc, msg)
|
18
18
|
@log[category] << item
|
19
19
|
loc = loc.nil? ? "" : "(#{current_location(loc)}): "
|
20
|
-
warn "#{category}: #{loc}#{msg}"
|
20
|
+
suppress_display?(category, loc, msg) or warn "#{category}: #{loc}#{msg}"
|
21
|
+
end
|
22
|
+
|
23
|
+
def suppress_display?(category, loc, msg)
|
24
|
+
["Metanorma XML Syntax"].include?(category)
|
21
25
|
end
|
22
26
|
|
23
27
|
def create_entry(loc, msg)
|
data/lib/utils/main.rb
CHANGED
@@ -135,7 +135,7 @@ module Metanorma
|
|
135
135
|
# with soft hyphen
|
136
136
|
def break_up_long_str(text, threshold = LONGSTR_THRESHOLD, nopunct = LONGSTR_NOPUNCT)
|
137
137
|
/^\s*$/.match?(text) and return text
|
138
|
-
text.split(/(
|
138
|
+
text.split(/(?=(?:\s|-))/).map do |w|
|
139
139
|
if /^\s*$/.match(text) || (w.size < threshold) then w
|
140
140
|
else
|
141
141
|
w.scan(/.{,#{threshold}}/o).map.with_index do |w1, i|
|
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.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: 2023-10
|
11
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|