totrello 0.1.15 → 0.1.16
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.
- checksums.yaml +8 -8
- data/lib/to_do_find.rb +18 -21
- data/lib/totrello/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTg4ZGIzNTI4YmE0MzEyYmRmNzE4YjVlMTY2NjRhYWM0MGZjNmE5NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTkyYmEwZjliMDJjM2YwOTQwYmE2NTBmMTAyNmE2OGEzYWQ5MmY5Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGM1YzRmMjdhMzIzZmMzOGNiNTM3NzU1ZGZiZmM1ZTUwMDY3NGE5NDQ0Y2Vh
|
10
|
+
OWEwMDQ3ZmZjZDBiYzRlZmEzY2M3NTA0ODhhNzZjM2Y4MjQ3NWIxMDMzYzdj
|
11
|
+
OGExNDYwNDFiZjJlODllMTc0ZmY2ZjYzMTFmNWY0NWMyNTNkMTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDI4ZWJkOTIxYzc0MmQ2YzU2NGFhYjVhODBmNzMxNWFkYjRkYjVjNTljNTJl
|
14
|
+
N2E1ZjgwZGNkMDFkODEzN2EwYmU5MDIxZDRkMzcwMTc2N2YwM2MxZDUxOTRm
|
15
|
+
MTU1ODFhYTBlYzIzNjFlNGIzYThmZDFkNjAzZjE4MzM3MDhjOTI=
|
data/lib/to_do_find.rb
CHANGED
@@ -29,41 +29,38 @@ class ToDoFind
|
|
29
29
|
todos
|
30
30
|
end
|
31
31
|
|
32
|
-
#TODO: Kind of important but this doesn't seem to be working...
|
33
|
-
private
|
34
32
|
def find_todo(file)
|
33
|
+
todo_styles = ['TODO']
|
35
34
|
@out = []
|
36
35
|
code_lines = File.readlines(file)
|
36
|
+
|
37
37
|
return @out unless code_lines.grep('/TODO/' || '/todo/')
|
38
38
|
|
39
|
-
|
40
|
-
code_lines.each do |code_line|
|
41
|
-
line_num += 1
|
42
|
-
todo_location = is_todo?( code_line, 'TODO' )
|
43
|
-
todo_location ||= is_todo?( code_line, 'TODO:' )
|
44
|
-
todo_location ||= is_todo?( code_line, ' TODO:' )
|
45
|
-
todo_location ||= is_todo?( code_line, ' TODO' )
|
46
|
-
todo_location ||= is_todo?( code_line, '#TODO:' )
|
47
|
-
todo_location ||= is_todo?( code_line, '#TODO' )
|
48
|
-
unless todo_location.nil?
|
49
|
-
temp_string_array = code_line.split(' ')
|
50
|
-
todo = code_line.split(' ')[(todo_location + 1)..((temp_string_array.length) - 1)].join(' ')
|
51
|
-
#puts "Found! #{todo}"
|
52
|
-
todo_and_location = {:todo => todo,
|
53
|
-
:location => line_num}
|
54
|
-
@out.append(todo_and_location)
|
55
|
-
end
|
39
|
+
code_lines= code_lines.map.with_index { |x,i| {:todo => x, :location => i + 1}}
|
56
40
|
|
41
|
+
todo_styles.each do |tds|
|
42
|
+
@out = code_lines.find_all { |i| i[:todo].include?(tds)}
|
43
|
+
end
|
57
44
|
|
45
|
+
clean_todos(@out)
|
46
|
+
end
|
58
47
|
|
48
|
+
private
|
49
|
+
def clean_todos(todo_array)
|
50
|
+
todo_array.each do |found_todos|
|
51
|
+
found_todos[:todo].gsub!('TODO:', '')
|
52
|
+
found_todos[:todo].gsub!('TODO', '')
|
53
|
+
found_todos[:todo].gsub!('#', '')
|
54
|
+
found_todos[:todo].chomp!
|
55
|
+
found_todos[:todo].lstrip!
|
59
56
|
end
|
60
|
-
|
57
|
+
|
61
58
|
end
|
62
59
|
|
63
60
|
private
|
64
61
|
def is_todo?( string, test_string )
|
65
62
|
begin
|
66
|
-
string.split(' ').index test_string
|
63
|
+
string.split(' ').index test_string != 0 ? true : false
|
67
64
|
rescue
|
68
65
|
return nil
|
69
66
|
end
|
data/lib/totrello/version.rb
CHANGED