Sha256: dff6766c948ca3377325278a8daf65bca7fc4143cd508d7416c6bb34cd46a0ce

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-hyperkit-0.4.3 lib/vagrant-hyperkit/action/is_stopped.rb