Class: Landrush::Action::Setup

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/landrush/action/setup.rb

Constant Summary

Constants included from Common

Common::SUPPORTED_PROVIDERS

Instance Method Summary collapse

Methods included from Common

#config, #enabled?, #guest_redirect_dns?, included, #info, #initialize, #libvirt?, #log, #machine, #machine_hostname, #parallels?, #provider, #read_machine_hostname, #virtualbox?, #vmware?

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/landrush/action/setup.rb', line 6

def call(env)
  # Make sure we use the right data directory for Landrush
  # Seems Vagrant only makes home_path available in this case, compared to custom commands where there is also data_dir
  Server.working_dir = File.join(env[:home_path], 'data', 'landrush')
  Server.gems_dir = File.join(env[:gems_path].to_s, 'gems')
  Server.ui = env[:ui]

  pre_boot_setup if enabled?
  app.call(env)
  # This is after the middleware stack returns, which, since we're right
  # before the Network action, should mean that all interfaces are good
  # to go.
  post_boot_setup if enabled?
end

#host_ip_addressObject



21
22
23
24
25
26
27
# File 'lib/landrush/action/setup.rb', line 21

def host_ip_address
  if private_network_ips.include? machine.config.landrush.host_ip_address
    machine.config.landrush.host_ip_address
  else
    machine.guest.capability(:read_host_visible_ip_address)
  end
end