Class: Debugger::FileFilterCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug-ide/commands/file_filtering.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



100
101
102
103
104
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 100

def help(cmd)
  %{
    file-filter (on|off) - enable/disable file  filtering
  }
end

.help_commandObject



96
97
98
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 96

def help_command
  'file-filter'
end

Instance Method Details

#executeObject



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 77

def execute
  action = @match[1]

  if Command.file_filter_supported?
    if 'on' == action
      Debugger.file_filter.enable
      print_file_filter_status(true)
    elsif 'off' == action
      Debugger.file_filter.disable
      print_file_filter_status(false)
    else
      print_error "Unknown option '#{action}'"
    end
  else
    print_debug("file filter is not supported")
  end
end

#regexpObject



73
74
75
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 73

def regexp
  / ^\s*file-filter\s+(on|off)\s*$/x
end