Froze rails gems
[depot.git] / vendor / rails / activesupport / lib / active_support / cache / compressed_mem_cache_store.rb
1 module ActiveSupport
2 module Cache
3 class CompressedMemCacheStore < MemCacheStore
4 def read(name, options = nil)
5 if value = super(name, (options || {}).merge(:raw => true))
6 if raw?(options)
7 value
8 else
9 Marshal.load(ActiveSupport::Gzip.decompress(value))
10 end
11 end
12 end
13
14 def write(name, value, options = nil)
15 value = ActiveSupport::Gzip.compress(Marshal.dump(value)) unless raw?(options)
16 super(name, value, (options || {}).merge(:raw => true))
17 end
18 end
19 end
20 end