toadie 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/README.md +7 -4
- data/lib/toadie/author.rb +45 -0
- data/lib/toadie/errors.rb +7 -0
- data/lib/toadie/extract_todos.rb +16 -0
- data/lib/toadie/fake_results.rb +25 -0
- data/lib/toadie/run.rb +11 -0
- data/lib/toadie/version.rb +1 -1
- data/lib/toadie.rb +1 -1
- metadata +9 -4
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -4,9 +4,7 @@ Toadie greps your (ruby) source code for TODO tags and associate them with your
|
|
4
4
|
|
5
5
|
It's meant to be part of a CI process, so everyone should be able to find her/his open TODOs.
|
6
6
|
|
7
|
-
![
|
8
|
-
|
9
|
-
[1]:http://travis-ci.org/xijo/toadie.png
|
7
|
+
[![Build Status](https://secure.travis-ci.org/xijo/toadie.png?branch=master)](https://travis-ci.org/xijo/toadie)
|
10
8
|
|
11
9
|
## Features
|
12
10
|
|
@@ -80,4 +78,9 @@ The TODO will be assigned to Riker.
|
|
80
78
|
## Todos (haha)
|
81
79
|
|
82
80
|
1. Add customizable file endings to the configuration
|
83
|
-
2. Make output directory/format configurable
|
81
|
+
2. Make output directory/format configurable
|
82
|
+
3. Do a little benchmarking and profiling
|
83
|
+
4. Refine descriptions and texts
|
84
|
+
5. Detect multiline TODOs
|
85
|
+
6. Support more languages
|
86
|
+
7. Link source to github
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Toadie
|
2
|
+
class Author
|
3
|
+
@@authors = []
|
4
|
+
|
5
|
+
attr_accessor :name, :nicknames, :emails
|
6
|
+
|
7
|
+
def self.find_or_create(email, opts = {})
|
8
|
+
find_by_email(email) || create(opts.merge(emails: [email]))
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.find_by_email(email)
|
12
|
+
@@authors.find { |author| author.emails.include?(email) }
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.create(opts = {})
|
16
|
+
opts.keys.each do |key|
|
17
|
+
key.is_a?(String) and opts[key.to_sym] = opts.delete(key)
|
18
|
+
end
|
19
|
+
raise MissingEmail if opts[:emails].nil? || opts[:emails].empty?
|
20
|
+
opts[:nicknames] ||= []
|
21
|
+
@@authors << author = Author.new(opts)
|
22
|
+
author
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.all
|
26
|
+
@@authors
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.destroy_all
|
30
|
+
@@authors.clear
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(params = {})
|
34
|
+
params.each { |key, value| __send__("#{key}=", value) }
|
35
|
+
end
|
36
|
+
|
37
|
+
def identifier
|
38
|
+
@identifier ||= emails.first.downcase.gsub(/\W/, '')
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_s
|
42
|
+
name || nicknames.first || emails.first
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Toadie
|
2
|
+
class ExtractTodos
|
3
|
+
def self.execute
|
4
|
+
if Toadie.test?
|
5
|
+
Toadie::FakeResults.extract_todos
|
6
|
+
else
|
7
|
+
IO.popen('grep TODO -rn --include=\*.{rb,erb,haml,slim,feature} .').readlines
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# Expected input format is: file:line:information
|
12
|
+
def self.split_result(value)
|
13
|
+
value.split(':', 3)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Toadie
|
2
|
+
class FakeResults
|
3
|
+
def self.blame
|
4
|
+
<<-EOS
|
5
|
+
1337 1 1 4
|
6
|
+
author Beverly Crusher
|
7
|
+
author-mail <crusher@uss-enterprise.com>
|
8
|
+
author-time 1352532060
|
9
|
+
author-tz +0100
|
10
|
+
committer Worf
|
11
|
+
committer-mail <worf@uss-enterprise.com>
|
12
|
+
committer-time 1352532060
|
13
|
+
committer-tz +0100
|
14
|
+
summary Initial commit.
|
15
|
+
EOS
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.extract_todos
|
19
|
+
[
|
20
|
+
'fakefile:42:# TODO geordi Refactor warp engine',
|
21
|
+
'fakefile:666:# TODO no1 Clean up the bridge'
|
22
|
+
]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/toadie/run.rb
ADDED
data/lib/toadie/version.rb
CHANGED
data/lib/toadie.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toadie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slop
|
@@ -112,9 +112,14 @@ files:
|
|
112
112
|
- assets/toadie.css
|
113
113
|
- bin/toadie
|
114
114
|
- lib/toadie.rb
|
115
|
+
- lib/toadie/author.rb
|
115
116
|
- lib/toadie/blame.rb
|
116
117
|
- lib/toadie/configuration.rb
|
118
|
+
- lib/toadie/errors.rb
|
119
|
+
- lib/toadie/extract_todos.rb
|
120
|
+
- lib/toadie/fake_results.rb
|
117
121
|
- lib/toadie/report.rb
|
122
|
+
- lib/toadie/run.rb
|
118
123
|
- lib/toadie/todo.rb
|
119
124
|
- lib/toadie/todolist.rb
|
120
125
|
- lib/toadie/version.rb
|
@@ -139,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
144
|
version: '0'
|
140
145
|
segments:
|
141
146
|
- 0
|
142
|
-
hash:
|
147
|
+
hash: -1469595575753713698
|
143
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
149
|
none: false
|
145
150
|
requirements:
|
@@ -148,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
153
|
version: '0'
|
149
154
|
segments:
|
150
155
|
- 0
|
151
|
-
hash:
|
156
|
+
hash: -1469595575753713698
|
152
157
|
requirements: []
|
153
158
|
rubyforge_project:
|
154
159
|
rubygems_version: 1.8.24
|