Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix INFO command parsing

  • Loading branch information...
commit ee5b629771235af6b4898ca81bb84ee8a35cb941 1 parent d019dd0
@titanous authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/em-hiredis/client.rb
  2. +1 −1  spec/redis_commands_spec.rb
View
4 lib/em-hiredis/client.rb
@@ -142,8 +142,8 @@ def info(&blk)
hash_processor = lambda do |response|
info = {}
response.each_line do |line|
- key, value = line.split(":", 2)
- info[key.to_sym] = value.chomp
+ key, value = line.chomp.split(":", 2)
+ info[key.to_sym] = value if value && key =~ /^[^#]/
end
blk.call(info)
end
View
2  spec/redis_commands_spec.rb
@@ -611,7 +611,7 @@
it "provides info (INFO)" do
connect do |redis|
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
end
done
Please sign in to comment.
Something went wrong with that request. Please try again.