todo_finder 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/todo_finder/version.rb +1 -1
- data/lib/todo_finder.rb +5 -4
- metadata +1 -1
data/lib/todo_finder/version.rb
CHANGED
data/lib/todo_finder.rb
CHANGED
@@ -16,8 +16,8 @@ module TodoFinder
|
|
16
16
|
|
17
17
|
all_files.each do |file_name|
|
18
18
|
File.open(file_name, :encoding => 'ISO-8859-1') do |file|
|
19
|
-
file.
|
20
|
-
@matches[file_name] << line if line =~ /TODO/
|
19
|
+
file.each_with_index do |line, i|
|
20
|
+
@matches[file_name] << [i + 1, line] if line =~ /TODO/
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -31,9 +31,10 @@ module TodoFinder
|
|
31
31
|
file_name = file.sub(Dir.pwd, '')
|
32
32
|
puts file_name.yellow
|
33
33
|
|
34
|
-
lines.each do |line|
|
34
|
+
lines.each do |i, line|
|
35
|
+
line_num = i.to_s.green
|
35
36
|
formatted_line = line.sub(/(\*|\/\/|#)\s+?TODO:/, '')
|
36
|
-
puts
|
37
|
+
puts " - [#{line_num}] " << formatted_line.strip
|
37
38
|
end
|
38
39
|
|
39
40
|
puts ''
|