Class: Squidward::Command::Domain

Inherits:
Secured show all
Defined in:
lib/squidward/commands/domain.rb

Overview

Handles everything related to AWS SimpleDB Domains for Backup

Instance Method Summary collapse

Methods inherited from Secured

#ask, #ask_for_credentials, #ask_for_password, #echo_off, #echo_on, #initialize, #read_credentials, #store_credentials

Methods inherited from Base

#configuration, #display, #logger, #store_configuration

Constructor Details

This class inherits a constructor from Squidward::Command::Secured

Instance Method Details

#backup(args) ⇒ Object

Configures a SimpleDB domain for backup. When given the second parameter is the virtual path inside the bucket to be stored.



7
8
9
10
11
12
# File 'lib/squidward/commands/domain.rb', line 7

def backup(args)
  domain, vpath = args
  conf = self.configuration
  conf[:domains] = (conf[:domains] or []) + [{:domain => domain, :vpath => vpath}]
  store_configuration(conf)
end

#remove(args) ⇒ Object

Removes a SimpleDB domain already being backed up from the current user profile so it doesn’t run anymore.



16
17
18
19
20
21
# File 'lib/squidward/commands/domain.rb', line 16

def remove(args)
  domain, vpath = args
  conf = self.configuration
  conf[:domains] = conf[:domains].reject{|d| d[:domain].downcase.strip == domain.downcase.strip}
  store_configuration(conf)
end