Browse files

properly use Cache.wrap from cache gem

  • Loading branch information...
1 parent d47a04f commit 3bb4fe72422045dd10351eeb4eb6193c7bc5ea96 @seamusabshere committed Mar 7, 2011
Showing with 4 additions and 8 deletions.
  1. +1 −1 cache_method.gemspec
  2. +2 −6 lib/cache_method/config.rb
  3. +1 −1 lib/cache_method/version.rb
View
2 cache_method.gemspec
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]
- s.add_dependency 'cache', '>=0.1.2'
+ s.add_dependency 'cache', '>=0.2.1'
s.add_development_dependency 'memcached'
# if RUBY_VERSION >= '1.9'
# s.add_development_dependency 'ruby-debug19'
View
8 lib/cache_method/config.rb
@@ -25,12 +25,8 @@ class Config
#
# Example:
# CacheMethod.config.storage = Memcached.new '127.0.0.1:11211'
- def storage=(raw_client_or_nil)
- if raw_client_or_nil.is_a?(::Cache)
- @storage = raw_client_or_nil
- else
- @storage = ::Cache.new raw_client_or_nil
- end
+ def storage=(storage = nil)
+ @storage = ::Cache.wrap storage
end
def storage #:nodoc:
View
2 lib/cache_method/version.rb
@@ -1,3 +1,3 @@
module CacheMethod
- VERSION = "0.1.3"
+ VERSION = "0.1.4"
end

0 comments on commit 3bb4fe7

Please sign in to comment.