String extensions to use the GZip module.
The methods gzip and gunzip provide an even more simple interface to the ZLib:
# create a big string x = 'a' * 1000 # zip it x_gz = x.gzip # test the result puts 'Zipped %d bytes to %d bytes.' % [x.size, x_gz.size] #-> Zipped 1000 bytes to 19 bytes. # unzipping works p x_gz.gunzip == x #-> true
Returns the string, unzipped. See GZip.gunzip
# File lib/coderay/helpers/gzip_simple.rb, line 70 70: def gunzip 71: GZip.gunzip self 72: end
Replaces the string with its unzipped value. See GZip.gunzip
# File lib/coderay/helpers/gzip_simple.rb, line 75 75: def gunzip! 76: replace gunzip 77: end
Returns the string, zipped. level is the gzip compression level, see GZip.gzip.
# File lib/coderay/helpers/gzip_simple.rb, line 81 81: def gzip level = GZip::DEFAULT_GZIP_LEVEL 82: GZip.gzip self, level 83: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.