From 823d1119b06809bccb7448f244d32ca5c146e8a6 Mon Sep 17 00:00:00 2001 From: Alexey Vasiliev Date: Wed, 13 Mar 2013 21:56:36 +0200 Subject: [PATCH] fix spec and cleanup --- lib/webp/webp.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/webp/webp.rb b/lib/webp/webp.rb index 5cd5200..baabe23 100644 --- a/lib/webp/webp.rb +++ b/lib/webp/webp.rb @@ -29,18 +29,18 @@ def webp_size(data) # encode def encode(input_file, output_file, options = {}) - unless 0 == (res = C.webp_encode(input_file, output_file, init_options_object(options).encode_pointer)) - raise EncoderError, ENCODER_ERRORS[res - 1] + unless 0 == (encode_res = C.webp_encode(input_file, output_file, init_options_object(options).encode_pointer)) + raise EncoderError, ENCODER_ERRORS[encode_res - 1] end - return true + true end # decode def decode(input_file, output_file, options = {}) - unless 0 == (res = C.webp_decode(input_file, output_file, init_options_object(options).decode_pointer)) - raise DecoderError, DECODER_ERRORS[res - 1] + unless 0 == (decode_res = C.webp_decode(input_file, output_file, init_options_object(options).decode_pointer)) + raise DecoderError, DECODER_ERRORS[decode_res - 1] end - return true + true end private