Class: Ariranha::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ariranha/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_file = 'config.yml') ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
# File 'lib/ariranha/base.rb', line 7

def initialize(config_file = 'config.yml')
  @config = YAML.load(File.open(config_file))
  config_instances
  config_directories
end

Instance Method Details

#backupObject



13
14
15
16
17
18
19
20
# File 'lib/ariranha/base.rb', line 13

def backup
  instances.each do |instance|
    filename = instance.backup
    directories.each { |dir| dir.upload(filename, instance.database) }
    puts "deleting /tmp/#{filename}..."
    Open3.capture3 "rm -rf /tmp/#{filename}"
  end
end