Class: Train::Transports::Docker::Connection

Inherits:
BaseConnection
  • Object
show all
Defined in:
lib/train/transports/docker.rb

Instance Method Summary collapse

Constructor Details

#initialize(conf) ⇒ Connection

Returns a new instance of Connection.



53
54
55
56
57
58
59
60
# File 'lib/train/transports/docker.rb', line 53

def initialize(conf)
  super(conf)
  @id = options[:host]
  @container = ::Docker::Container.get(@id) ||
    raise("Can't find Docker container #{@id}")
  @cmd_wrapper = nil
  @cmd_wrapper = CommandWrapper.load(self, @options)
end

Instance Method Details

#closeObject



62
63
64
# File 'lib/train/transports/docker.rb', line 62

def close
  # nothing to do at the moment
end

#uriObject



66
67
68
69
70
71
72
# File 'lib/train/transports/docker.rb', line 66

def uri
  if @container.nil?
    "docker://#{@id}"
  else
    "docker://#{@container.id}"
  end
end