inkmake 0.1.0 → 0.1.1
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/inkmake.rb +17 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdeb5f4c1fa671f1b808a4f52e29753beb8e4be9
|
4
|
+
data.tar.gz: 169fdc73075e5fd42383a7db0fb6a8b7d92bb465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a22adc571cfc31b553f149bc2c10205a577d4c6dbde966120642cd22f3fa142f620834fe6938c0283a57f3fcb65425ac98dbfe480ece43a015f3efb7d20577fb
|
7
|
+
data.tar.gz: 8788db74b0632df20cec91427c1214ef034a83b8992db9e7c7abb563ae95f2b240a937978e805b67e694dc1d2b7ca1d6d9e0027114a3ca7c16851d5d04f4a9ec
|
data/lib/inkmake.rb
CHANGED
@@ -42,6 +42,7 @@ require "fileutils"
|
|
42
42
|
require "tempfile"
|
43
43
|
require "uri"
|
44
44
|
require "pathname"
|
45
|
+
require "rbconfig"
|
45
46
|
|
46
47
|
class Inkmake
|
47
48
|
@verbose = false
|
@@ -120,8 +121,18 @@ class Inkmake
|
|
120
121
|
quit
|
121
122
|
end
|
122
123
|
|
124
|
+
def is_windows
|
125
|
+
@is_windows ||= (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) != nil
|
126
|
+
end
|
127
|
+
|
123
128
|
def open
|
124
|
-
|
129
|
+
if is_windows
|
130
|
+
# Inkscape on Windows for some reason needs to run from its binary dir
|
131
|
+
@in, @out, @err = Open3.popen3(*[File.basename(self.class.path), "--shell"],
|
132
|
+
:chdir => File.dirname(self.class.path))
|
133
|
+
else
|
134
|
+
@in, @out, @err = Open3.popen3(*[self.class.path, "--shell"])
|
135
|
+
end
|
125
136
|
loop do
|
126
137
|
case response
|
127
138
|
when :prompt then break
|
@@ -171,7 +182,11 @@ class Inkmake
|
|
171
182
|
"--export-png" => Tempfile.new("inkmake").path,
|
172
183
|
"--export-area" => "0.0:0.0:1.0:1.0",
|
173
184
|
})
|
174
|
-
|
185
|
+
loop do
|
186
|
+
case response
|
187
|
+
when :prompt then break
|
188
|
+
end
|
189
|
+
end
|
175
190
|
@decimal_symbol = "."
|
176
191
|
rescue EOFError
|
177
192
|
@decimal_symbol = ","
|