Sha256: ba3c6fa765892eed7e62ac307489a261a1cc8f66af1692c7a5a9227ee6067c26

Contents?: true

Size: 571 Bytes

Versions: 5

Compression:

Stored size: 571 Bytes

Contents

module Berkshelf
  module Vagrant
    module Action
      # @author Jamie Winsor <jamie@vialstudios.com>
      class Clean
        attr_reader :shelf

        def initialize(app, env)
          @app = app
          @shelf = Berkshelf::Vagrant.shelf_for(env)
        end

        def call(env)
          if Berkshelf::Vagrant.chef_solo?(env[:global_config]) && self.shelf
            Berkshelf.formatter.msg "cleaning Vagrant's shelf"
            FileUtils.remove_dir(self.shelf, fore: true)
          end

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
berkshelf-0.6.0.beta1 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.5.0 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.5.0.rc4 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.5.0.rc3 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.5.0.rc2 lib/berkshelf/vagrant/action/clean.rb