Class: VagrantPlugins::RightscaleShim::Action::Cleanup
- Inherits:
-
Object
- Object
- VagrantPlugins::RightscaleShim::Action::Cleanup
- Defined in:
- lib/vagrant-rightscaleshim/action/cleanup.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Cleanup
constructor
A new instance of Cleanup.
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 |