Class: Vixen::CommandLine::Vm

Inherits:
Base
  • Object
show all
Defined in:
lib/vixen/command_line/vm.rb

Instance Attribute Summary

Attributes inherited from Base

#context, #start

Instance Method Summary collapse

Methods inherited from Base

#elapsed_time, #host, #initialize, #new_line_after, #print, #puts, #vms

Constructor Details

This class inherits a constructor from Vixen::CommandLine::Base

Instance Method Details

#executeObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vixen/command_line/vm.rb', line 4

def execute
  machines = ARGV.shift

  return puts "A path to a virtual machine must be included" if machines.nil?

  powered_count = 0

  vm_paths = machines.split ','
  vms = []
  vm_paths.each do |path|
    vm = new_line_after do
      host.open_vm path do
        print "Opening #{path}"
      end
    end
    vms << vm
  end
  context[:vms] = vms
end