Simple RedisToGo connection

I did this many times before, but it keeps cropping up (I’m not at all sure why.) Here it is…

require 'rubygems'
require 'uri'
require 'redis'

#RedisToGo gives you the "redis://" uri.
uri = URI.parse('redis://username:password@host:1234/')
unless uri.nil?
  p uri.port
  p uri.password
  p '---'
  r = =>, :port => uri.port, :password => uri.password, :thread_safe => true)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s