class Serverspec::Type::DockerBase

Public Instance Methods

[](key) click to toggle source
# File lib/serverspec/type/docker_base.rb, line 9
def [](key)
  value = inspection
  key.split('.').each do |k|
    is_index = k.start_with?('[') && k.end_with?(']')
    value = value[is_index ? k.to_i : k]
  end
  value
end
exist?() click to toggle source
# File lib/serverspec/type/docker_base.rb, line 5
def exist?
  get_inspection.success?
end
inspection() click to toggle source
# File lib/serverspec/type/docker_base.rb, line 18
def inspection
  return @inspection if @inspection
  @inspection = ::MultiJson.load(get_inspection.stdout)[0]
end

Private Instance Methods

get_inspection() click to toggle source
# File lib/serverspec/type/docker_base.rb, line 24
def get_inspection
  return @get_inspection if @get_inspection
  @get_inspection = @runner.run_command("docker inspect #{@name}")
end