metanorma-utils 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils/main.rb +7 -4
- 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: 1608e885c3ac31aee00ba254d5f5c84088781a8ce5e8bc34d0a0fa8bf86c879a
|
4
|
+
data.tar.gz: 79454a1aae9b7f3511d8c6b593e62faead745ab9b05e2f36f7d06610c991eb33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f96993c89b0d752fd71f2775d05b012580760165fe55cc50b4b86e621d2c093eed5aa151d87597ce8f745cedb0388cc9370729d0d25f1331aaed439c11b862f
|
7
|
+
data.tar.gz: 0e681cd4f98ba4fdebf683cb410bab222668e872460034b4b03182ba953b14b0b39c3b5ef473c12e4d6ac0ac41f092d6e683210099bb0c0aab665fe240d70c97
|
data/lib/utils/main.rb
CHANGED
@@ -175,12 +175,15 @@ module Metanorma
|
|
175
175
|
result.reject(&:empty?)
|
176
176
|
end
|
177
177
|
|
178
|
-
#
|
179
|
-
# sources/plantuml/plantuml20200524-90467-1iqek5i.png ->
|
180
|
-
# sources/sources/plantuml/plantuml20200524-90467-1iqek5i.png)
|
178
|
+
# sources/plantuml/plantuml20200524-90467-1iqek5i.png already includes localdir
|
181
179
|
def datauri(uri, localdir = ".")
|
182
180
|
return uri if /^data:/.match(uri)
|
183
|
-
path = %r{^([A-Z]:)?/}.match?(uri) ? uri :
|
181
|
+
path = %r{^([A-Z]:)?/}.match?(uri) ? uri :
|
182
|
+
File.exist?(uri) ? uri : File.join(localdir, uri)
|
183
|
+
unless File.exist?(path)
|
184
|
+
warn "image at #{path} not found"
|
185
|
+
return uri
|
186
|
+
end
|
184
187
|
types = MIME::Types.type_for(path)
|
185
188
|
type = types ? types.first.to_s : 'text/plain; charset="utf-8"'
|
186
189
|
bin = File.open(path, 'rb', &:read)
|
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.0.
|
4
|
+
version: 1.0.7
|
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-03-
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sterile
|