totrello 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTg4ZGIzNTI4YmE0MzEyYmRmNzE4YjVlMTY2NjRhYWM0MGZjNmE5NQ==
4
+ M2I1MTE3ZTJjMDJmZjBlNGExOWNkMTRkMjIxODI1MDY4YjMyNDZmMg==
5
5
  data.tar.gz: !binary |-
6
- OTkyYmEwZjliMDJjM2YwOTQwYmE2NTBmMTAyNmE2OGEzYWQ5MmY5Yg==
6
+ ZTQ3NTdlNGZkMTk2OGYzZDNmYzhlNzU0MjEwNjgxYTVjYjhmZGQxMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGM1YzRmMjdhMzIzZmMzOGNiNTM3NzU1ZGZiZmM1ZTUwMDY3NGE5NDQ0Y2Vh
10
- OWEwMDQ3ZmZjZDBiYzRlZmEzY2M3NTA0ODhhNzZjM2Y4MjQ3NWIxMDMzYzdj
11
- OGExNDYwNDFiZjJlODllMTc0ZmY2ZjYzMTFmNWY0NWMyNTNkMTc=
9
+ Y2FmMTdiYTg5OTE0MGJkNzA4NDViMzJkNDRhZjhhZWYyODg4ZDI3ZDY1MDg5
10
+ NTRhZWUzYmEwY2EwOWI0ZTM2ZjY1MzZiNjM0ODNjNjRjMzYyYzNiOTNlZTcz
11
+ YzJmOGIzNjRkMTVkMGI5YTJmMDEyMThlNzZjZTI4YTg1ZWJjYTI=
12
12
  data.tar.gz: !binary |-
13
- MDI4ZWJkOTIxYzc0MmQ2YzU2NGFhYjVhODBmNzMxNWFkYjRkYjVjNTljNTJl
14
- N2E1ZjgwZGNkMDFkODEzN2EwYmU5MDIxZDRkMzcwMTc2N2YwM2MxZDUxOTRm
15
- MTU1ODFhYTBlYzIzNjFlNGIzYThmZDFkNjAzZjE4MzM3MDhjOTI=
13
+ ODY1M2ZhMDg1NzcwNmQ2NzQ4ZDdmN2M4NjE4YTEwN2MwZDJkMTU0ZmU0YWY5
14
+ YjI3OTRhMDU0YzhiYTdkNDBlNjRkOTFiNTU5ZjQ2MTJkOWM1Mzk1ZTM1MDJh
15
+ Y2IwMWEzNzZjY2U4M2JjYjg1ZWU2MjJlYjE5MzlmNzY3MTIwOTI=
data/lib/to_do_find.rb CHANGED
@@ -30,7 +30,7 @@ class ToDoFind
30
30
  end
31
31
 
32
32
  def find_todo(file)
33
- todo_styles = ['TODO']
33
+ todo_styles = ['TODO', '#TODO', '#TODO:', 'TODO:']
34
34
  @out = []
35
35
  code_lines = File.readlines(file)
36
36
 
@@ -39,10 +39,10 @@ class ToDoFind
39
39
  code_lines= code_lines.map.with_index { |x,i| {:todo => x, :location => i + 1}}
40
40
 
41
41
  todo_styles.each do |tds|
42
- @out = code_lines.find_all { |i| i[:todo].include?(tds)}
42
+ @out.concat((code_lines.find_all { |i| is_todo?(i[:todo], (tds))}))
43
43
  end
44
44
 
45
- clean_todos(@out)
45
+ clean_todos(@out).sort_by { |hsh| hsh[:todo] }
46
46
  end
47
47
 
48
48
  private
@@ -60,9 +60,14 @@ class ToDoFind
60
60
  private
61
61
  def is_todo?( string, test_string )
62
62
  begin
63
- string.split(' ').index test_string != 0 ? true : false
63
+ location = string.split(' ').index test_string
64
+ if location.nil?
65
+ return false
66
+ else
67
+ return true
68
+ end
64
69
  rescue
65
- return nil
70
+ false
66
71
  end
67
72
 
68
73
  end
@@ -1,3 +1,3 @@
1
1
  module Totrello
2
- VERSION = "0.1.16"
2
+ VERSION = "0.1.17"
3
3
  end
@@ -3,4 +3,17 @@
3
3
  # TODO test3
4
4
  # TODO: test4}
5
5
  #TODO test5
6
- #TODO: test6
6
+ #TODO: test6
7
+ todo
8
+ todo.test
9
+ TODO.tst #sdfasdfasdf
10
+ def clean_todos(todo_array)
11
+ todo_array.each do |found_todos|
12
+ found_todos[:todo].gsub!('TODO:', '')
13
+ found_todos[:todo].gsub!('TODO', '')
14
+ found_todos[:todo].gsub!('#', '')
15
+ found_todos[:todo].chomp!
16
+ found_todos[:todo].lstrip!
17
+ end
18
+
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totrello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Teeter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-05 00:00:00.000000000 Z
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler