Class: MockServerWorldHelpers::LocalDockerClient

Inherits:
MockServer::MockServerClient
  • Object
show all
Defined in:
lib/local-docker-client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(docker_host = self.class.docker_host_ip, mock_server_port = 8080) ⇒ LocalDockerClient

Returns a new instance of LocalDockerClient.



6
7
8
9
10
# File 'lib/local-docker-client.rb', line 6

def initialize(docker_host = self.class.docker_host_ip, mock_server_port = 8080)
    raise "docker must be installed" unless docker_host != nil && docker_host.length > 0

    super(docker_host, mock_server_port)
end

Class Method Details

.docker_host_ipObject



12
13
14
15
# File 'lib/local-docker-client.rb', line 12

def self.docker_host_ip
    docker_host = ENV["DOCKER_HOST"]
    /([0-9]{1,3}[.]){3}[0-9]{1,3}/.match(docker_host)
end