class BackupDriver::Driver
Attributes
log[R]
options[R]
time[R]
Public Class Methods
new(options)
click to toggle source
# File lib/backup_driver/driver.rb, line 5 def initialize(options) @options = options @time = Time.now @log = [] end
Public Instance Methods
backup()
click to toggle source
# File lib/backup_driver/driver.rb, line 11 def backup create_command.do encrypt_command.do store_command.do clean_command.do output_log end
clean_command()
click to toggle source
# File lib/backup_driver/driver.rb, line 40 def clean_command @clean_command ||= CleanCommand.new(self) end
create_command()
click to toggle source
# File lib/backup_driver/driver.rb, line 23 def create_command @create_command ||= select_create_command end
encrypt_command()
click to toggle source
# File lib/backup_driver/driver.rb, line 32 def encrypt_command @encrypt_command ||= EncryptCommand.new(self) end
output_log()
click to toggle source
# File lib/backup_driver/driver.rb, line 19 def output_log puts @log.join("\n") end
select_create_command()
click to toggle source
# File lib/backup_driver/driver.rb, line 27 def select_create_command return MysqlCreateCommand.new(self) if options[:mysql] CreateCommand.new(self) end
store_command()
click to toggle source
# File lib/backup_driver/driver.rb, line 36 def store_command @store_command ||= StoreCommand.new(self) end