Skip to content

Instantly share code, notes, and snippets.

@deepfryed
Created April 3, 2012 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepfryed/2296037 to your computer and use it in GitHub Desktop.
Save deepfryed/2296037 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'readline'
require 'redis'
class Redis::Console
def self.start client
new(client).start
end
def initialize client
@client = client
end
def start
index = 1
while command = Readline.readline("redis :%03d > " % index, true)
puts client.instance_eval(command)
index += 1
end
end
protected
attr_reader :client, :input
end
Redis::Console.start(Redis.connect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment