class Train::Transports::Docker
Patched train transport with Windows support for InSpec verifier
Public Instance Methods
Source
# File lib/train/docker.rb, line 27 def connection(state = {}, &block) opts = merge_options(options, state || {}) validate_options(opts) if @connection && @connection_options == opts reuse_connection(&block) else create_new_connection(opts, &block) end end
Private Instance Methods
Source
# File lib/train/docker.rb, line 46 def create_new_connection(options, &block) if @connection logger.debug("[Docker] shutting previous connection #{@connection}") @connection.close end @connection_options = options @connection = Connection.new(options, &block) end
Source
# File lib/train/docker.rb, line 60 def reuse_connection logger.debug("[Docker] reusing existing connection #{@connection}") yield @connection if block_given? @connection end