Module | ActiveSupport::Gzip |
In: |
vendor/rails/activesupport/lib/active_support/gzip.rb
|
A convenient wrapper for the zlib standard library that allows compression/decompression of strings with gzip.
Compresses a string using gzip.
# File vendor/rails/activesupport/lib/active_support/gzip.rb, line 17 17: def self.compress(source) 18: output = Stream.new 19: gz = Zlib::GzipWriter.new(output) 20: gz.write(source) 21: gz.close 22: output.string 23: end