Class: Droppper::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/droppper/config.rb

Constant Summary collapse

DEFAULT =
{
  token: nil,
  ssh: {
    user: "root",
    port: "22",
    keyfile: "~/.ssh/id_rsa"
  },
  create: {
    region: "nyc3",
    image: "ubuntu-14-04-x64",
    size: "512mb",
    keys: []
  }
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



20
21
22
# File 'lib/droppper/config.rb', line 20

def initialize
  load_config
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/droppper/config.rb', line 3

def data
  @data
end

#filesObject

Returns the value of attribute files.



3
4
5
# File 'lib/droppper/config.rb', line 3

def files
  @files
end

Instance Method Details

#createObject



40
41
42
# File 'lib/droppper/config.rb', line 40

def create
  data.create
end


24
25
26
# File 'lib/droppper/config.rb', line 24

def print
  puts Droppper::Utils.print_hash(data)
end

#sshObject



36
37
38
# File 'lib/droppper/config.rb', line 36

def ssh
  data.ssh
end

#tokenObject



28
29
30
# File 'lib/droppper/config.rb', line 28

def token
  data.token
end

#token=(new_token) ⇒ Object



32
33
34
# File 'lib/droppper/config.rb', line 32

def token=(new_token)
  data.token = new_token
end