Sha256: c14628a8201cc0a9b47b45495c07d414978599060917ed74273cb48658dbce82

Contents?: true

Size: 407 Bytes

Versions: 3

Compression:

Stored size: 407 Bytes

Contents

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-gq-0.1.2 lib/vagrant-gq/action/is_stopped.rb
vagrant-gq-0.1.1 lib/vagrant-gq/action/is_stopped.rb
vagrant-gq-0.1.0 lib/vagrant-gq/action/is_stopped.rb