Sha256: a6e77dd64570b4047a50f578445b69000bc831889bf420c8cf4a428fbd751146

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

module Compressors
  class Gzip < Base

    class << self

      def file_extension
        "gz"
      end

      def compress(from, to = nil)
        from = from == :stdin ? "-" : from
        to = case to
             when '-'
               "-c --stdout"
             when nil
               ""
             else
               "-c --stdout > #{to}"
             end

        "gzip #{from} #{to}"
      end

      def decompress(from, to = nil)
        from = from == :stdin ? "-" : from
        to = case to
             when :stdout
               "-c --stdout"
             when nil
               ""
             else
               "-c --stdout > #{to}"
             end

        "gzip -d #{from} #{to}"
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-db-tasks.senya-0.4.1 lib/capistrano-db-tasks/compressors/gzip.rb