Skip to content

Commit

Permalink
Fixed a few places that had redis:/ instead of redis://.
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Jul 2, 2010
1 parent 5ed70eb commit ef6dc4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/vanity/playground.rb
Expand Up @@ -27,13 +27,13 @@ def initialize(*args)
options = args.pop if Hash === args.last
@options = DEFAULTS.merge(options || {})
if @options.values_at(:host, :port, :db).any?
warn "Deprecated: please specify Redis connection as URL (\"redis:/host:port/db\")"
warn "Deprecated: please specify Redis connection as URL (\"redis://host:port/db\")"
establish_connection :adapter=>"redis", :host=>options[:host], :port=>options[:port], :database=>options[:db]
elsif @options[:redis]
@adapter = RedisAdapter.new(:redis=>@options[:redis])
else
connection_spec = args.shift || @options[:connection]
establish_connection "redis:/" + connection_spec if connection_spec
establish_connection "redis://" + connection_spec if connection_spec
end

@namespace = @options[:namespace] || DEFAULTS[:namespace]
Expand Down Expand Up @@ -159,7 +159,7 @@ def track!(id, count = 1)
# Vanity.playground.establish_connection :production
#
# If the argument is a string, it is processed as a URL. For example:
# Vanity.playground.establish_connection "redis:/redis.local/5"
# Vanity.playground.establish_connection "redis://redis.local/5"
#
# Otherwise, the argument is a hash and specifies the adapter name and any
# additional options understood by that adapter (as with config/vanity.yml).
Expand Down Expand Up @@ -191,8 +191,8 @@ def establish_connection(spec = nil)
when String
uri = URI.parse(spec)
params = CGI.parse(uri.query) if uri.query
establish_connection "adapter"=>uri.scheme, "username"=>uri.user, "password"=>uri.password,
"host"=>uri.host, "port"=>uri.port, "path"=>uri.path, "params"=>params
establish_connection :adapter=>uri.scheme, :username=>uri.user, :password=>uri.password,
:host=>uri.host, :port=>uri.port, :path=>uri.path, :params=>params
else
spec = spec.inject({}) { |hash,(k,v)| hash[k.to_sym] = v ; hash }
begin
Expand Down

0 comments on commit ef6dc4b

Please sign in to comment.