Class: Backup

Inherits:
Object
  • Object
show all
Defined in:
lib/travis-backup.rb,
lib/backup/remove_specified.rb,
lib/backup/remove_specified/shared.rb,
lib/backup/remove_specified/remove_heavy_data.rb,
lib/backup/remove_specified/remove_with_all_dependencies.rb

Overview

main travis-backup class

Defined Under Namespace

Classes: RemoveSpecified

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_args = {}) ⇒ Backup

Returns a new instance of Backup.



15
16
17
18
19
20
21
22
# File 'lib/travis-backup.rb', line 15

def initialize(config_args={})
  @config = Config.new(config_args)
  @db_helper = DbHelper.new(@config)

  if @config.dry_run
    @dry_run_reporter = DryRunReporter.new
  end
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



13
14
15
# File 'lib/travis-backup.rb', line 13

def config
  @config
end

Instance Method Details

#dry_run_reportObject



24
25
26
# File 'lib/travis-backup.rb', line 24

def dry_run_report
  @dry_run_reporter.report
end

#run(args = {}) ⇒ Object



28
29
30
31
32
# File 'lib/travis-backup.rb', line 28

def run(args={})
  Backup::RemoveSpecified.new(@config, @dry_run_reporter).run(args)

  @dry_run_reporter.print_report if @config.dry_run
end