Class: Debtective::Todos::List
- Inherits:
-
Object
- Object
- Debtective::Todos::List
- Defined in:
- lib/debtective/todos/list.rb
Overview
Information about the todos in the codebase
Defined Under Namespace
Classes: Author
Instance Method Summary collapse
- #authors ⇒ Array<Debtective::Todos::List::Author>
- #combined_count ⇒ Integer
- #extended_count ⇒ Integer
-
#initialize(paths) ⇒ List
constructor
A new instance of List.
- #todos ⇒ Array<Debtective::Todos::Todo>
Constructor Details
#initialize(paths) ⇒ List
Returns a new instance of List.
12 13 14 |
# File 'lib/debtective/todos/list.rb', line 12 def initialize(paths) @paths = paths end |
Instance Method Details
#authors ⇒ Array<Debtective::Todos::List::Author>
22 23 24 25 26 27 |
# File 'lib/debtective/todos/list.rb', line 22 def todos .map { [_1.commit..email, _1.commit..name] } .uniq .map { (_1) } end |
#combined_count ⇒ Integer
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/debtective/todos/list.rb', line 35 def combined_count todos .group_by(&:pathname) .values .sum do |pathname_todos| pathname_todos .map { _1.statement_boundaries.to_a } .reduce(:|) .length end end |
#extended_count ⇒ Integer
30 31 32 |
# File 'lib/debtective/todos/list.rb', line 30 def extended_count todos.sum(&:size) end |
#todos ⇒ Array<Debtective::Todos::Todo>
17 18 19 |
# File 'lib/debtective/todos/list.rb', line 17 def todos @todos ||= Debtective::Todos::Find.new(@paths).call end |