Module Breakpoint::CommandBundle
In: lib/breakpoint.rb

These commands are automatically available in all breakpoint shells.

Methods

Classes and Modules

Class Breakpoint::CommandBundle::Client

Public Instance methods

Lets an object that will forward method calls to the breakpoint client. This is useful for outputting longer things at the client and so on. You can for example do these things:

  client.puts "Hello" # outputs "Hello" at client console
  # outputs "Hello" into the file temp.txt at the client
  client.File.open("temp.txt", "w") { |f| f.puts "Hello" }

[Source]

     # File lib/breakpoint.rb, line 216
216:     def client()
217:       if Breakpoint.use_drb? then
218:         sleep(0.5) until Breakpoint.drb_service.eval_handler
219:         Client.new(Breakpoint.drb_service.eval_handler)
220:       else
221:         Client.new(lambda { |code| eval(code, TOPLEVEL_BINDING) })
222:       end
223:     end

Returns the source code surrounding the location where the breakpoint was issued.

[Source]

     # File lib/breakpoint.rb, line 193
193:     def source_lines(context = 5, return_line_numbers = false)
194:       lines = File.readlines(@__bp_file).map { |line| line.chomp }
195: 
196:       break_line = @__bp_line
197:       start_line = [break_line - context, 1].max
198:       end_line = break_line + context
199: 
200:       result = lines[(start_line - 1) .. (end_line - 1)]
201: 
202:       if return_line_numbers then
203:         return [start_line, break_line, result]
204:       else
205:         return result
206:       end
207:     end

[Validate]