Class: Kitchen::Transport::Dokken

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/transport/dokken.rb

Overview

A Transport which uses Docker tricks to execute commands and transfer files.

Author:

Defined Under Namespace

Classes: Connection

Instance Method Summary collapse

Instance Method Details

#connection(state, &block) ⇒ Object



51
52
53
54
55
56
57
58
59
# File 'lib/kitchen/transport/dokken.rb', line 51

def connection(state, &block)
  options = connection_options(config.to_hash.merge(state))

  if @connection && @connection_options == options
    reuse_connection(&block)
  else
    create_new_connection(options, &block)
  end
end

#docker_for_mac_or_win?TrueClass, FalseClass

Detect whether or not we are running in Docker for Mac or Windows

Returns:

  • (TrueClass, FalseClass)


208
209
210
211
212
# File 'lib/kitchen/transport/dokken.rb', line 208

def docker_for_mac_or_win?
  ::Docker.info(::Docker::Connection.new(config[:docker_host_url], {}))['Name'] == 'moby'
rescue
  false
end