Class: Breakpoint::DRbService

Inherits:
Object
  • Object
show all
Includes:
DRbUndumped
Defined in:
lib/breakpoint.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDRbService

Returns a new instance of DRbService.



290
291
292
293
294
295
# File 'lib/breakpoint.rb', line 290

def initialize
  @handler = @eval_handler = @collision_handler = nil

  IRB.instance_eval { @CONF[:RC] = true }
  IRB.run_config
end

Instance Attribute Details

#collision_handlerObject

Returns the value of attribute collision_handler.



319
320
321
# File 'lib/breakpoint.rb', line 319

def collision_handler
  @collision_handler
end

#eval_handlerObject

Returns the value of attribute eval_handler.



319
320
321
# File 'lib/breakpoint.rb', line 319

def eval_handler
  @eval_handler
end

#handlerObject

Returns the value of attribute handler.



319
320
321
# File 'lib/breakpoint.rb', line 319

def handler
  @handler
end

Instance Method Details

#add_breakpoint(context, message) ⇒ Object



307
308
309
310
311
312
313
314
315
316
317
# File 'lib/breakpoint.rb', line 307

def add_breakpoint(context, message)
  workspace = IRB::WorkSpace.new(context)
  workspace.extend(DRbUndumped)

  sleep(0.5) until @handler

  @handler.untaint
  @handler.call(workspace, message)
rescue Errno::ECONNREFUSED, DRb::DRbConnError
  raise if Breakpoint.use_drb? 
end

#collisionObject



297
298
299
300
301
302
303
# File 'lib/breakpoint.rb', line 297

def collision
  sleep(0.5) until @collision_handler

  @collision_handler.untaint

  @collision_handler.call
end

#pingObject



305
# File 'lib/breakpoint.rb', line 305

def ping() end