Sha256: c9d5a29f3224b6d1b38c193e6d4e67c35684b32717f8fe82531a843f2b720777

Contents?: true

Size: 423 Bytes

Versions: 7

Compression:

Stored size: 423 Bytes

Contents

module VagrantPlugins
  module ManagedServers
    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

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-managed-servers-0.5.1 lib/vagrant-managed-servers/action/is_created.rb
vagrant-managed-servers-0.5.0 lib/vagrant-managed-servers/action/is_created.rb
vagrant-managed-servers-0.4.1 lib/vagrant-managed-servers/action/is_created.rb
vagrant-managed-servers-0.4.0 lib/vagrant-managed-servers/action/is_created.rb
vagrant-managed-servers-0.3.0 lib/vagrant-managed-servers/action/is_created.rb
vagrant-managed-servers-0.2.0 lib/vagrant-managed-servers/action/is_created.rb
vagrant-managed-servers-0.1.0 lib/vagrant-managed-servers/action/is_created.rb