Class: Debugger::ReloadCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/list.rb

Overview

:nodoc

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



97
98
99
100
101
102
# File 'lib/ruby-debug/commands/list.rb', line 97

def help(cmd)
  %{
    r[eload]\tforces source code reloading
    r[eload] on/off\tenales/disables automatic source code reloading
  }
end

.help_commandObject



93
94
95
# File 'lib/ruby-debug/commands/list.rb', line 93

def help_command
  'reload'
end

Instance Method Details

#executeObject



76
77
78
79
80
81
82
83
84
# File 'lib/ruby-debug/commands/list.rb', line 76

def execute
  if @match[1]
    Debugger.reload_source_on_change = (@match[1] == 'on')
    print "Automatic reloading is #{source_reloading}.\n"
  else
    Debugger.source_reload
    print "Source code is reloaded. Automatic reloading is #{source_reloading}.\n"
  end
end

#regexpObject



72
73
74
# File 'lib/ruby-debug/commands/list.rb', line 72

def regexp
  /^\s*r(?:eload)?(?:\s*(on|off))?$/
end