<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,18 @@
+## 0.6.0 / Unreleased
+
+  * Added support for memcached clusters and other advanced
+    configuration provided by the memcache-client and memcached
+    libraries. The &quot;metastore&quot; and &quot;entitystore&quot; options can now be
+    set to a MemCache object or Memcached object:
+
+    memcache = MemCache.new(['127.1.1.1', '127.1.1.2'], :namespace =&gt; &quot;/foo&quot;)
+    use Rack::Cache,
+      :metastore =&gt; memcache,
+      :entitystore =&gt; memcache
+
+  * Fix &quot;memcached://&quot; metastore URL handling. The &quot;memcached&quot; variation
+    blew up, the &quot;memcache&quot; version was fine.
+
 ## 0.5.0 / May 2009
 
   * Added meta and entity store implementations based on the</diff>
      <filename>CHANGES</filename>
    </modified>
    <modified>
      <diff>@@ -274,22 +274,27 @@ module Rack::Cache
       # Query parameter names and values are documented with the memcached
       # library: http://tinyurl.com/4upqnd
       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
-        end
+        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
 
-        fail &quot;Invalid memcached URL: #{uri.to_s.inspect}&quot;  if uri.path.nil?
-        options[:namespace] = uri.path.sub(/^\//, '')
+          options[:namespace] = uri.path.to_s.sub(/^\//, '')
 
-        new server, options
+          new server, options
+        else
+          # if the object provided is not a URI, pass it straight through
+          # to the underlying implementation.
+          new uri
+        end
       end
     end
 </diff>
      <filename>lib/rack/cache/metastore.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,12 +30,25 @@ module Rack::Cache
 
   private
     def create_store(type, uri)
-      uri = URI.parse(uri) unless uri.respond_to?(:scheme)
-      if type.const_defined?(uri.scheme.upcase)
-        klass = type.const_get(uri.scheme.upcase)
-        klass.resolve(uri)
+      if uri.respond_to?(:scheme) || uri.respond_to?(:to_str)
+        uri = URI.parse(uri) unless uri.respond_to?(:scheme)
+        if type.const_defined?(uri.scheme.upcase)
+          klass = type.const_get(uri.scheme.upcase)
+          klass.resolve(uri)
+        else
+          fail &quot;Unknown storage provider: #{uri.to_s}&quot;
+        end
       else
-        fail &quot;Unknown storage provider: #{uri.to_s}&quot;
+        # hack in support for passing a MemCache or Memcached object
+        # as the storage URI.
+        case
+        when defined?(::MemCache) &amp;&amp; type.kind_of?(::MemCache)
+          type.const_get(:MemCache).resolve(uri)
+        when defined?(::Memcached) &amp;&amp; type.respond_to?(:stats)
+          type.const_get(:MemCached).resolve(uri)
+        else
+          fail &quot;Unknown storage provider: #{uri.to_s}&quot;
+        end
       end
     end
 </diff>
      <filename>lib/rack/cache/storage.rb</filename>
    </modified>
    <modified>
      <diff>@@ -74,5 +74,4 @@ describe 'Rack::Cache::Options' do
     @options.should.respond_to :verbose?
     @options.verbose.should.not.be.nil
   end
-
 end</diff>
      <filename>test/options_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>73a403452848e714e28f9251690b84fbefed4110</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Tomayko</name>
    <email>rtomayko@gmail.com</email>
  </author>
  <url>http://github.com/rtomayko/rack-cache/commit/05d23360c3e08ccb2bc5af5fae060c34cfceeeb2</url>
  <id>05d23360c3e08ccb2bc5af5fae060c34cfceeeb2</id>
  <committed-date>2009-06-06T00:01:02-07:00</committed-date>
  <authored-date>2009-06-05T23:53:52-07:00</authored-date>
  <message>Advanced memcached config, including server clusters

Closes #2</message>
  <tree>2586b54be7abfaed5ec6467b11cb9d61fe1c66bb</tree>
  <committer>
    <name>Ryan Tomayko</name>
    <email>rtomayko@gmail.com</email>
  </committer>
</commit>
