Class: CommandT::Finder
- Inherits:
-
Object
- Object
- CommandT::Finder
- Defined in:
- lib/command_t/finder.rb
Overview
Encapsulates a Scanner instance (which builds up a list of available files in a directory) and a Matcher instance (which selects from that list based on a search string).
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(path = Dir.pwd, options = {}) ⇒ Finder
constructor
A new instance of Finder.
- #path=(path) ⇒ Object
-
#sorted_matches_for(str, options = {}) ⇒ Object
Options: :limit (integer): limit the number of returned matches.
Constructor Details
Instance Method Details
#flush ⇒ Object
43 44 45 |
# File 'lib/command_t/finder.rb', line 43 def flush @scanner.flush end |
#path=(path) ⇒ Object
47 48 49 |
# File 'lib/command_t/finder.rb', line 47 def path= path @scanner.path = path end |
#sorted_matches_for(str, options = {}) ⇒ Object
Options:
:limit (integer): limit the number of returned matches
39 40 41 |
# File 'lib/command_t/finder.rb', line 39 def sorted_matches_for str, = {} @matcher.sorted_matches_for str, end |