Class: RestDebug::Manager
- Inherits:
-
Object
- Object
- RestDebug::Manager
- Includes:
- FromHash
- Defined in:
- lib/rest_debug/manager.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Instance Method Summary collapse
- #close ⇒ Object
- #debug_code ⇒ Object
- #full_code ⇒ Object
- #json_output(pipe) ⇒ Object
- #to_output ⇒ Object
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/rest_debug/manager.rb', line 4 def code @code end |
Instance Method Details
#close ⇒ Object
37 38 39 40 |
# File 'lib/rest_debug/manager.rb', line 37 def close `kill #{server.pid}` `kill #{client.pid}` end |
#debug_code ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rest_debug/manager.rb', line 7 def debug_code str = <<EOF require 'debugger' Debugger.wait_connection = true Debugger.start_remote nil, #{port} debugger EOF end |
#full_code ⇒ Object
16 17 18 |
# File 'lib/rest_debug/manager.rb', line 16 def full_code [debug_code,code].join("\n") end |
#json_output(pipe) ⇒ Object
29 30 31 |
# File 'lib/rest_debug/manager.rb', line 29 def json_output(pipe) {:output => pipe.read_all, :open => pipe.open?} end |
#to_output ⇒ Object
33 34 35 |
# File 'lib/rest_debug/manager.rb', line 33 def to_output {:client => json_output(client), :server => json_output(server)} end |