lib/sprockets/cache/file_store.rb in sprockets-3.0.0.beta.5 vs lib/sprockets/cache/file_store.rb in sprockets-3.0.0.beta.6
- old
+ new
@@ -51,16 +51,10 @@
def get(key)
path = File.join(@root, "#{key}.cache")
value = safe_open(path) do |f|
begin
- raw = f.read
- if raw =~ /\A\x04\x08/
- marshaled = raw
- else
- marshaled = Zlib::Inflate.new(Zlib::MAX_WBITS).inflate(raw)
- end
- Marshal.load(marshaled)
+ EncodingUtils.unmarshaled_deflated(f.read, Zlib::MAX_WBITS)
rescue Exception => e
@logger.error do
"#{self.class}[#{path}] could not be unmarshaled: " +
"#{e.class}: #{e.message}"
end