Class: Guignol::Commands::Kill

Inherits:
Base
  • Object
show all
Defined in:
lib/guignol/commands/kill.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run

Constructor Details

This class inherits a constructor from Guignol::Commands::Base

Instance Method Details

#before_run(configs, options = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/guignol/commands/kill.rb', line 20

def before_run(configs, options = {})
  return true if configs.empty?
  return true if options[:force]
  names = configs.keys.join(", ")
  shell.yes? "Are you sure you want to destroy servers #{names}? [y/N]", :cyan
end

#run_on_server(instance, options = {}) ⇒ Object



27
28
29
# File 'lib/guignol/commands/kill.rb', line 27

def run_on_server(instance, options = {})
  instance.destroy
end