Class: Berkshelf::Vagrant::Action::Clean
- Inherits:
-
Object
- Object
- Berkshelf::Vagrant::Action::Clean
- Defined in:
- lib/berkshelf/vagrant/action/clean.rb
Overview
Instance Attribute Summary collapse
-
#shelf ⇒ Object
readonly
Returns the value of attribute shelf.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Clean
constructor
A new instance of Clean.
Constructor Details
Instance Attribute Details
#shelf ⇒ Object (readonly)
Returns the value of attribute shelf.
6 7 8 |
# File 'lib/berkshelf/vagrant/action/clean.rb', line 6 def shelf @shelf end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/berkshelf/vagrant/action/clean.rb', line 13 def call(env) if Berkshelf::Vagrant.chef_solo?(env[:vm].config) && self.shelf Berkshelf.formatter.msg "cleaning Vagrant's shelf" FileUtils.remove_dir(self.shelf, fore: true) end @app.call(env) rescue BerkshelfError => e raise VagrantWrapperError.new(e) end |