<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -182,19 +182,25 @@ module Rack::Cache
       end
 
       def self.resolve(uri)
-        server = &quot;#{uri.host}:#{uri.port || '11211'}&quot;
-        options = parse_query(uri.query)
-        options.keys.each do |key|
-          value =
-            case value = options.delete(key)
-            when 'true' ; true
-            when 'false' ; false
-            else value.to_sym
-            end
-          options[k.to_sym] = value
+        if uri.respond_to?(:scheme)
+          server = &quot;#{uri.host}:#{uri.port || '11211'}&quot;
+          options = parse_query(uri.query)
+          options.keys.each do |key|
+            value =
+              case value = options.delete(key)
+              when 'true' ; true
+              when 'false' ; false
+              else value.to_sym
+              end
+            options[k.to_sym] = value
+          end
+          options[:namespace] = uri.path.sub(/^\//, '')
+          new server, options
+        else
+          # if the object provided is not a URI, pass it straight through
+          # to the underlying implementation.
+          new uri
         end
-        options[:namespace] = uri.path.sub(/^\//, '')
-        new server, options
       end
     end
 </diff>
      <filename>lib/rack/cache/entitystore.rb</filename>
    </modified>
    <modified>
      <diff>@@ -42,9 +42,9 @@ module Rack::Cache
         # hack in support for passing a MemCache or Memcached object
         # as the storage URI.
         case
-        when defined?(::MemCache) &amp;&amp; type.kind_of?(::MemCache)
+        when defined?(::MemCache) &amp;&amp; uri.kind_of?(::MemCache)
           type.const_get(:MemCache).resolve(uri)
-        when defined?(::Memcached) &amp;&amp; type.respond_to?(:stats)
+        when defined?(::Memcached) &amp;&amp; uri.respond_to?(:stats)
           type.const_get(:MemCached).resolve(uri)
         else
           fail &quot;Unknown storage provider: #{uri.to_s}&quot;</diff>
      <filename>lib/rack/cache/storage.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>05d23360c3e08ccb2bc5af5fae060c34cfceeeb2</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Tomayko</name>
    <email>rtomayko@gmail.com</email>
  </author>
  <url>http://github.com/rtomayko/rack-cache/commit/12b0de7eaa4801c97a57e6fb3c4bcf2d84056f64</url>
  <id>12b0de7eaa4801c97a57e6fb3c4bcf2d84056f64</id>
  <committed-date>2009-06-06T02:04:44-07:00</committed-date>
  <authored-date>2009-06-06T02:04:44-07:00</authored-date>
  <message>Fix passing memcache objects in entitystore option</message>
  <tree>4c27052373f4d84e265be409be3159c937c9f396</tree>
  <committer>
    <name>Ryan Tomayko</name>
    <email>rtomayko@gmail.com</email>
  </committer>
</commit>
