Sha256: 89fd43f6ea52d511cddaa0ce44b6612186aaab226f8eec40517cfbb273aab70d

Contents?: true

Size: 410 Bytes

Versions: 7

Compression:

Stored size: 410 Bytes

Contents

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

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-xhyve-0.4.1 lib/vagrant-xhyve/action/is_stopped.rb
vagrant-xhyve-0.4.0 lib/vagrant-xhyve/action/is_stopped.rb
vagrant-xhyve-0.3.0 lib/vagrant-xhyve/action/is_stopped.rb
vagrant-xhyve-0.2.0 lib/vagrant-xhyve/action/is_stopped.rb
vagrant-xhyve-0.1.1 lib/vagrant-xhyve/action/is_stopped.rb
vagrant-xhyve-0.1.1.pre lib/vagrant-xhyve/action/is_stopped.rb
vagrant-xhyve-0.1.0.pre lib/vagrant-xhyve/action/is_stopped.rb