Sha256: 689c29296d8469d291144b40f3a4ddaf28b49884c56aec3fe3ab1ab70cc87a23

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 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

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-db-tasks-0.6 lib/capistrano-db-tasks/compressors/gzip.rb
capistrano-db-tasks-0.5 lib/capistrano-db-tasks/compressors/gzip.rb