Class: Vagrant::AptCache::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-apt_cache/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env, options = {}) ⇒ Middleware

Returns a new instance of Middleware.



5
6
7
8
9
# File 'lib/vagrant-apt_cache/middleware.rb', line 5

def initialize(app, env, options={})
  @app = app
  @env = env
  @options = options
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/vagrant-apt_cache/middleware.rb', line 11

def call(env)
  @env = env

  if is_apt_managed?
    Vagrant::AptCache::RegisterSharedFolder.new(@env[:vm]).run
  end

  @app.call(env)
end