todo_finder 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 ''
|