Class: CommandT::Finder::FileFinder

Inherits:
CommandT::Finder show all
Defined in:
lib/command-t/finder/file_finder.rb

Instance Method Summary collapse

Methods inherited from CommandT::Finder

#open_selection, #path=, #sorted_matches_for

Constructor Details

#initialize(path = Dir.pwd, options = {}) ⇒ FileFinder

Returns a new instance of FileFinder.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/command-t/finder/file_finder.rb', line 7

def initialize(path = Dir.pwd, options = {})
  case options.delete(:scanner)
  when 'ruby', nil # ruby is the default
    @scanner = Scanner::FileScanner::RubyFileScanner.new(path, options)
  when 'find'
    @scanner = Scanner::FileScanner::FindFileScanner.new(path, options)
  when 'watchman'
    @scanner = Scanner::FileScanner::WatchmanFileScanner.new(path, options)
  when 'git'
    @scanner = Scanner::FileScanner::GitFileScanner.new(path, options)
  else
    raise ArgumentError, "unknown scanner type '#{options[:scanner]}'"
  end

  @matcher = Matcher.new @scanner, options
end

Instance Method Details

#flushObject



24
25
26
# File 'lib/command-t/finder/file_finder.rb', line 24

def flush
  @scanner.flush
end

#nameObject



28
29
30
# File 'lib/command-t/finder/file_finder.rb', line 28

def name
  'Files'
end