Class: VagrantDNS::Middlewares::ConfigDown

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

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ConfigDown

Returns a new instance of ConfigDown.



4
5
6
7
# File 'lib/vagrant-dns/middlewares/config_down.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_down.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).down!
  end
  @app.call(env)
end