Class: Serverspec::Type::DockerConfig
- Inherits:
-
DockerBase
- Object
- DockerBase
- Serverspec::Type::DockerConfig
- Defined in:
- lib/serverspec_extra_types/types/docker_config.rb
Instance Method Summary collapse
- #data ⇒ Object
- #data64 ⇒ Object
- #exist? ⇒ Boolean
- #has_data64?(data) ⇒ Boolean
- #has_data?(data) ⇒ Boolean
- #has_label?(label, value = nil) ⇒ Boolean
- #has_name?(name) ⇒ Boolean
- #label(label) ⇒ Object
- #labels ⇒ Object
- #name ⇒ Object
Instance Method Details
#data ⇒ Object
13 14 15 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 13 def data @data ||= Base64.decode64(data64) end |
#data64 ⇒ Object
21 22 23 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 21 def data64 inspection['Spec']['Data'] end |
#exist? ⇒ Boolean
5 6 7 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 5 def exist? get_inspection.success? end |
#has_data64?(data) ⇒ Boolean
17 18 19 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 17 def has_data64?(data) self.data64 == data end |
#has_data?(data) ⇒ Boolean
9 10 11 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 9 def has_data?(data) self.data == data end |
#has_label?(label, value = nil) ⇒ Boolean
29 30 31 32 33 34 35 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 29 def has_label?(label, value = nil) if value label(label)[1] == value else label(label) end end |
#has_name?(name) ⇒ Boolean
41 42 43 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 41 def has_name?(name) self.name == name end |
#label(label) ⇒ Object
37 38 39 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 37 def label(label) labels.find { |key, _val| key == label } end |
#labels ⇒ Object
25 26 27 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 25 def labels inspection['Spec']['Labels'] end |
#name ⇒ Object
45 46 47 |
# File 'lib/serverspec_extra_types/types/docker_config.rb', line 45 def name inspection['Spec']['Name'] end |