Class: Toadie::ExtractTodos

Inherits:
Object
  • Object
show all
Defined in:
lib/toadie/extract_todos.rb

Class Method Summary collapse

Class Method Details

.executeObject



3
4
5
6
7
8
9
10
11
# File 'lib/toadie/extract_todos.rb', line 3

def self.execute
  if Toadie.test?
    Toadie::FakeResults.extract_todos
  else
    grep_includes = Toadie.file_extensions.inject('') { |m, ex| m + "--include=*.#{ex} " }
    marker_regexp = Toadie.todo_markers * '|'
    IO.popen("egrep \"#{marker_regexp}\" -rn #{grep_includes} #{Toadie.root}").readlines
  end
end

.split_result(value) ⇒ Object

Expected input format is: file:line:information



14
15
16
# File 'lib/toadie/extract_todos.rb', line 14

def self.split_result(value)
  value.split(':', 3)
end