Class: Borg::Requestor
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- Borg::Requestor
- Includes:
- EM::P::ObjectProtocol
- Defined in:
- lib/borg/borg_requestor.rb
Class Method Summary collapse
Instance Method Summary collapse
- #connection_completed ⇒ Object
- #receive_object(ruby_object) ⇒ Object
- #stop_build(ruby_object) ⇒ Object
- #unbind ⇒ Object
Class Method Details
Instance Method Details
#connection_completed ⇒ Object
8 9 10 11 |
# File 'lib/borg/borg_requestor.rb', line 8 def connection_completed @server_running = true send_object(BuildRequester.new()) end |
#receive_object(ruby_object) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/borg/borg_requestor.rb', line 13 def receive_object(ruby_object) case ruby_object when BuildOutput print ruby_object.data when BuildStatus stop_build(ruby_object) end end |
#stop_build(ruby_object) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/borg/borg_requestor.rb', line 31 def stop_build(ruby_object) puts if(ruby_object.exit_status == 0) puts "Successfully ran all tests" EM.stop() else abort("Error running tests") end end |
#unbind ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/borg/borg_requestor.rb', line 22 def unbind unless @server_running puts "Error running server" EM.stop() else EM.stop() end end |