Class: Vpsb::Commands::Setup

Inherits:
Object
  • Object
show all
Includes:
AskSupport
Defined in:
lib/vpsb/commands/setup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AskSupport

#ask, #ask_loop, #ask_to_confirm

Constructor Details

#initialize(core) ⇒ Setup

Returns a new instance of Setup.



7
8
9
# File 'lib/vpsb/commands/setup.rb', line 7

def initialize(core)
  @core = core
end

Instance Attribute Details

#coreObject (readonly)

Returns the value of attribute core.



5
6
7
# File 'lib/vpsb/commands/setup.rb', line 5

def core
  @core
end

Instance Method Details

#execute(params) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/vpsb/commands/setup.rb', line 11

def execute(params)
  unless File.exist?(core.get(:knife_rb_path))
    return puts "You did not run init script, because i cannot find knife.rb file in bootstrap server app. ;)"
  end

  Vpsb::Tasks::DoApiAccess.new(core).call
  Vpsb::Tasks::DropletSshKeys.new(core).call
  Vpsb::Tasks::CreateDroplet.new(core).call
  Vpsb::Tasks::DropletSshUpdateConfig.new(core).call
end