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.
@@ -1,3 +1,3 @@
1
1
  module TodoFinder
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.each_line do |line|
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 ' - ' << formatted_line.strip
37
+ puts " - [#{line_num}] " << formatted_line.strip
37
38
  end
38
39
 
39
40
  puts ''
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todo_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: