Class: Debugger::IncludeFile

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



28
29
30
31
32
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 28

def help(cmd)
  %{
    include file - adds file/dir to file filter (either remove already excluded or add as included)
  }
end

.help_commandObject



24
25
26
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 24

def help_command
  'include'
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 9

def execute
  file = @match[1]

  return if file.nil?
  file = realpath(file)

  if Command.file_filter_supported?
    Debugger.file_filter.include(file)
    print_file_included(file)
  else
    print_debug("file filter is not supported")
  end
end

#regexpObject



5
6
7
# File 'lib/ruby-debug-ide/commands/file_filtering.rb', line 5

def regexp
  / ^\s*include\s+(.+?)\s*$/x
end