Class: Backup::Compressor::Bzip2

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#compress_with

Methods included from Backup::Config::Helpers

included

Constructor Details

#initialize(&block) ⇒ Bzip2

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



17
18
19
20
21
22
23
24
25
26
# File 'lib/backup/compressor/bzip2.rb', line 17

def initialize(&block)
  load_defaults!

  @level ||= false

  instance_eval(&block) if block_given?

  @cmd = "#{utility(:bzip2)}#{options}"
  @ext = ".bz2"
end

Dynamic Method Handling

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

Instance Attribute Details

#levelObject

Specify the level of compression to use.

Values should be a single digit from 1 to 9. Note that setting the level to either extreme may or may not give the desired result. Be sure to check the documentation for the compressor being used.

The default ‘level` is 9.



13
14
15
# File 'lib/backup/compressor/bzip2.rb', line 13

def level
  @level
end