Module: Backup::Packager

Extended by:
CLI::Helpers
Defined in:
lib/backup/packager.rb

Constant Summary

Constants included from CLI::Helpers

CLI::Helpers::UTILITY

Class Method Summary collapse

Class Method Details

.package!(model) ⇒ Object

Build the final package for the backup model.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/backup/packager.rb', line 10

def package!(model)
  @package   = model.package
  @encryptor = model.encryptor
  @splitter  = model.splitter
  @pipeline  = Pipeline.new

  Logger.message "Packaging the backup files..."
  procedure.call

  if @pipeline.success?
    Logger.message "Packaging Complete!"
  else
    raise Errors::Packager::PipelineError,
        "Failed to Create Backup Package\n" +
        @pipeline.error_messages
  end
end