Sha256: a0a6c5a453dc851858da95c1794ebb255af27f7324fd5db1b06007e4060f6388

Contents?: true

Size: 444 Bytes

Versions: 6

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

module VagrantPlugins
  module Packet
    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 == :inactive
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-packet-0.1.6 lib/vagrant-packet/action/is_stopped.rb
vagrant-packet-0.1.5 lib/vagrant-packet/action/is_stopped.rb
vagrant-packet-0.1.4 lib/vagrant-packet/action/is_stopped.rb
vagrant-packet-0.1.3 lib/vagrant-packet/action/is_stopped.rb
vagrant-packet-0.1.2 lib/vagrant-packet/action/is_stopped.rb
vagrant-packet-0.1.1 lib/vagrant-packet/action/is_stopped.rb