Raise error when call ImageMagick failed, version 0.2.3

This commit is contained in:
Jason Lee 2015-11-02 14:11:28 +08:00
parent a6ec9813e6
commit 62f589e9fc
4 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
0.2.3
-----
- It will raise error when call ImageMagick failed.
0.2.2 0.2.2
----- -----

View File

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
rucaptcha (0.2.0) rucaptcha (0.2.3)
posix-spawn (>= 0.3.0) posix-spawn (>= 0.3.0)
GEM GEM

View File

@ -44,9 +44,10 @@ module RuCaptcha
CODE CODE
command.strip! command.strip!
# puts command
pid, stdin, stdout, stderr = POSIX::Spawn.popen4(command) pid, stdin, stdout, stderr = POSIX::Spawn.popen4(command)
Process.waitpid(pid) Process.waitpid(pid)
err = stderr.read
raise "RuCaptcha: #{err.strip}" if err != nil && err.length > 0
stdout.read stdout.read
end end
end end

View File

@ -1,3 +1,3 @@
module RuCaptcha module RuCaptcha
VERSION = '0.2.2' VERSION = '0.2.3'
end end