Class: Spurious::Server::App
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- Spurious::Server::App
- Defined in:
- lib/spurious/server/app.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #error(message, close = false) ⇒ Object
-
#initialize(options) ⇒ App
constructor
A new instance of App.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(options) ⇒ App
Returns a new instance of App.
12 13 14 |
# File 'lib/spurious/server/app.rb', line 12 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/spurious/server/app.rb', line 10 def @options end |
Instance Method Details
#error(message, close = false) ⇒ Object
25 26 27 |
# File 'lib/spurious/server/app.rb', line 25 def error(, close = false) send_data "#{JSON.generate({:message_type => 'error', :type => 'error', :response => , :close => close, :colour => :red})}\n" end |
#receive_data(data) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/spurious/server/app.rb', line 16 def receive_data data payload = parse_payload data state(payload[:type]).execute! rescue Excon::Errors::Timeout, Excon::Errors::SocketError => e error('Connection to the docker daemon has failed, please check that docker is running on the host or VM', true) rescue StandardError => e error(e., true) end |