Class: Debugger::VarGlobalCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug-ide/commands/variables.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, file_filter_supported?, #find, inherited, #initialize, load_commands, #match, method_missing, options, unescape_incoming

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



53
54
55
56
57
# File 'lib/ruby-debug-ide/commands/variables.rb', line 53

def help(cmd)
  %{
    v[ar] g[lobal]\t\t\tshow global variables
  }
end

.help_commandObject



49
50
51
# File 'lib/ruby-debug-ide/commands/variables.rb', line 49

def help_command
  'var'
end

Instance Method Details

#executeObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ruby-debug-ide/commands/variables.rb', line 36

def execute
  globals = []
  if RUBY_VERSION < "1.9"
    globals = global_variables - ['$=', '$IGNORECASE']
  else
    globals = global_variables - [:$KCODE, :$-K, :$=, :$IGNORECASE, :$FILENAME]
  end
  print_variables(globals, 'global') do |var|
    debug_eval(var)
  end
end

#regexpObject



32
33
34
# File 'lib/ruby-debug-ide/commands/variables.rb', line 32

def regexp
  /^\s*v(?:ar)?\s+g(?:lobal)?\s*$/
end