Sha256: 4c765a47aba7523779c776aaaec7e0bb677799abb7bdd2058117c30473cd703e

Contents?: true

Size: 516 Bytes

Versions: 3

Compression:

Stored size: 516 Bytes

Contents

require "i18n"

module VagrantPlugins
  module VCloud
    module Action
      class IsRunning
        def initialize(app, env)
          @app = app
        end

        def call(env)
          # Set the result to be true if the machine is running.
          env[:result] = env[:machine].state.id == :running

          # Call the next if we have one (but we shouldn't, since this
          # middleware is built to run with the Call-type middlewares)
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-vcloud-0.1.2 lib/vagrant-vcloud/action/is_running.rb
vagrant-vcloud-0.1.1 lib/vagrant-vcloud/action/is_running.rb
vagrant-vcloud-0.1.0 lib/vagrant-vcloud/action/is_running.rb