Skip to content

Commit

Permalink
Fix INFO command parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
titanous committed Jun 16, 2012
1 parent d019dd0 commit ee5b629
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/em-hiredis/client.rb
Expand Up @@ -142,8 +142,8 @@ def info(&blk)
hash_processor = lambda do |response| hash_processor = lambda do |response|
info = {} info = {}
response.each_line do |line| response.each_line do |line|
key, value = line.split(":", 2) key, value = line.chomp.split(":", 2)
info[key.to_sym] = value.chomp info[key.to_sym] = value if value && key =~ /^[^#]/
end end
blk.call(info) blk.call(info)
end end
Expand Down
2 changes: 1 addition & 1 deletion spec/redis_commands_spec.rb
Expand Up @@ -611,7 +611,7 @@
it "provides info (INFO)" do it "provides info (INFO)" do
connect do |redis| connect do |redis|
redis.info do |r| redis.info do |r|
[:last_save_time, :redis_version, :total_connections_received, :connected_clients, :total_commands_processed, :connected_slaves, :uptime_in_seconds, :used_memory, :uptime_in_days, :changes_since_last_save].each do |x| [:redis_version, :total_connections_received, :connected_clients, :total_commands_processed, :connected_slaves, :uptime_in_seconds, :used_memory, :uptime_in_days].each do |x|
r.keys.include?(x).should == true r.keys.include?(x).should == true
end end
done done
Expand Down

0 comments on commit ee5b629

Please sign in to comment.