Sha256: 5c9afa714d8ea519ca9d7f40692a29a2a02ac2ff7b31dab27d6a1aea5d49f159

Contents?: true

Size: 743 Bytes

Versions: 13

Compression:

Stored size: 743 Bytes

Contents

module Backup
  module Compressor
    class Base
      include Utilities::Helpers
      include Config::Helpers

      ##
      # Yields to the block the compressor command and filename extension.
      def compress_with
        log!
        yield @cmd, @ext
      end

      private

      ##
      # Return the compressor name, with Backup namespace removed
      def compressor_name
        self.class.to_s.sub("Backup::", "")
      end

      ##
      # Logs a message to the console and log file to inform
      # the client that Backup is using the compressor
      def log!
        Logger.info "Using #{compressor_name} for compression.\n" \
          "  Command: '#{@cmd}'\n" \
          "  Ext: '#{@ext}'"
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
backup-5.0.0.beta.3 lib/backup/compressor/base.rb
backedup-5.0.0.beta.5 lib/backup/compressor/base.rb
backedup-5.0.0.beta.4 lib/backup/compressor/base.rb
backedup-5.0.0.beta.3 lib/backup/compressor/base.rb
ext_backup-5.0.0.beta.2.1 lib/backup/compressor/base.rb
ext_backup-5.0.0.beta.2.ext.0.1.2 lib/backup/compressor/base.rb
ext_backup-5.0.0.beta.2.ext.0.1.1 lib/backup/compressor/base.rb
ext_backup-5.0.0.beta.2.ext.0.1.0 lib/backup/compressor/base.rb
backup-5.0.0.beta.2 lib/backup/compressor/base.rb
backup-5.0.0.beta.1 lib/backup/compressor/base.rb
backup-bouchard-4.4.4 lib/backup/compressor/base.rb
backup-bouchard-4.4.2 lib/backup/compressor/base.rb
backup-bouchard-4.4.1 lib/backup/compressor/base.rb