Class: Linecook::Commands::Stop
- Inherits:
-
VirtualBoxCommand
- Object
- Linecook::Command
- VirtualBoxCommand
- Linecook::Commands::Stop
- Defined in:
- lib/linecook/commands/stop.rb
Overview
:startdoc::desc stop a vm
Stops one or more VirtualBox virtual machines using ‘poweroff’. By default all virtual machines configured in config/ssh will be stopped.
Constant Summary
Constants inherited from VirtualBoxCommand
VirtualBoxCommand::HOST_REGEXP
Instance Method Summary collapse
Methods inherited from VirtualBoxCommand
#discardstate, #each_host, #each_vm_name, #host_list, #host_map, #load_hosts, #resolve_vm_names, #restore, #running?, #share, #ssh, #ssh!, #ssh_config_file=, #start, #start_ssh_socket, #stop
Methods included from Linecook::CommandUtils
Methods inherited from Linecook::Command
#call, help, #initialize, parse, signature
Constructor Details
This class inherits a constructor from Linecook::Command
Instance Method Details
#process(*hosts) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/linecook/commands/stop.rb', line 12 def process(*hosts) vm_names = resolve_vm_names(hosts) each_vm_name(vm_names) do |vm_name| if running?(vm_name) stop(vm_name) end end end |