11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/management/commands/server/destroy.rb', line 11
def run(*server_names)
servers = server_names.map{|server_name| get_server(server_name)}
puts "You are about to delete the following servers:"
puts ['', *servers.map{ |server| " - #{server.name}" }, '', ''].join("\n")
print "Are you sure you want to do this? Type 'Yes' to continue, or anything else to abort: "
abort "Aborted." if $stdin.gets.chomp != 'Yes'
servers.each do |server|
puts "Destroying #{server.name}..."
server.destroy
puts "Done."
end
end
|