Sha256: 92a8b79267ad3a9c0a4ec1099e9a790bc8edcd0bad1315e82c11e946747b24de

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

Stored size: 501 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 IsRunning
        def initialize(app, env)
          @app = app
        end

        def call(env)
          env[:result] = env[:machine].state.id != :running
          @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_running.rb
vagrant-hp-0.1.3 lib/vagrant-hp/action/is_running.rb
vagrant-hp-0.1.2 lib/vagrant-hp/action/is_running.rb
vagrant-hp-0.1.1 lib/vagrant-hp/action/is_running.rb