Class: Backup::Compressor::Lzma

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/compressor/lzma.rb

Constant Summary

Constants included from Backup::CLI::Helpers

Backup::CLI::Helpers::UTILITY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Backup::Configuration::Helpers

included

Constructor Details

#initialize(&block) ⇒ Lzma

Creates a new instance of Backup::Compressor::Lzma



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/backup/compressor/lzma.rb', line 19

def initialize(&block)
  load_defaults!

  @best ||= false
  @fast ||= false

  instance_eval(&block) if block_given?

  @cmd = "#{ utility(:lzma) }#{ options }"
  @ext = '.lzma'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers

Instance Attribute Details

#bestObject

Tells Backup::Compressor::Lzma to compress better (-9) rather than faster when set to true



10
11
12
# File 'lib/backup/compressor/lzma.rb', line 10

def best
  @best
end

#fastObject

Tells Backup::Compressor::Lzma to compress faster (-1) rather than better when set to true



15
16
17
# File 'lib/backup/compressor/lzma.rb', line 15

def fast
  @fast
end

Instance Method Details

#compress_withObject

Yields to the block the compressor command and filename extension.



34
35
36
37
38
39
40
41
42
# File 'lib/backup/compressor/lzma.rb', line 34

def compress_with
  Backup::Logger.warn(
    "[DEPRECATION WARNING]\n" +
    "  Compressor::Lzma is being deprecated as of backup v.3.0.24\n" +
    "  and will soon be removed. Please see the Compressors wiki page at\n" +
    "  https://github.com/meskyanichi/backup/wiki/Compressors"
  )
  super
end