+ ConvertToBool = lambda{|r| r == 0 ? false : r}
+
+ ReplyProcessor = {
+ "exists" => ConvertToBool,
+ "sismember"=> ConvertToBool,
+ "sadd"=> ConvertToBool,
+ "srem"=> ConvertToBool,
+ "smove"=> ConvertToBool,
+ "move"=> ConvertToBool,
+ "setnx"=> ConvertToBool,
+ "del"=> ConvertToBool,
+ "renamenx"=> ConvertToBool,
+ "expire"=> ConvertToBool,
+ "keys" => lambda{|r| r.split(" ")},
+ "info" => lambda{|r|
+ info = {}
+ r.each_line {|kv|
+ k,v = kv.split(':', 2)
+ k,v = k.chomp, v = v.chomp
+ info[k.to_sym] = v
+ }
+ info
+ }
+ }
+
+ def convert_to_bool(r)
+ r == 0 ? false : r
+ end
+