todo_finder 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/todo_finder.rb CHANGED
@@ -5,6 +5,8 @@ module TodoFinder
5
5
  class Finder
6
6
  attr_accessor :matches
7
7
 
8
+ TODO_REGEX = /(\*|\/\/|#)\s*\[?todo(\]|:| \-)\s+/i
9
+
8
10
  def initialize
9
11
  @matches = Hash.new { |h,k| h[k]=[] }
10
12
  end
@@ -17,7 +19,7 @@ module TodoFinder
17
19
  all_files.each do |file_name|
18
20
  File.open(file_name, :encoding => 'ISO-8859-1') do |file|
19
21
  file.each_with_index do |line, i|
20
- @matches[file_name] << [i + 1, line] if line =~ /TODO/
22
+ @matches[file_name] << [i + 1, line] if line =~ TODO_REGEX
21
23
  end
22
24
  end
23
25
  end
@@ -33,7 +35,7 @@ module TodoFinder
33
35
 
34
36
  lines.each do |i, line|
35
37
  line_num = i.to_s.green
36
- formatted_line = line.sub(/(\*|\/\/|#)\s+?TODO:/, '')
38
+ formatted_line = line.sub(TODO_REGEX, '')
37
39
  puts " - [#{line_num}] " << formatted_line.strip
38
40
  end
39
41
 
@@ -1,3 +1,3 @@
1
1
  module TodoFinder
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: