Sha256: 86798e1e4e4505e6ab7956dd20af5522c6bd5a7f436efc2fcf2efa3789472ba1

Contents?: true

Size: 609 Bytes

Versions: 10

Compression:

Stored size: 609 Bytes

Contents

require_relative 'base'

module VagrantPlugins
  module Berkshelf
    module Action
      class Save < Base
        def call(env)
          if !berkshelf_enabled?(env)
            @logger.info "Berkshelf disabled, skipping"
            return @app.call(env)
          end

          if env[:berkshelf].shelf
            @logger.debug "Saving datafile to disk"
            FileUtils.mkdir_p(datafile_path(env).dirname)
            datafile_path(env).open("w+") do |f|
              f.write(env[:berkshelf].shelf)
            end
          end

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrant-berkshelf-nochefdk-6.0.0 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-5.1.2 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-5.1.1 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-5.1.0 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-5.0.0 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-4.1.0 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-4.0.4 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-4.0.3 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-4.0.2 lib/vagrant-berkshelf/action/save.rb
vagrant-berkshelf-4.0.1 lib/vagrant-berkshelf/action/save.rb