Parent

Included Modules

SporkDebugger::PreloadState

Public Class Methods

new() click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 48
48:     def initialize
49:       Spork.each_run { install_hook }
50:       listen_for_connection_signals
51:     end

Public Instance Methods

finish() click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 53
53:     def finish
54:       @tcp_service.close; @tcp_service = nil;
55:     end
transition_to_each_run_state() click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 57
57:     def transition_to_each_run_state
58:       finish
59:       SporkDebugger::EachRunState.new(@port)
60:     end

Protected Instance Methods

connect_rdebug_client(port = Debugger::PORT) click to toggle source
     # File lib/spork/ext/ruby-debug.rb, line 96
 96:       def connect_rdebug_client(port = Debugger::PORT)
 97:         puts "\n\n - Debug Session Started - \n\n\n"
 98:         begin
 99:           Debugger.start_client(SporkDebugger::HOST, port)
100:         rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED
101:         end
102:         puts "\n\n - Debug Session Terminated - \n\n\n"
103:       end
debugger(steps = 1) click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 66
66:           def debugger(steps = 1)
67:             SporkDebugger.instance.prepare_debugger
68:             debugger_without_spork_hook
69:           end
install_hook() click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 63
63:       def install_hook
64:         Kernel.class_eval do
65:           alias :debugger_without_spork_hook :debugger
66:           def debugger(steps = 1)
67:             SporkDebugger.instance.prepare_debugger
68:             debugger_without_spork_hook
69:           end
70:         end
71:       end
listen_for_connection_signals() click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 73
73:       def listen_for_connection_signals
74:         @port = SporkDebugger::DEFAULT_PORT
75:         begin
76:           @tcp_service = TCPServer.new(SporkDebugger::HOST, @port)
77:         rescue Errno::EADDRINUSE
78:           @port += 1
79:           retry
80:         end
81:         Thread.new { main_loop }
82:       end
main_loop() click to toggle source
    # File lib/spork/ext/ruby-debug.rb, line 84
84:       def main_loop
85:         while @tcp_service do
86:           socket = @tcp_service.accept
87:           port = Marshal.load(socket)
88:           Marshal.dump(true, socket)
89:           connect_rdebug_client(port)
90:           socket.close
91:         end
92:       rescue => e
93:         puts "error: #{e.class} - #{e}"
94:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.