Class: Webbynode::Commands::Delete

Inherits:
Webbynode::Command show all
Defined in:
lib/webbynode/commands/delete.rb

Constant Summary

Constants inherited from Webbynode::Command

Webbynode::Command::Aliases, Webbynode::Command::CommandError, Webbynode::Command::InvalidCommand, Webbynode::Command::InvalidOption, Webbynode::Command::Settings

Instance Method Summary collapse

Methods inherited from Webbynode::Command

add_alias, #api, class_for, command, command_class_name, description, for, #gemfile, #git, help, inherited, #initialize, #io, #no?, #notify, option, #option, #options, options_help, #param, #param_values, parameter, #params, #params_hash, params_help, #pushand, #remote_executor, requires_initialization!, requires_options!, requires_pushed_application!, #run, #server, setting, #settings, summary, summary_help, usage, #validate_initialization, #validate_options, #yes?

Constructor Details

This class inherits a constructor from Webbynode::Command

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/webbynode/commands/delete.rb', line 9

def execute
  unless pushand.present?
    io.log("Ahn!? Hello, McFly, anybody home?", true)
    return
  end
  
  app_name = pushand.parse_remote_app_name
  if option(:force) or ask("Do you really want to delete application #{app_name} (y/n)? ").downcase == "y"
    notify("Removing [#{app_name}] from your webby...")
    remote_executor.exec "delete_app #{app_name} --force", true
    notify("The application [#{app_name}] has been removed from your webby.\n\nThe webserver is restarting.")
  else
    puts "Aborted."
  end
end