vectory 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Rakefile +0 -4
- data/exe/vectory +8 -0
- data/lib/vectory/inkscape_converter.rb +0 -2
- data/lib/vectory/utils.rb +0 -48
- data/lib/vectory/version.rb +1 -1
- data/spec/support/vectory_helper.rb +0 -1
- data/vectory.gemspec +1 -5
- metadata +9 -51
- data/emf.emf +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3691d655d3fd1a29fc05a8efc5862bf6c401b2ea2e46a6cf3b6870a0088042a
|
4
|
+
data.tar.gz: a400645b7d70451dd894f9b8e68a44adc69cbd268739c1bdcc1dc096cef568af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e3b018076e90a60d9a04bf0aea7d7c839f69edd013f087f432302089cbae06439df73adf813bb62c8a88e2c62cbec7253c385024866f8e341269bdc7661ebdb
|
7
|
+
data.tar.gz: 27a3e056f5bbf9b96ba3dda57aa2e68c7b1981b44049916ae39bbaa2055541a00388e17e006f72f6baff58d7748e50b180a65d1cc4aae8aa05b637cf90ebdff5
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/exe/vectory
ADDED
data/lib/vectory/utils.rb
CHANGED
@@ -1,58 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "marcel"
|
4
3
|
require "timeout"
|
5
4
|
|
6
5
|
module Vectory
|
7
6
|
class Utils
|
8
|
-
# Extracted from https://github.com/metanorma/metanorma-utils/blob/v1.5.2/lib/utils/image.rb
|
9
7
|
class << self
|
10
|
-
# sources/plantuml/plantuml20200524-90467-1iqek5i.png
|
11
|
-
# already includes localdir
|
12
|
-
# Check whether just the local path or the other specified relative path
|
13
|
-
# works.
|
14
|
-
def datauri(uri, local_dir = ".")
|
15
|
-
return uri if datauri?(uri) || url?(uri)
|
16
|
-
|
17
|
-
options = absolute_path?(uri) ? [uri] : [uri, File.join(local_dir, uri)]
|
18
|
-
path = options.detect do |p|
|
19
|
-
File.exist?(p) ? p : nil
|
20
|
-
end
|
21
|
-
|
22
|
-
unless path
|
23
|
-
warn "Image specified at `#{uri}` does not exist."
|
24
|
-
return uri # Return original provided location
|
25
|
-
end
|
26
|
-
|
27
|
-
encode_datauri(path)
|
28
|
-
end
|
29
|
-
|
30
|
-
def encode_datauri(path)
|
31
|
-
return nil unless File.exist?(path)
|
32
|
-
|
33
|
-
type = Marcel::MimeType.for(Pathname.new(path)) ||
|
34
|
-
'text/plain; charset="utf-8"'
|
35
|
-
|
36
|
-
bin = File.binread(path)
|
37
|
-
data = Base64.strict_encode64(bin)
|
38
|
-
"data:#{type};base64,#{data}"
|
39
|
-
rescue StandardError
|
40
|
-
warn "Data-URI encoding of `#{path}` failed."
|
41
|
-
nil
|
42
|
-
end
|
43
|
-
|
44
|
-
def datauri?(uri)
|
45
|
-
/^data:/.match?(uri)
|
46
|
-
end
|
47
|
-
|
48
|
-
def url?(url)
|
49
|
-
%r{^[A-Z]{2,}://}i.match?(url)
|
50
|
-
end
|
51
|
-
|
52
|
-
def absolute_path?(uri)
|
53
|
-
%r{^/}.match?(uri) || %r{^[A-Z]:/}.match?(uri)
|
54
|
-
end
|
55
|
-
|
56
8
|
# rubocop:disable all
|
57
9
|
#
|
58
10
|
# Originally from https://gist.github.com/pasela/9392115
|
data/lib/vectory/version.rb
CHANGED
data/vectory.gemspec
CHANGED
@@ -24,10 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.required_ruby_version = ">= 2.5.0"
|
25
25
|
|
26
26
|
spec.add_runtime_dependency "emf2svg"
|
27
|
+
spec.add_runtime_dependency "nokogiri", "~> 1.14"
|
27
28
|
spec.add_runtime_dependency "thor", "~> 1.2.1"
|
28
|
-
spec.add_runtime_dependency "marcel", "~> 1.0.0"
|
29
|
-
|
30
|
-
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
31
|
-
spec.add_development_dependency "htmlentities", "~> 4.3.4"
|
32
|
-
spec.add_development_dependency "nokogiri", "~> 1.14"
|
33
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vectory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emf2svg
|
@@ -25,75 +25,33 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: '1.14'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: '1.14'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.2.1
|
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.
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: equivalent-xml
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.6'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0.6'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: htmlentities
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 4.3.4
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 4.3.4
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: nokogiri
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.14'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.14'
|
54
|
+
version: 1.2.1
|
97
55
|
description: |
|
98
56
|
Vectory performs pairwise vector image conversions for common
|
99
57
|
vector image formats, such as SVG, EMF, EPS and PS.
|
@@ -113,7 +71,7 @@ files:
|
|
113
71
|
- README.adoc
|
114
72
|
- Rakefile
|
115
73
|
- bin/vectory
|
116
|
-
-
|
74
|
+
- exe/vectory
|
117
75
|
- lib/vectory.rb
|
118
76
|
- lib/vectory/cli.rb
|
119
77
|
- lib/vectory/datauri.rb
|
data/emf.emf
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
AQAAAMgAAAAAAAAAAAAAAPsEAAD7BAAAAAAAAAAAAACLCgAAiwoAACBFTUYAAAEAJAQAACgAAAACAAAALgAAAGwAAAAAAAAA3ScAAH0zAADYAAAAFwEAAAAAAAAAAAAAAAAAAMBLAwDYQQQASQBuAGsAcwBjAGEAcABlACAAMQAuADAAIAAoADQAMAAzADUAYQA0AGYALAAgADIAMAAyADAALQAwADUALQAwADEAKQAgAAAAbwBkAGYALgBlAG0AZgAAAAAAAAARAAAADAAAAAEAAAAkAAAAJAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAIAAABGAAAALAAAACAAAABTY3JlZW49MTAyMDV4MTMxODFweCwgMjE2eDI3OW1tAEYAAAAwAAAAIwAAAERyYXdpbmc9MTAwLjB4MTAwLjBweCwgMjYuNXgyNi41bW0AABIAAAAMAAAAAQAAABMAAAAMAAAAAgAAABYAAAAMAAAAGAAAABgAAAAMAAAAAAAAABQAAAAMAAAADQAAACcAAAAYAAAAAQAAAAAAAAAAAJkABgAAACUAAAAMAAAAAQAAADsAAAAIAAAAGwAAABAAAACkBAAAcQIAAAUAAAA0AAAAAAAAAAAAAAD//////////wMAAACkBAAAqAMAAKgDAACkBAAAcQIAAKQEAAAFAAAANAAAAAAAAAAAAAAA//////////8DAAAAOgEAAKQEAAA/AAAAqAMAAD8AAABxAgAABQAAADQAAAAAAAAAAAAAAP//////////AwAAAD8AAAA6AQAAOgEAAD8AAABxAgAAPwAAAAUAAAA0AAAAAAAAAAAAAAD//////////wMAAACoAwAAPwAAAKQEAAA6AQAApAQAAHECAAA9AAAACAAAADwAAAAIAAAAPgAAABgAAAAAAAAAAAAAAP//////////JQAAAAwAAAAFAACAKAAAAAwAAAABAAAAJwAAABgAAAABAAAAAAAAAP///wAGAAAAJQAAAAwAAAABAAAAOwAAAAgAAAAbAAAAEAAAAJ0BAABFAQAANgAAABAAAADPAwAARQEAAAUAAAA0AAAAAAAAAAAAAAD//////////wMAAABfBAAA7QEAAGQEAADjAgAA2wMAAJEDAAAFAAAANAAAAAAAAAAAAAAA//////////8DAAAAUgMAAD4EAABhAgAAcwQAAJ0BAAAOBAAANgAAABAAAACdAQAAyQIAADYAAAAQAAAA4gIAAMkCAAA2AAAAEAAAAOICAAAaAgAANgAAABAAAACdAQAAGgIAAD0AAAAIAAAAPAAAAAgAAAA+AAAAGAAAAAAAAAAAAAAA//////////8lAAAADAAAAAUAAIAoAAAADAAAAAEAAAAOAAAAFAAAAAAAAAAAAAAAJAQAAA==
|