Class: Byebug::Runner
- Inherits:
-
Object
- Object
- Byebug::Runner
- Includes:
- ParseFunctions
- Defined in:
- lib/byebug/runner.rb
Overview
Responsible for starting the debugger when started from the command line.
Defined Under Namespace
Classes: InvalidScript, NoScript, NonExistentScript
Instance Attribute Summary collapse
-
#help ⇒ Object
Special working modes that don’t actually start the debugger.
-
#remote ⇒ Object
Special working modes that don’t actually start the debugger.
-
#version ⇒ Object
Special working modes that don’t actually start the debugger.
Instance Method Summary collapse
-
#banner ⇒ Object
Usage banner.
-
#initialize(stop = true, quit = true) ⇒ Runner
constructor
starting the program.
-
#run ⇒ Object
Starts byebug to debug a program.
Methods included from ParseFunctions
#get_int, #parse_steps, #syntax_valid?, #without_stderr
Constructor Details
#initialize(stop = true, quit = true) ⇒ Runner
starting the program.
finishing the program.
38 39 40 |
# File 'lib/byebug/runner.rb', line 38 def initialize(stop = true, quit = true) @stop, @quit = stop, quit end |
Instance Attribute Details
#help ⇒ Object
Special working modes that don’t actually start the debugger.
29 30 31 |
# File 'lib/byebug/runner.rb', line 29 def help @help end |
#remote ⇒ Object
Special working modes that don’t actually start the debugger.
29 30 31 |
# File 'lib/byebug/runner.rb', line 29 def remote @remote end |
#version ⇒ Object
Special working modes that don’t actually start the debugger.
29 30 31 |
# File 'lib/byebug/runner.rb', line 29 def version @version end |
Instance Method Details
#banner ⇒ Object
Usage banner.
45 46 47 48 49 50 51 52 53 |
# File 'lib/byebug/runner.rb', line 45 def <<-EOB.gsub(/^ {8}/, '') byebug #{Byebug::VERSION} Usage: byebug [options] <script.rb> -- <script.rb parameters> EOB end |
#run ⇒ Object
Starts byebug to debug a program
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/byebug/runner.rb', line 58 def run .order!($ARGV) if version Byebug.puts("\n Running byebug #{version}\n") return end if help Byebug.puts("#{help}\n") return end if remote Byebug.start_client(*remote) return end setup_cmd_line_args loop do debug_program break if @quit processor = Byebug::ControlCommandProcessor.new processor.process_commands end end |