class Shift::ZlibWriter

Public Class Methods

keep_extension?() click to toggle source
# File lib/shift/i/zlib_writer.rb, line 4
def self.keep_extension?
  true
end
new() click to toggle source
# File lib/shift/i/zlib_writer.rb, line 12
def initialize
  require 'zlib'
  require 'stringio'
end
target_format() click to toggle source
# File lib/shift/i/zlib_writer.rb, line 8
def self.target_format
  'gz'
end

Public Instance Methods

process(str) click to toggle source
# File lib/shift/i/zlib_writer.rb, line 17
def process(str)
  StringIO.open('', 'w') do |io|
    gz = Zlib::GzipWriter.new(io)
    gz.write(str)
    gz.close
    io.string
  end
end