Class: Kitchen::Transport::ExpressSsh

Inherits:
Ssh
  • Object
show all
Defined in:
lib/kitchen/transport/express_ssh.rb

Defined Under Namespace

Classes: Connection

Instance Method Summary collapse

Instance Method Details

#create_new_connection(options, &block) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/kitchen/transport/express_ssh.rb', line 29

def create_new_connection(options, &block)
  if @connection
    logger.debug("[#{LOG_PREFIX}] Shutting previous connection #{@connection}")
    @connection.close
  end

  @connection_options = options
  @connection = self.class::Connection.new(options, &block)
end

#finalize_config!(instance) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/kitchen/transport/express_ssh.rb', line 43

def finalize_config!(instance)
  return unless verifier_defined?(instance)

  super.tap do
    instance.verifier.send(:define_singleton_method, :runner_options_for_expressssh) do |config_data|
      runner_options_for_ssh(config_data)
    end
  end
end

#verifier_defined?(instance) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/kitchen/transport/express_ssh.rb', line 39

def verifier_defined?(instance)
  defined?(Kitchen::Verifier::Inspec) && instance.verifier.is_a?(Kitchen::Verifier::Inspec)
end