Class: Byebug::ReloadCommand

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

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



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

def description
  %{r[eload]\tforces source code reloading}
end

.namesObject



17
18
19
# File 'lib/byebug/commands/reload.rb', line 17

def names
  %w(reload)
end

Instance Method Details

#executeObject



10
11
12
13
14
# File 'lib/byebug/commands/reload.rb', line 10

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

#regexpObject



6
7
8
# File 'lib/byebug/commands/reload.rb', line 6

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