Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Created June 15, 2010 03:10
Show Gist options
  • Select an option

  • Save ryanbriones/438649 to your computer and use it in GitHub Desktop.

Select an option

Save ryanbriones/438649 to your computer and use it in GitHub Desktop.
# mcp:(~) ryanbriones$ irb
>> require 'redis'
=> true
>> r = Redis.new
=> #<Redis::Client:0x1005d86e8 @timeout=5, @thread_safe=nil, @port=6379, @host="127.0.0.1", @pubsub=false, @db=0, @binary_keys=nil, @logger=nil, @password=nil, @sock=nil>
>> r.set("test1", "foo")
=> "OK"
>> r.set("test2", "bar")
=> "OK"
>> r.mget(["test1", "test2"])
=> ["foo", "bar"]
>> r.mget("test1", "test2")
=> ["foo", "bar"]
>> r.info
=> {"connected_clients"=>"1", "bgsave_in_progress"=>"0", "role"=>"master", "uptime_in_days"=>"0", "used_memory"=>"6272", "db0"=>" keys=2,expires=0", "connected_slaves"=>"0", "total_connections_received"=>"1", "last_save_time"=>"1276571302", "uptime_in_seconds"=>"191", "total_commands_processed"=>"4", "changes_since_last_save"=>"2", "redis_version"=>"1.02"}
>> Redis::VERSION
=> "1.0.7"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment