Class: CommandT::Scanner::TagScanner
- Inherits:
-
CommandT::Scanner
- Object
- CommandT::Scanner
- CommandT::Scanner::TagScanner
- Defined in:
- lib/command-t/scanner/tag_scanner.rb
Instance Attribute Summary collapse
-
#include_filenames ⇒ Object
readonly
Returns the value of attribute include_filenames.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(options = {}) ⇒ TagScanner
constructor
A new instance of TagScanner.
- #paths ⇒ Object
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( = {}) @include_filenames = [:include_filenames] || false @cached_tags = nil end |
Instance Attribute Details
#include_filenames ⇒ Object (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
#flush ⇒ Object
22 23 24 |
# File 'lib/command-t/scanner/tag_scanner.rb', line 22 def flush @cached_tags = nil end |
#paths ⇒ Object
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 |