Sha256: 24476d32efadc2927b8c3c9df8fde32df5bc9ad6b3d05b4dd238e714987cfdd2

Contents?: true

Size: 532 Bytes

Versions: 54

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

require 'log4r'
module VagrantPlugins
  module ProviderZone
    module Action
      # This can be used with 'Call' built-in to check if the machine
      # is created and branch in the middleware.
      class IsCreated
        def initialize(app, _env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_zones::action')
        end

        def call(env)
          env[:result] = env[:machine].state.id != :not_created
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
vagrant-zones-0.1.55 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.54 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.52 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.48 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.46 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.44 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.12 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.10 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.9 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.8 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.41 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.1.3 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.0.12 lib/vagrant-zones/action/is_created.rb
vagrant-zones-0.0.1 lib/vagrant-zones/action/is_created.rb