Class: VagrantDNS::Middlewares::ConfigUp

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-dns/middlewares/config_up.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ConfigUp

Returns a new instance of ConfigUp.



4
5
6
7
# File 'lib/vagrant-dns/middlewares/config_up.rb', line 4

def initialize(app, env)
  @app = app
  @env = env
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/vagrant-dns/middlewares/config_up.rb', line 9

def call(env)
  @env = env
  vm = env[:machine]
  if VagrantDNS::Config.auto_run
    tmp_path = File.join(vm.env.tmp_path, "dns")
    VagrantDNS::Configurator.new(vm, tmp_path).up!
  end
  @app.call(env)
end