Class: Byebug::ReloadCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/reload.rb

Overview

Reload source code to pick up latest changes.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



24
25
26
# File 'lib/byebug/commands/reload.rb', line 24

def description
  %(r[eload]      Forces source code reloading.)
end

.namesObject



20
21
22
# File 'lib/byebug/commands/reload.rb', line 20

def names
  %w(reload)
end

Instance Method Details

#executeObject



13
14
15
16
17
# File 'lib/byebug/commands/reload.rb', line 13

def execute
  Byebug.source_reload
  onoff = Setting[:autoreload] ? 'on' : 'off'
  puts "Source code was reloaded. Automatic reloading is #{onoff}"
end

#regexpObject



9
10
11
# File 'lib/byebug/commands/reload.rb', line 9

def regexp
  /^\s* r(?:eload)? \s*$/x
end