diff --git a/CHANGELOG.md b/CHANGELOG.md index c6e8537..3228984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +0.2.3 +----- + +- It will raise error when call ImageMagick failed. + 0.2.2 ----- diff --git a/Gemfile.lock b/Gemfile.lock index a210923..4cbba90 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rucaptcha (0.2.0) + rucaptcha (0.2.3) posix-spawn (>= 0.3.0) GEM diff --git a/lib/rucaptcha/captcha.rb b/lib/rucaptcha/captcha.rb index ea4790d..e0c5002 100644 --- a/lib/rucaptcha/captcha.rb +++ b/lib/rucaptcha/captcha.rb @@ -44,9 +44,10 @@ module RuCaptcha CODE command.strip! - # puts command pid, stdin, stdout, stderr = POSIX::Spawn.popen4(command) Process.waitpid(pid) + err = stderr.read + raise "RuCaptcha: #{err.strip}" if err != nil && err.length > 0 stdout.read end end diff --git a/lib/rucaptcha/version.rb b/lib/rucaptcha/version.rb index 9847d88..e385031 100644 --- a/lib/rucaptcha/version.rb +++ b/lib/rucaptcha/version.rb @@ -1,3 +1,3 @@ module RuCaptcha - VERSION = '0.2.2' + VERSION = '0.2.3' end