Class: DC::Group
- Inherits:
-
Object
- Object
- DC::Group
- Defined in:
- lib/dc.rb
Instance Attribute Summary collapse
-
#images ⇒ Object
readonly
Returns the value of attribute images.
Instance Method Summary collapse
- #build_missing_images ⇒ Object
- #containers ⇒ Object
-
#initialize(hash, directory:) ⇒ Group
constructor
A new instance of Group.
- #rebuild_images ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
Instance Attribute Details
#images ⇒ Object (readonly)
Returns the value of attribute images.
104 105 106 |
# File 'lib/dc.rb', line 104 def images @images end |
Instance Method Details
#build_missing_images ⇒ Object
110 111 112 113 114 |
# File 'lib/dc.rb', line 110 def build_missing_images @images.each do |image| image.build unless image.exist? end end |
#containers ⇒ Object
106 107 108 |
# File 'lib/dc.rb', line 106 def containers @containers ||= create_containers end |
#rebuild_images ⇒ Object
126 127 128 129 130 131 |
# File 'lib/dc.rb', line 126 def rebuild_images images.each do |image| image.tag "before_rebuild.#{Time.now.to_i}" image.build end end |
#start ⇒ Object
116 117 118 119 120 |
# File 'lib/dc.rb', line 116 def start network = Network.new containers.each { |container| network.connect container.id } containers.each &:start end |
#stop ⇒ Object
122 123 124 |
# File 'lib/dc.rb', line 122 def stop containers.each &:destroy end |