aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-04-30 11:17:58 -0700
committerwycats <wycats@gmail.com>2010-04-30 11:17:58 -0700
commit0fe8827bf384cb99ab757236555c7af18793d515 (patch)
treea7ac2143c78964cad8ee87d9ff8a1c52abf61249 /activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
parent91963e9e33eb5a28297323f1346aeb8b643e9d65 (diff)
parent6b559474fb7fae0160860fc62752da347af032b2 (diff)
downloadrails-0fe8827bf384cb99ab757236555c7af18793d515.tar.gz
rails-0fe8827bf384cb99ab757236555c7af18793d515.tar.bz2
rails-0fe8827bf384cb99ab757236555c7af18793d515.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/lib/active_support/cache/compressed_mem_cache_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/compressed_mem_cache_store.rb21
1 files changed, 6 insertions, 15 deletions
diff --git a/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb b/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
index d2370d78c5..7c7d1c4b00 100644
--- a/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
+++ b/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
@@ -1,21 +1,12 @@
-require 'active_support/gzip'
-
module ActiveSupport
module Cache
class CompressedMemCacheStore < MemCacheStore
- def read(name, options = nil)
- if value = super(name, (options || {}).merge(:raw => true))
- if raw?(options)
- value
- else
- Marshal.load(ActiveSupport::Gzip.decompress(value))
- end
- end
- end
-
- def write(name, value, options = nil)
- value = ActiveSupport::Gzip.compress(Marshal.dump(value)) unless raw?(options)
- super(name, value, (options || {}).merge(:raw => true))
+ def initialize(*args)
+ ActiveSupport::Deprecation.warn('ActiveSupport::Cache::CompressedMemCacheStore has been deprecated in favor of ActiveSupport::Cache::MemCacheStore(:compress => true).', caller)
+ addresses = args.dup
+ options = addresses.extract_options!
+ args = addresses + [options.merge(:compress => true)]
+ super(*args)
end
end
end