Class: RestDebug::Manager

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/rest_debug/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code.



4
5
6
# File 'lib/rest_debug/manager.rb', line 4

def code
  @code
end

Instance Method Details

#closeObject



37
38
39
40
# File 'lib/rest_debug/manager.rb', line 37

def close
  `kill #{server.pid}`
  `kill #{client.pid}`
end

#debug_codeObject



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_codeObject



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_outputObject



33
34
35
# File 'lib/rest_debug/manager.rb', line 33

def to_output
  {:client => json_output(client), :server => json_output(server)}
end