Module: Dexc::IrbHelper

Defined in:
lib/dexc.rb

Instance Method Summary collapse

Instance Method Details

#dexc_change_frame(idx) ⇒ Object



67
68
69
70
71
72
# File 'lib/dexc.rb', line 67

def dexc_change_frame(idx)
  if (0...@dexc_callers.length) === idx
    @dexc_callers_idx = idx
  end
  dexc_current_frame
end

#dexc_current_frameObject



49
50
51
# File 'lib/dexc.rb', line 49

def dexc_current_frame
  @dexc_callers[@dexc_callers_idx]
end

#dexc_down_frameObject



60
61
62
63
64
65
# File 'lib/dexc.rb', line 60

def dexc_down_frame
  if @dexc_callers_idx > 0
    @dexc_callers_idx -= 1
  end
  dexc_current_frame
end

#dexc_print_frameObject



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/dexc.rb', line 36

def dexc_print_frame
  @dexc_callers.each_with_index do |i, idx|
    if @dexc_callers_idx == idx
      print ' => '
    else
      print '    '
    end
    print("[%#{@dexc_callers_width}d] " % idx)
    filename, lineno = i.source_location
    puts "#{filename}:#{lineno}:in `#{i.frame_description}'"
  end
end

#dexc_up_frameObject



53
54
55
56
57
58
# File 'lib/dexc.rb', line 53

def dexc_up_frame
  if @dexc_callers_idx < @dexc_callers.length - 1
    @dexc_callers_idx += 1
  end
  dexc_current_frame
end