toadie 0.0.7 → 0.0.8
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 +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/bin/toadie +2 -10
- data/spec/author_spec.rb +17 -17
- data/spec/blame_spec.rb +5 -5
- data/spec/configuration_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/todo_spec.rb +10 -10
- data/spec/todolist_spec.rb +8 -8
- data/toadie.gemspec +1 -0
- data/views/report.slim +4 -4
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e95097061c361ec97ecd18e8861ea96b6d2be91a
|
4
|
+
data.tar.gz: 52674a10610a578eba4f54623c8cd9c370462748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e12a6532a70f944f8b43369d7afd89f12b4ac6e2dd153ea5bb0da158b88dbfcd4b8e640d45b9114ff07f1a7068ceedc8382155d87dcf79633a2fce8602abded2
|
7
|
+
data.tar.gz: 07f0e36473bffc4274682fc7c797175f2e224f2e06ac3d987fa8dfdb5d8cf1a6050f376df96d2d1128fb2352b0f136ec7942773930e7af5791f565379879f4c0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-2.3.0
|
data/.travis.yml
CHANGED
data/bin/toadie
CHANGED
@@ -5,18 +5,10 @@ require 'toadie'
|
|
5
5
|
require 'slop'
|
6
6
|
require 'json'
|
7
7
|
|
8
|
-
opts = Slop.parse do
|
9
|
-
|
10
|
-
on :c, :config, 'Configuration file', :argument => :optional
|
8
|
+
opts = Slop.parse do |o|
|
9
|
+
o.string '-c', '--config', 'configuration file'
|
11
10
|
end
|
12
11
|
|
13
|
-
# puts opts.help
|
14
|
-
|
15
|
-
# # if ARGV is `--name Lee -v`
|
16
|
-
# opts.verbose? #=> true
|
17
|
-
# opts.password? #=> false
|
18
|
-
# opts[:name] #=> 'lee'
|
19
|
-
|
20
12
|
config_file = opts[:config] || File.join(Toadie.root, '.toadie.json')
|
21
13
|
if File.exist?(config_file)
|
22
14
|
config = JSON.parse(File.read(config_file))
|
data/spec/author_spec.rb
CHANGED
@@ -4,49 +4,49 @@ describe Toadie::Author do
|
|
4
4
|
let(:author) { Toadie::Author.new(name: 'Geordi LaForge', emails: ['Geordi@uss-enterprise.com'], nicknames: ['geordi', 'laforge']) }
|
5
5
|
|
6
6
|
it "sets attributes on initialize" do
|
7
|
-
author.name.
|
8
|
-
author.emails.
|
9
|
-
author.nicknames.
|
7
|
+
expect(author.name).to eq 'Geordi LaForge'
|
8
|
+
expect(author.emails).to eq ['Geordi@uss-enterprise.com']
|
9
|
+
expect(author.nicknames).to eq ['geordi', 'laforge']
|
10
10
|
end
|
11
11
|
|
12
12
|
it "builds a identifier by using the email" do
|
13
|
-
author.identifier.
|
13
|
+
expect(author.identifier).to eq 'geordiussenterprisecom'
|
14
14
|
end
|
15
15
|
|
16
16
|
describe "#to_s" do
|
17
17
|
it "uses the name attribute if present" do
|
18
|
-
author.to_s.
|
18
|
+
expect(author.to_s).to eq "Geordi LaForge"
|
19
19
|
end
|
20
20
|
|
21
21
|
it "uses a nickname if present" do
|
22
22
|
author.name = nil
|
23
|
-
author.to_s.
|
23
|
+
expect(author.to_s).to eq 'geordi'
|
24
24
|
end
|
25
25
|
|
26
26
|
it "uses the email address finally" do
|
27
27
|
author.name = nil
|
28
28
|
author.nicknames = []
|
29
|
-
author.to_s.
|
29
|
+
expect(author.to_s).to eq 'Geordi@uss-enterprise.com'
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
describe "#find_by_email" do
|
34
34
|
it "returns a author if it exists" do
|
35
35
|
author = Toadie::Author.create(emails: ['androids@humanafterall.org', 'data@uss-enterprise.com'])
|
36
|
-
Toadie::Author.find_by_email('data@uss-enterprise.com').
|
36
|
+
expect(Toadie::Author.find_by_email('data@uss-enterprise.com')).to eq author
|
37
37
|
end
|
38
38
|
|
39
39
|
it "returns nil if no author was found" do
|
40
|
-
Toadie::Author.find_by_email('q@uss-enterprise.com').
|
40
|
+
expect(Toadie::Author.find_by_email('q@uss-enterprise.com')).to be_nil
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe "#create" do
|
45
45
|
it "assigns all attributes to the author" do
|
46
46
|
author = Toadie::Author.create(emails: ['data@uss-enterprise.com'], name: 'Data', nicknames: ['data'])
|
47
|
-
author.name.
|
48
|
-
author.emails.
|
49
|
-
author.nicknames.
|
47
|
+
expect(author.name).to eq 'Data'
|
48
|
+
expect(author.emails).to eq ['data@uss-enterprise.com']
|
49
|
+
expect(author.nicknames).to eq ['data']
|
50
50
|
end
|
51
51
|
|
52
52
|
it "works with symbolized hash key" do
|
@@ -72,17 +72,17 @@ describe Toadie::Author do
|
|
72
72
|
it "returns a author if it was found" do
|
73
73
|
author = Toadie::Author.create(emails: ['no1@uss-enterprise.com'])
|
74
74
|
expect {
|
75
|
-
Toadie::Author.find_or_create('no1@uss-enterprise.com').
|
75
|
+
expect(Toadie::Author.find_or_create('no1@uss-enterprise.com')).to eq author
|
76
76
|
}.to_not change { Toadie::Author.all.size }
|
77
77
|
end
|
78
78
|
|
79
79
|
it "creates a author if it was not found" do
|
80
80
|
expect {
|
81
81
|
author = Toadie::Author.find_or_create('no1@uss-enterprise.com', name: 'William T. Riker', nicknames: ['riker', 'no1'])
|
82
|
-
author.emails.
|
83
|
-
author.name.
|
84
|
-
author.nicknames.
|
82
|
+
expect(author.emails).to eq ['no1@uss-enterprise.com']
|
83
|
+
expect(author.name).to eq 'William T. Riker'
|
84
|
+
expect(author.nicknames).to eq ['riker', 'no1']
|
85
85
|
}.to change { Toadie::Author.all.size }.by(1)
|
86
86
|
end
|
87
87
|
end
|
88
|
-
end
|
88
|
+
end
|
data/spec/blame_spec.rb
CHANGED
@@ -4,13 +4,13 @@ describe Toadie::Blame do
|
|
4
4
|
it "builds a author on initialize" do
|
5
5
|
expect {
|
6
6
|
blame = Toadie::Blame.new('fakefile', 42)
|
7
|
-
blame.author.
|
7
|
+
expect(blame.author).to be_a(Toadie::Author)
|
8
8
|
}.to change { Toadie::Author.all.size }.by(1)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "#execute" do
|
12
12
|
it "returns test results in test mode" do
|
13
|
-
Toadie::Blame.execute('fakefile', 42).
|
13
|
+
expect(Toadie::Blame.execute('fakefile', 42)).to eq Toadie::FakeResults.blame
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -18,8 +18,8 @@ describe Toadie::Blame do
|
|
18
18
|
it "gets name and email correctly from a blame porcelain result" do
|
19
19
|
result = Toadie::FakeResults.blame
|
20
20
|
name, email = Toadie::Blame.extract_author(result)
|
21
|
-
name.
|
22
|
-
email.
|
21
|
+
expect(name).to eq 'Beverly Crusher'
|
22
|
+
expect(email).to eq 'crusher@uss-enterprise.com'
|
23
23
|
end
|
24
24
|
end
|
25
|
-
end
|
25
|
+
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -5,12 +5,12 @@ describe Toadie::Configuration do
|
|
5
5
|
|
6
6
|
describe "#todo_markers" do
|
7
7
|
it "returns default todo markers if nothing was provided" do
|
8
|
-
config.todo_markers.
|
8
|
+
expect(config.todo_markers).to eq Toadie.default_todo_markers
|
9
9
|
end
|
10
10
|
|
11
11
|
it "returns custom todo markers if provided" do
|
12
12
|
config.todo_markers = [:foo, :bar]
|
13
|
-
config.todo_markers.
|
13
|
+
expect(config.todo_markers).to eq [:foo, :bar]
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/todo_spec.rb
CHANGED
@@ -5,14 +5,14 @@ describe Toadie::Todo do
|
|
5
5
|
|
6
6
|
describe "#initialize" do
|
7
7
|
it "assigns the given attributes" do
|
8
|
-
todo.file.
|
9
|
-
todo.line.
|
10
|
-
todo.text.
|
8
|
+
expect(todo.file).to eq 'fakefile'
|
9
|
+
expect(todo.line).to eq 42
|
10
|
+
expect(todo.text).to eq 'TODO text'
|
11
11
|
end
|
12
12
|
|
13
13
|
it "converts provided input into string without failing" do
|
14
14
|
todo = Toadie::Todo.new('fakefile', 42, self.class)
|
15
|
-
todo.text.
|
15
|
+
expect(todo.text).to be_a String
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -21,19 +21,19 @@ describe Toadie::Todo do
|
|
21
21
|
todo = Toadie::Todo.new('fakefile', 42, 'TODO jean-luc go to the doctor!')
|
22
22
|
crusher = Toadie::Author.find_by_email('crusher@uss-enterprise.com') # created by fake blame
|
23
23
|
|
24
|
-
todo.author.
|
25
|
-
todo.responsible.
|
26
|
-
todo.
|
24
|
+
expect(todo.author).to eq crusher
|
25
|
+
expect(todo.responsible).to eq picard
|
26
|
+
expect(todo).to be_reassigned
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "#to_s" do
|
30
30
|
it "returns the text is present" do
|
31
|
-
todo.to_s.
|
31
|
+
expect(todo.to_s).to eq todo.text
|
32
32
|
end
|
33
33
|
|
34
34
|
it "returns a no-text message otherwise" do
|
35
35
|
todo.text = ''
|
36
|
-
todo.to_s.
|
36
|
+
expect(todo.to_s).to eq '<no content>'
|
37
37
|
end
|
38
38
|
end
|
39
|
-
end
|
39
|
+
end
|
data/spec/todolist_spec.rb
CHANGED
@@ -9,18 +9,18 @@ describe Toadie::Todolist do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "builds Todos for the input data" do
|
12
|
-
todolist.size.
|
13
|
-
todolist.size.
|
14
|
-
todolist.todos.first.
|
15
|
-
todolist.todos.last.
|
12
|
+
expect(todolist.size).to eq todolist.todos.size
|
13
|
+
expect(todolist.size).to eq 2
|
14
|
+
expect(todolist.todos.first).to be_a Toadie::Todo
|
15
|
+
expect(todolist.todos.last).to be_a Toadie::Todo
|
16
16
|
end
|
17
17
|
|
18
18
|
it "groups todos by responsible author" do
|
19
19
|
responsible = todolist.todos.first.responsible
|
20
20
|
grouped = todolist.grouped
|
21
21
|
|
22
|
-
grouped.
|
23
|
-
grouped.
|
24
|
-
grouped[responsible].
|
22
|
+
expect(grouped).to be_a Hash
|
23
|
+
expect(grouped).to have_key responsible
|
24
|
+
expect(grouped[responsible]).to eq todolist.todos
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
data/toadie.gemspec
CHANGED
data/views/report.slim
CHANGED
@@ -36,8 +36,8 @@ html
|
|
36
36
|
- grouped.each do |author, todos|
|
37
37
|
li
|
38
38
|
a href="##{author.identifier}_tab" data-toggle='tab'
|
39
|
-
span.badge
|
40
|
-
|
39
|
+
span.badge=> todos.size
|
40
|
+
=> author
|
41
41
|
|
42
42
|
.tab-content
|
43
43
|
.tab-pane.active
|
@@ -45,7 +45,7 @@ html
|
|
45
45
|
- grouped.each do |author, todos|
|
46
46
|
.tab-pane id="#{author.identifier}_tab"
|
47
47
|
.alert.alert-info
|
48
|
-
p.lead
|
48
|
+
p.lead=> author.name
|
49
49
|
dl.dl-horizontal
|
50
50
|
- if !author.emails.empty?
|
51
51
|
dt Email adresses
|
@@ -61,7 +61,7 @@ html
|
|
61
61
|
span.muted
|
62
62
|
' assigned by
|
63
63
|
span.label.label-warning
|
64
|
-
|
64
|
+
=> todo.author
|
65
65
|
small
|
66
66
|
= todo.file
|
67
67
|
|:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Opper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slim
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: slop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
142
|
version: '0'
|
129
143
|
requirements: []
|
130
144
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.5.1
|
132
146
|
signing_key:
|
133
147
|
specification_version: 4
|
134
148
|
summary: Analyze your source code, find open todos and output a nice html report.
|
@@ -139,3 +153,4 @@ test_files:
|
|
139
153
|
- spec/spec_helper.rb
|
140
154
|
- spec/todo_spec.rb
|
141
155
|
- spec/todolist_spec.rb
|
156
|
+
has_rdoc:
|