vectory 0.7.0 → 0.7.1
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
- 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: 208113512c63f1549e160d037bf418c61ce1495cd4475fc517adaa8f962fe5e3
|
4
|
+
data.tar.gz: bbabf9cb905e9c08706d350e476feba0f8403becd943910bf704edcf80cc2a21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7e5fd2ad0686242cc2c578e16f9456bf15fb95128e9ad26ee95a55cbee4a22edc06d4c8dc50a19f7c63954b2dff8ebfc99091a79e9099b8ac6aa4d574ab0b87
|
7
|
+
data.tar.gz: f25e2881b8d25b8ba3b9351fd7d613247e8489a9deeba557d9a3f259cb919b5e89beda150ae6069fc62d571d0acc55fd664456b6d9bfa935e254c033c749cb00
|
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
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.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: 2024-01-
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emf2svg
|