class CFMicro::Switcher::Base

Public Class Methods

new(config) click to toggle source
# File lib/micro/switcher/base.rb, line 6
def initialize(config)
  @config = config

  @vmrun = CFMicro::VMrun.new(config)
end

Public Instance Methods

domain() click to toggle source
# File lib/micro/switcher/base.rb, line 17
def domain
  @vmrun.domain
end
ip() click to toggle source
# File lib/micro/switcher/base.rb, line 21
def ip
  @vmrun.ip
end
nat?() click to toggle source
# File lib/micro/switcher/base.rb, line 41
def nat?
  @config['online_connection_type'] ||= @vmrun.connection_type
  @config["online_connection_type"] == "nat"
end
offline!() click to toggle source
# File lib/micro/switcher/base.rb, line 63
def offline!
  if  @vmrun.offline?
    raise CFMicro::MCFError, "Micro Cloud Foundry VM already in offline mode"
  else
    @vmrun.offline!
  end
end
offline?() click to toggle source
# File lib/micro/switcher/base.rb, line 37
def offline?
  @vmrun.offline?
end
online!() click to toggle source
# File lib/micro/switcher/base.rb, line 71
def online!
  if @vmrun.offline?
    @vmrun.online!
  else
    raise CFMirco::MCFError, "Micro Cloud Foundry already in online mode"
  end
end
ready?() click to toggle source
# File lib/micro/switcher/base.rb, line 33
def ready?
  @vmrun.ready?
end
reset_to_nat!() click to toggle source
# File lib/micro/switcher/base.rb, line 46
def reset_to_nat!
  @vmrun.connection_type = 'nat'
  @vmrun.reset
end
running?() click to toggle source
# File lib/micro/switcher/base.rb, line 25
def running?
  @vmrun.running?
end
set_host_dns!() click to toggle source
# File lib/micro/switcher/base.rb, line 51
def set_host_dns!
  @config['domain'] ||= @vmrun.domain
  @config['ip'] ||= @vmrun.ip
  set_nameserver(@config['domain'], @config['ip'])
end
start!() click to toggle source
# File lib/micro/switcher/base.rb, line 29
def start!
  @vmrun.start!
end
unset_host_dns!() click to toggle source
# File lib/micro/switcher/base.rb, line 57
def unset_host_dns!
  @config['domain'] ||= @vmrun.domain
  @config['ip'] ||= @vmrun.ip
  unset_nameserver(@config['domain'], @config['ip'])
end
vmx() click to toggle source

wrapper methods

# File lib/micro/switcher/base.rb, line 13
def vmx
  @vmrun.vmx
end