Class: Gubed::BreakpointManager

Inherits:
Object
  • Object
show all
Defined in:
lib/gubed/breakpoint_manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(root_path = ".") ⇒ BreakpointManager

Returns a new instance of BreakpointManager.



7
8
9
10
11
12
# File 'lib/gubed/breakpoint_manager.rb', line 7

def initialize(root_path = ".")
  @scanner = BreakpointScanner.new(root_path)
  @breakpoints = []
  @current_index = 0
  @message = nil
end

Instance Method Details

#run ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/gubed/breakpoint_manager.rb', line 14

def run
  refresh_breakpoints
  return puts "No breakpoints found." if @breakpoints.empty?

  loop do
    show_list
    puts @message if @message
    input = get_input

    case input
    when "q"
      break if exit_program?(input)
    when "r"
      refresh_breakpoints
      @current_index = 0
    when "t"
      toggle_comment
    when "d"
      delete_breakpoint
    when "v"
      show_context
    when "g"
      prompt_for_breakpoint
    when "j"
      move_down
    when "k"
      move_up
    when "h", "?"
      show_help
    end
  end
end