File: continue.rb

package info (click to toggle)
ruby-pry-byebug 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 324 kB
  • sloc: ruby: 1,171; makefile: 4
file content (43 lines) | stat: -rw-r--r-- 1,102 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
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
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"
require "pry-byebug/helpers/breakpoints"
require "pry-byebug/helpers/location"

module PryByebug
  #
  # Continue program execution until the next breakpoint
  #
  class ContinueCommand < Pry::ClassCommand
    include Helpers::Navigation
    include Helpers::Breakpoints
    include Helpers::Location

    match "continue"
    group "Byebug"
    description "Continue program execution and end the Pry session."

    banner <<-BANNER
      Usage: continue [LINE]

      Continue program execution until the next breakpoint, or the program
      ends. Optionally continue to the specified line number.

      Examples:
        continue   #=> Continue until the next breakpoint.
        continue 4 #=> Continue to line number 4.
    BANNER

    def process
      PryByebug.check_file_context(target)

      breakpoints.add_file(current_file, args.first.to_i) if args.first

      breakout_navigation :continue
    ensure
      Byebug.stop if Byebug.stoppable?
    end
  end
end

Pry::Commands.add_command(PryByebug::ContinueCommand)