Module: Skylight::Core::Util::Gzip Private

Defined in:
lib/skylight/core/util/gzip.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provides Gzip compressing support

Class Method Summary collapse

Class Method Details

.compress(str) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Compress a string with Gzip

Parameters:

  • str (String)

    uncompressed string

Returns:

  • (String)

    compressed string


11
12
13
14
15
16
17
# File 'lib/skylight/core/util/gzip.rb', line 11

def self.compress(str)
  output = StringIO.new
  gz = Zlib::GzipWriter.new(output)
  gz.write(str)
  gz.close
  output.string
end