Sha256: d9149bd88e9f3cc7c49968c248e2840a4a122ccca2376b803c8f297710fd2302

Contents?: true

Size: 567 Bytes

Versions: 11

Compression:

Stored size: 567 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[:vm].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

11 entries across 11 versions & 1 rubygems

Version Path
berkshelf-1.0.4 lib/berkshelf/vagrant/action/clean.rb
berkshelf-1.0.3 lib/berkshelf/vagrant/action/clean.rb
berkshelf-1.0.2 lib/berkshelf/vagrant/action/clean.rb
berkshelf-1.0.0 lib/berkshelf/vagrant/action/clean.rb
berkshelf-1.0.0.rc3 lib/berkshelf/vagrant/action/clean.rb
berkshelf-1.0.0.rc2 lib/berkshelf/vagrant/action/clean.rb
berkshelf-1.0.0.rc1 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.6.0.beta4 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.6.0.beta3 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.6.0.beta2 lib/berkshelf/vagrant/action/clean.rb
berkshelf-0.5.1 lib/berkshelf/vagrant/action/clean.rb