class SimpleSshBackup::Config
Attributes
backup_dir[R]
targets[R]
Public Class Methods
new()
click to toggle source
# File lib/simple_ssh_backup/config.rb, line 8 def initialize @targets = nil @backup_dir = nil end
Public Instance Methods
load(config_file)
click to toggle source
# File lib/simple_ssh_backup/config.rb, line 13 def load(config_file) raise ArgumentError, 'Config file does not exist' unless File.exists?(config_file) raise ArgumentError, 'Config not readable' unless File.readable?(config_file) file_contents = File.read(config_file) props = YAML.load(file_contents) @backup_dir = props['backup_dir'] @targets = props['targets'] end