module ActiveSupport::Gzip
def self.compress(source, level = Zlib::DEFAULT_COMPRESSION, strategy = Zlib::DEFAULT_STRATEGY)
def self.compress(source, level = Zlib::DEFAULT_COMPRESSION, strategy = Zlib::DEFAULT_STRATEGY) output = Stream.new gz = Zlib::GzipWriter.new(output, level, strategy) gz.write(source) gz.close output.string end
def self.decompress(source)
def self.decompress(source) Zlib::GzipReader.wrap(StringIO.new(source), &:read) end