Class: Byebug::ReloadCommand

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

Overview

Implements byebug “reload” command.

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

command_exists?, commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



44
45
46
# File 'lib/byebug/commands/reload.rb', line 44

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

.namesObject



40
41
42
# File 'lib/byebug/commands/reload.rb', line 40

def names
  %w(reload)
end

Instance Method Details

#executeObject



31
32
33
34
35
# File 'lib/byebug/commands/reload.rb', line 31

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

#regexpObject



27
28
29
# File 'lib/byebug/commands/reload.rb', line 27

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