Class: Squidward::Command::Info

Inherits:
Base
  • Object
show all
Defined in:
lib/squidward/commands/info.rb

Overview

Handles the echoing of the current configuration (pretty basic tough)

Instance Method Summary collapse

Methods inherited from Base

#ask, #ask_for_credentials, #ask_for_password, #configuration, #display, #echo_off, #echo_on, #initialize, #logger, #read_credentials, #store_configuration, #store_credentials

Constructor Details

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

Instance Method Details

#index(args = nil) ⇒ Object

Goes thru the settings and echos their values.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/squidward/commands/info.rb', line 6

def index(args = nil)
  display("=== Current Settings")
  display("Amazon Web Services Account:  #{configuration[:credentials][:access_key]}")
  display("Amazon S3 Bucket:             #{configuration[:default_bucket]}")
  display("")
  if (configuration[:domains] and configuration[:domains].size > 0)
    display("Configured Domains:           ", false)  
    first = true
    configuration[:domains].each do |domain|
      spaces = (not first) ? " " * 30 : ""
      display(spaces + "#{domain[:domain]} is being uploaded to #{domain[:vpath] or "<bucket_root>"}")
      first = false
    end
  else
    display("Configured Domains:           You currently have no domains configuration for backup")
  end
  display("")
end