Sha256: 9e973ff2e9ba648725f2b55f0f1427de989b63f90b124b6b5c89c6beccde542c

Contents?: true

Size: 505 Bytes

Versions: 4

Compression:

Stored size: 505 Bytes

Contents

#
# Author:: Mohit Sethi (<mohit@sethis.in>)
# Copyright:: Copyright (c) 2013 Mohit Sethi.
#

module VagrantPlugins
  module HP
    module Action
      # This can be used with "Call" built-in to check if the machine
      # is created and branch in the middleware.
      class IsCreated
        def initialize(app, env)
          @app = app
        end

        def call(env)
          env[:result] = env[:machine].state.id != :not_created
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-hp-0.1.4 lib/vagrant-hp/action/is_created.rb
vagrant-hp-0.1.3 lib/vagrant-hp/action/is_created.rb
vagrant-hp-0.1.2 lib/vagrant-hp/action/is_created.rb
vagrant-hp-0.1.1 lib/vagrant-hp/action/is_created.rb