Class: Backup::Compressor::Pbzip2
- Defined in:
- lib/backup/compressor/pbzip2.rb
Constant Summary
Constants included from Backup::CLI::Helpers
Instance Attribute Summary collapse
-
#best ⇒ Object
Tells Backup::Compressor::Lzma to compress better (-9) rather than faster when set to true.
-
#fast ⇒ Object
Tells Backup::Compressor::Lzma to compress faster (-1) rather than better when set to true.
-
#processors ⇒ Object
Tells Backup::Compressor::Pbzip2 how many processors to use.
Instance Method Summary collapse
-
#compress_with ⇒ Object
Yields to the block the compressor command and filename extension.
-
#initialize(&block) ⇒ Pbzip2
constructor
Creates a new instance of Backup::Compressor::Pbzip2.
Methods included from Backup::Configuration::Helpers
Constructor Details
#initialize(&block) ⇒ Pbzip2
Creates a new instance of Backup::Compressor::Pbzip2
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/backup/compressor/pbzip2.rb', line 24 def initialize(&block) load_defaults! @best ||= false @fast ||= false @processors ||= false instance_eval(&block) if block_given? @cmd = "#{ utility(:pbzip2) }#{ }" @ext = '.bz2' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers
Instance Attribute Details
#best ⇒ Object
Tells Backup::Compressor::Lzma to compress better (-9) rather than faster when set to true
10 11 12 |
# File 'lib/backup/compressor/pbzip2.rb', line 10 def best @best end |
#fast ⇒ Object
Tells Backup::Compressor::Lzma to compress faster (-1) rather than better when set to true
15 16 17 |
# File 'lib/backup/compressor/pbzip2.rb', line 15 def fast @fast end |
#processors ⇒ Object
Tells Backup::Compressor::Pbzip2 how many processors to use. Autodetects the number of active CPUs by default.
20 21 22 |
# File 'lib/backup/compressor/pbzip2.rb', line 20 def processors @processors end |
Instance Method Details
#compress_with ⇒ Object
Yields to the block the compressor command and filename extension.
39 40 41 42 43 44 45 46 47 |
# File 'lib/backup/compressor/pbzip2.rb', line 39 def compress_with Backup::Logger.warn( "[DEPRECATION WARNING]\n" + " Compressor::Pbzip2 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 |