Class: PryMoves::Next
- Inherits:
-
TraceCommand
- Object
- TraceCommand
- PryMoves::Next
- Defined in:
- lib/commands/next.rb
Instance Method Summary collapse
- #init(binding_) ⇒ Object
- #trace(event, file, line, method, binding_) ⇒ Object
- #traced_method?(file, line, method, binding_) ⇒ Boolean
Methods inherited from TraceCommand
#initialize, #start_tracing, #stop_tracing, trace, #trace_obj, #tracing_func
Methods included from TraceHelpers
#current_frame_digest, #current_frame_type, #debug_info, #frame_digest, #frame_type, #redirect_step?
Constructor Details
This class inherits a constructor from PryMoves::TraceCommand
Instance Method Details
#init(binding_) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/commands/next.rb', line 3 def init(binding_) @start_line = binding_.eval('__LINE__') @receiver = binding_.receiver @start_digest = frame_digest(binding_) if @command[:param] == 'blockless' @stay_at_frame = @start_digest end @events_traced = 0 end |
#trace(event, file, line, method, binding_) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/commands/next.rb', line 13 def trace(event, file, line, method, binding_) @events_traced += 1 return true if @call_depth < 0 return unless @call_depth == 0 and traced_method?(file, line, method, binding_) if event == 'line' if @stay_at_frame return ( @stay_at_frame == current_frame_digest or @c_stack_level < 0 ) elsif @start_line != line or ( @events_traced > 1 and # чтобы не застревало на while (vx = shift) @start_digest == current_frame_digest # for correct iterating over one_line_in_block ) return true end end true if event == 'return' and method == @method[:name] and @method.before_end?(line) end |
#traced_method?(file, line, method, binding_) ⇒ Boolean
38 39 40 |
# File 'lib/commands/next.rb', line 38 def traced_method?(file, line, method, binding_) super and @receiver == binding_.receiver end |