Class: Vixen::CommandLine::Start

Inherits:
Base
  • Object
show all
Defined in:
lib/vixen/command_line/start.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
# File 'lib/vixen/command_line/start.rb', line 4

def execute
  count = 0

  vms.each do |vm|
    unless vm.powered_on?
      new_line_after do
        vm.power_on do |*args|
          print "Powering on #{vm.name}"
        end
      end
      count += 1
    end
  end
  puts "Powered on #{count} machines"
end