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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDQxNjk1OThiZTE1M2NhNjBlMmJiODExNTg0NWNlMzRhYjU2OTFjZA==
4
+ NTg4ZGIzNTI4YmE0MzEyYmRmNzE4YjVlMTY2NjRhYWM0MGZjNmE5NQ==
5
5
  data.tar.gz: !binary |-
6
- YmE4NzZiYjJhZTIyMmIxMGFhMjE0ZjdiNDBlZTQwYjE3NTMwYmY3Mg==
6
+ OTkyYmEwZjliMDJjM2YwOTQwYmE2NTBmMTAyNmE2OGEzYWQ5MmY5Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDcwMTdmMmVkYjEwNzIzN2Y4ODExMDE0YTQ4ZGQ1OGY0ZWMxMGRkOGI5OTVj
10
- MjQ3N2I0MTY4NmYxN2RkNWJkMDRmZWM0ZWJhMzk3NDZkMmQxNTU4YTlmOWJi
11
- ODJiNGMwMDA2MWYyZjllYmFlNGUwMzkxZDI0Y2JhYThlYTlhMzg=
9
+ MGM1YzRmMjdhMzIzZmMzOGNiNTM3NzU1ZGZiZmM1ZTUwMDY3NGE5NDQ0Y2Vh
10
+ OWEwMDQ3ZmZjZDBiYzRlZmEzY2M3NTA0ODhhNzZjM2Y4MjQ3NWIxMDMzYzdj
11
+ OGExNDYwNDFiZjJlODllMTc0ZmY2ZjYzMTFmNWY0NWMyNTNkMTc=
12
12
  data.tar.gz: !binary |-
13
- N2M3OTVmNjYwNDM1YzExYTljOTNlY2U3YzM0NjNmNDMyMGMyOTVmYTY3NDkz
14
- Yjc0ZmU3MjRjNzk1YzI3NzQ2NWJkOTk3YzIxNmNhNTQ0MmZhOWU3ZDIzNTU3
15
- MTQ4ZGJlZWJlY2E3MmY5ODE5Yjg5ZjgyZTE3NmZkNDE2YzMxMDA=
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
- line_num = 0
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
- @out
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
@@ -1,3 +1,3 @@
1
1
  module Totrello
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totrello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Teeter