# File lib/dm-redis-adapter/adapter.rb, line 345 def initialize(name, uri_or_options) uri_or_options.delete_if { |k,v| v.nil? || (v.is_a?(String) && v == '') } # If the :path ends in '.sock' assume that this really is a path, otherwise assume it's a DB name uri_or_options.delete(:path) if uri_or_options[:path] == '/' if uri_or_options[:path] && !uri_or_options[:path].match(/\.sock$/) uri_or_options[:db] = uri_or_options.delete(:path) end # Parse options from the URI's query string if uri_or_options[:query] opts = uri_or_options[:query].split(/&/) uri_or_options.merge!(Hash[opts.collect { |x| x.split(/=/) }]) uri_or_options.delete(:query) end super @redis = Redis.new(@options) end