class ForkBreak::BreakpointSetter

Public Class Methods

new(fork, debug = false) click to toggle source
# File lib/fork_break/breakpoint_setter.rb, line 3
def initialize(fork, debug = false)
  @fork = fork
  @next_breakpoint = :forkbreak_start
  @debug = debug
end

Public Instance Methods

<<(symbol) click to toggle source
# File lib/fork_break/breakpoint_setter.rb, line 9
def <<(symbol)
  @fork.send_object(symbol)
  if symbol == @next_breakpoint
    @next_breakpoint = @fork.receive_object unless symbol == :forkbreak_end
    puts "#{@fork.pid} received #{@next_breakpoint}" if @debug
  end
rescue EOFError => exception
  raise @fork.exception || exception
end