Sha256: ddf367b65aca8f0dceceac4a48bb4c5ea341898b073f9cfc9f3b1fcdccf6c41c
Contents?: true
Size: 560 Bytes
Versions: 21
Compression:
Stored size: 560 Bytes
Contents
require 'multi_json' module Serverspec::Type class DockerBase < Base def exist? get_inspection.success? end def [](key) value = inspection key.split('.').each do |k| is_index = k.start_with?('[') && k.end_with?(']') value = value[is_index ? k[1..-2].to_i : k] end value end def inspection @inspection ||= ::MultiJson.load(get_inspection.stdout)[0] end private def get_inspection @get_inspection ||= @runner.run_command("docker inspect #{@name}") end end end
Version data entries
21 entries across 21 versions & 2 rubygems