Class: Spurious::Server::State::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/spurious/server/state/delete.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #connection

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Spurious::Server::State::Base

Instance Method Details

#execute!Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/spurious/server/state/delete.rb', line 10

def execute!
  containers = spurious_containers.length
  spurious_containers.peach do |container|
    send "Removing container #{container.json["Name"]}..."
    container.tap do |c|
      c.kill
      c.delete(:force => true)
    end
  end
  send "#{containers} containers successfully removed", true

  connection.unbind
rescue Exception => e
  puts e.message
end