Class: CommandT::Finder::FileFinder
- Inherits:
-
CommandT::Finder
- Object
- CommandT::Finder
- CommandT::Finder::FileFinder
- Defined in:
- lib/command-t/finder/file_finder.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(path = Dir.pwd, options = {}) ⇒ FileFinder
constructor
A new instance of FileFinder.
- #name ⇒ Object
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, = {}) case .delete(:scanner) when 'ruby', nil # ruby is the default @scanner = Scanner::FileScanner::RubyFileScanner.new(path, ) when 'find' @scanner = Scanner::FileScanner::FindFileScanner.new(path, ) when 'watchman' @scanner = Scanner::FileScanner::WatchmanFileScanner.new(path, ) when 'git' @scanner = Scanner::FileScanner::GitFileScanner.new(path, ) else raise ArgumentError, "unknown scanner type '#{[:scanner]}'" end @matcher = Matcher.new @scanner, end |
Instance Method Details
#flush ⇒ Object
24 25 26 |
# File 'lib/command-t/finder/file_finder.rb', line 24 def flush @scanner.flush end |
#name ⇒ Object
28 29 30 |
# File 'lib/command-t/finder/file_finder.rb', line 28 def name 'Files' end |