]> git.saurik.com Git - redis.git/commitdiff
RubyRedis info postprocessor rewritten in a more functional way
authorantirez <antirez@gmail.com>
Thu, 21 May 2009 11:51:30 +0000 (13:51 +0200)
committerantirez <antirez@gmail.com>
Thu, 21 May 2009 11:51:30 +0000 (13:51 +0200)
client-libraries/ruby_2/rubyredis.rb

index 620bab179a52563ea61c4e14c6796e3a91a482f3..42e77a083b4af6edc1c619484456dabd5e1ac8e9 100644 (file)
@@ -31,8 +31,7 @@ class RedisClient
         "info" => lambda{|r| 
             info = {}
             r.each_line {|kv|
         "info" => lambda{|r| 
             info = {}
             r.each_line {|kv|
-                k,v = kv.split(':', 2)
-                k,v = k.chomp, v = v.chomp
+                k,v = kv.split(":",2).map{|x| x.chomp}
                 info[k.to_sym] = v
             }
             info
                 info[k.to_sym] = v
             }
             info