Class: VagrantPlugins::RightscaleShim::Action::Cleanup

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-rightscaleshim/action/cleanup.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Cleanup

Returns a new instance of Cleanup.



27
28
29
# File 'lib/vagrant-rightscaleshim/action/cleanup.rb', line 27

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

Instance Method Details

#call(env) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/vagrant-rightscaleshim/action/cleanup.rb', line 31

def call(env)
  shim_dir = env[:machine].config.rightscaleshim.shim_dir

  if shim_dir && File.directory?(shim_dir)
    FileUtils.rm_rf shim_dir
  end

  @app.call(env)
end