Module: Lab::Controllers::VirtualBoxController

Included in:
VmController
Defined in:
lib/lab/controller/virtualbox_controller.rb

Class Method Summary collapse

Class Method Details

.config_listObject



10
11
12
13
# File 'lib/lab/controller/virtualbox_controller.rb', line 10

def self.config_list
  vm_names_and_uuids = `VBoxManage list vms`
  return vm_names_and_uuids.scan(/\"(.*)\" {.*}/).flatten
end

.config_list_uuidObject



15
16
17
18
# File 'lib/lab/controller/virtualbox_controller.rb', line 15

def self.config_list_uuid
  vm_names_and_uuids = `VBoxManage list vms`
  return vm_names_and_uuids.scan(/\".*\" {(.*)}/).flatten
end

.dir_list(basepath = nil) ⇒ Object



20
21
22
# File 'lib/lab/controller/virtualbox_controller.rb', line 20

def self.dir_list(basepath=nil)
  vm_list = Find.find(basepath).select { |f| f =~ /\.xml$/ }
end

.running_listObject



5
6
7
8
# File 'lib/lab/controller/virtualbox_controller.rb', line 5

def self.running_list
  vm_names_and_uuids = `VBoxManage list runningvms`
  return vm_names_and_uuids.scan(/\"(.*)\" {.*}/).flatten
end