vectory 0.7.0 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vectory/cli.rb +15 -0
- data/lib/vectory/utils.rb +1 -1
- data/lib/vectory/version.rb +1 -1
- data/vectory.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55fbd240e8b8c5e4409e73d720e752c502a1d0700617aa8889c7dca337be989b
|
4
|
+
data.tar.gz: 51a18f30f14a783c9f249a1b8664bf5767f10eb8f7a85aed3d87ca06d4d8d00e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 239f4a3ef419cc72978ee7300867b66978e86f5154918b0a537397ef0ac2a3b1726ac91132c2673c637335c871fb4acecf88a26ff952f26fcd32177208dcb8b8
|
7
|
+
data.tar.gz: 79c93b9aea448ca971a9d4f531a3de7377601f771ee7e8830258cea8a27b5bccd3b9271a743550e84a4e0682fb77ce84e969129a5c6ff4a17faee3c53a087a17
|
data/lib/vectory/cli.rb
CHANGED
@@ -11,6 +11,7 @@ module Vectory
|
|
11
11
|
STATUS_CONVERSION_ERROR = 4
|
12
12
|
STATUS_SYSTEM_CALL_ERROR = 5
|
13
13
|
STATUS_INKSCAPE_NOT_FOUND_ERROR = 6
|
14
|
+
STATUS_SAME_FORMAT_ERROR = 7
|
14
15
|
|
15
16
|
MAP_ERROR_TO_STATUS = {
|
16
17
|
Vectory::ConversionError => STATUS_CONVERSION_ERROR,
|
@@ -62,6 +63,10 @@ module Vectory
|
|
62
63
|
end
|
63
64
|
|
64
65
|
input_format = detect_input_format(file)
|
66
|
+
if same_format?(input_format, options[:format])
|
67
|
+
return same_format_error(options[:format])
|
68
|
+
end
|
69
|
+
|
65
70
|
unless supported_input_format?(input_format)
|
66
71
|
return unsupported_input_format_error
|
67
72
|
end
|
@@ -93,6 +98,16 @@ module Vectory
|
|
93
98
|
FileMagic.detect(file)
|
94
99
|
end
|
95
100
|
|
101
|
+
def same_format?(input_format, output_format)
|
102
|
+
input_format.to_s == output_format
|
103
|
+
end
|
104
|
+
|
105
|
+
def same_format_error(format)
|
106
|
+
Vectory.ui.error("Could not convert to the same format '#{format}'.")
|
107
|
+
|
108
|
+
STATUS_SAME_FORMAT_ERROR
|
109
|
+
end
|
110
|
+
|
96
111
|
def supported_input_format?(format)
|
97
112
|
SupportedInputFormats.all.include?(format)
|
98
113
|
end
|
data/lib/vectory/utils.rb
CHANGED
@@ -19,7 +19,7 @@ module Vectory
|
|
19
19
|
path = path_which_exist(uri, local_dir)
|
20
20
|
path and return encode_datauri(path)
|
21
21
|
|
22
|
-
warn "Image specified at `#{uri}` does not exist."
|
22
|
+
Vectory.ui.warn "Image specified at `#{uri}` does not exist."
|
23
23
|
uri # Return original provided location
|
24
24
|
end
|
25
25
|
|
data/lib/vectory/version.rb
CHANGED
data/vectory.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_runtime_dependency "emf2svg"
|
30
30
|
spec.add_runtime_dependency "image_size", ">= 3.2.0"
|
31
|
-
spec.add_runtime_dependency "marcel", "~> 1.0
|
31
|
+
spec.add_runtime_dependency "marcel", "~> 1.0"
|
32
32
|
spec.add_runtime_dependency "nokogiri", "~> 1.14"
|
33
|
-
spec.add_runtime_dependency "thor", "~> 1.
|
33
|
+
spec.add_runtime_dependency "thor", "~> 1.0"
|
34
34
|
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.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emf2svg
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0
|
47
|
+
version: '1.0'
|
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.0
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: '1.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: '1.0'
|
83
83
|
description: |
|
84
84
|
Vectory performs pairwise vector image conversions for common
|
85
85
|
vector image formats, such as SVG, EMF, EPS and PS.
|