Class: Todoloo::FileScanner
- Inherits:
-
Object
- Object
- Todoloo::FileScanner
- Defined in:
- lib/todoloo/file_scanner.rb
Overview
File scanner for finding todos
Instance Method Summary collapse
-
#initialize(pattern, excludes: [], trace: nil) ⇒ FileScanner
constructor
A new instance of FileScanner.
- #scan ⇒ Todoloo::TaskList
Constructor Details
#initialize(pattern, excludes: [], trace: nil) ⇒ FileScanner
Returns a new instance of FileScanner.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/todoloo/file_scanner.rb', line 6 def initialize(pattern, excludes: [], trace: nil) @parsers = Concurrent::Hash.new @pattern = pattern @excludes = excludes @trace_output = case trace when nil, false nil when true $stderr when String File.open(trace, "w") else raise ArgumentError, "Invalid value #{trace} for argument trace" end end |
Instance Method Details
#scan ⇒ Todoloo::TaskList
26 27 28 |
# File 'lib/todoloo/file_scanner.rb', line 26 def scan Todoloo::TaskList.new.add(scan_files) end |