Sha256: 4e3bc0480073a0fa97f37da7eb3460abb615e26789658be833e664344a38a1ad

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

module VagrantPlugins
  module MCS
    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)
          puts env[:machine].state.id
          env[:result] = env[:machine].state.id == "ready"
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-mcs-0.8.39 lib/vagrant-mcs/action/is_stopped.rb
vagrant-mcs-0.8.38 lib/vagrant-mcs/action/is_stopped.rb