Class: CommandT::Scanner::TagScanner

Inherits:
CommandT::Scanner show all
Defined in:
lib/command-t/scanner/tag_scanner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ TagScanner

Returns a new instance of TagScanner.



9
10
11
12
# File 'lib/command-t/scanner/tag_scanner.rb', line 9

def initialize(options = {})
  @include_filenames = options[:include_filenames] || false
  @cached_tags = nil
end

Instance Attribute Details

#include_filenamesObject (readonly)

Returns the value of attribute include_filenames.



7
8
9
# File 'lib/command-t/scanner/tag_scanner.rb', line 7

def include_filenames
  @include_filenames
end

Instance Method Details

#flushObject



22
23
24
# File 'lib/command-t/scanner/tag_scanner.rb', line 22

def flush
  @cached_tags = nil
end

#pathsObject



14
15
16
17
18
19
20
# File 'lib/command-t/scanner/tag_scanner.rb', line 14

def paths
  @cached_tags ||= taglist.map do |tag|
    path = tag['name']
    path << ":#{tag['filename']}" if @include_filenames
    path
  end.uniq.sort
end