Class: Backup::Compressor::Bzip2
- Defined in:
- lib/backup/compressor/bzip2.rb
Instance Attribute Summary collapse
-
#best ⇒ Object
writeonly
Tells Backup::Compressor::Bzip2 to compress better (-9) rather than faster when set to true.
-
#fast ⇒ Object
writeonly
Tells Backup::Compressor::Bzip2 to compress faster (-1) rather than better when set to true.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Bzip2
constructor
Creates a new instance of Backup::Compressor::Bzip2 and configures it to either compress faster or better bzip2 compresses by default with -9 (best compression) and lower block sizes don’t make things significantly faster (according to official bzip2 docs).
-
#perform! ⇒ Object
Performs the compression of the packages backup file.
Methods inherited from Base
Methods included from Backup::Configuration::Helpers
#clear_defaults!, #getter_methods, #load_defaults!, #setter_methods
Methods included from Backup::CLI
#mkdir, #raise_if_command_not_found!, #rm, #run, #utility
Constructor Details
#initialize(&block) ⇒ Bzip2
Creates a new instance of Backup::Compressor::Bzip2 and configures it to either compress faster or better bzip2 compresses by default with -9 (best compression) and lower block sizes don’t make things significantly faster (according to official bzip2 docs)
23 24 25 26 27 28 29 30 |
# File 'lib/backup/compressor/bzip2.rb', line 23 def initialize(&block) load_defaults! @best ||= false @fast ||= false instance_eval(&block) if block_given? end |
Instance Attribute Details
#best=(value) ⇒ Object
Tells Backup::Compressor::Bzip2 to compress better (-9) rather than faster when set to true
10 11 12 |
# File 'lib/backup/compressor/bzip2.rb', line 10 def best=(value) @best = value end |
#fast=(value) ⇒ Object
Tells Backup::Compressor::Bzip2 to compress faster (-1) rather than better when set to true
15 16 17 |
# File 'lib/backup/compressor/bzip2.rb', line 15 def fast=(value) @fast = value end |