Sha256: aa287c8535f60a7e98b33d0150eb2a15b65e0191580dd66fdf74e7ffd75ffa4b

Contents?: true

Size: 445 Bytes

Versions: 13

Compression:

Stored size: 445 Bytes

Contents

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

13 entries across 13 versions & 1 rubygems

Version Path
vagrant-mos-0.8.53 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.52 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.51 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.50 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.49 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.46 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.45 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.44 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.43 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.42 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.41 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.40 lib/vagrant-mos/action/is_stopped.rb
vagrant-mos-0.8.39 lib/vagrant-mos/action/is_stopped.rb