Class: Vixen::CommandLine::Status

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

def execute
  new_line_after { print "Connecting to host" }

  vms = host.paths_of_running_vms do |job_handle, event_type, more_event_info, client_data|
    print " <searching> "
    if event_type == Vixen::Constants::VixEventType[:find_item]
      path = Vixen::Bridge.get_string_property more_event_info, Vixen::Constants::VixPropertyId[:found_item_location]
      if path
        new_line_after { print "  #{File.basename path}" }
      end
    end
  end

  puts "Found #{vms.size} running virtual machines"
end