Class: Todoloo::CLI
- Inherits:
-
Thor
- Object
- Thor
- Todoloo::CLI
- Defined in:
- lib/todoloo/cli.rb
Constant Summary collapse
- DEFAULT_PATTERN =
[ "**/*.rb", "*.rb" ].freeze
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
39 40 41 |
# File 'lib/todoloo/cli.rb', line 39 def self.exit_on_failure? true end |
Instance Method Details
#io ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/todoloo/cli.rb', line 31 def io Todoloo::TaskList.new.add( Todoloo::Parser .new .parse_and_transform($stdin.read) ).sort.write($stdout) end |
#scan ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/todoloo/cli.rb', line 16 def scan patterns = .fetch(:pattern, DEFAULT_PATTERN) Todoloo::FileScanner .new( patterns, excludes: .fetch(:exclude, []), trace: .fetch(:verbose) ) .scan .sort .write(.fetch(:output)) end |