Sha256: 54e4020b7bea6d7f55ed5cf81d1ed44e450444e4059724eb6903f36252ef04e7
Contents?: true
Size: 637 Bytes
Versions: 16
Compression:
Stored size: 637 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.to_i : k] end value end def inspection return @inspection if @inspection @inspection = ::MultiJson.load(get_inspection.stdout)[0] end private def get_inspection return @get_inspection if @get_inspection @get_inspection = @runner.run_command("docker inspect #{@name}") end end end
Version data entries
16 entries across 16 versions & 2 rubygems