Sha256: 8598c82f4fa42d67bf59be4d8cceba16d166060b8d4301a786e5185fe92fb140

Contents?: true

Size: 679 Bytes

Versions: 5

Compression:

Stored size: 679 Bytes

Contents

module Kitchen
  module Provisioner
    # Locates active IPs that are not localhost
    # there are separate implementations for
    # different kitchen transports
    module Finder
      @finder_registry = {}

      def self.for_transport(transport, state)
        @finder_registry.each do |registered_transport, finder|
          if transport.class <= registered_transport
            return finder.new(transport.connection(state))
          end
        end
      end

      def self.register_finder(transport, finder)
        @finder_registry[transport] = finder
      end
    end
  end
end

require 'kitchen/provisioner/finder/ssh'
require 'kitchen/provisioner/finder/winrm'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kitchen-nodes-0.7.0 lib/kitchen/provisioner/finder.rb
kitchen-nodes-0.6.6 lib/kitchen/provisioner/finder.rb
kitchen-nodes-0.6.5 lib/kitchen/provisioner/finder.rb
kitchen-nodes-0.6.4 lib/kitchen/provisioner/finder.rb
kitchen-nodes-0.6.4.dev lib/kitchen/provisioner/finder.rb