gitalytics 1.3.1 → 1.4.0
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 +5 -5
- data/CHANGELOG.md +19 -0
- data/Gemfile +7 -4
- data/README.md +70 -29
- data/Rakefile +3 -1
- data/assets/report.html.erb +295 -0
- data/bin/gitalytics +42 -7
- data/gitalytics.gemspec +10 -13
- data/lib/gitalytics/cli_report.rb +160 -0
- data/lib/gitalytics/cli_text.rb +40 -0
- data/lib/gitalytics/commit.rb +7 -5
- data/lib/gitalytics/git_error.rb +6 -0
- data/lib/gitalytics/gitlog.rb +111 -49
- data/lib/gitalytics/json_report.rb +54 -0
- data/lib/gitalytics/report.rb +302 -0
- data/lib/gitalytics/user.rb +16 -16
- data/lib/gitalytics/version.rb +3 -1
- data/lib/gitalytics.rb +33 -39
- metadata +22 -111
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -16
- data/.travis.yml +0 -5
- data/Gemfile.lock +0 -51
- data/assets/_authors.html.haml +0 -50
- data/assets/_commits.html.haml +0 -21
- data/assets/_css.html.haml +0 -190
- data/assets/_dashboard.html.haml +0 -45
- data/assets/_dates.html.haml +0 -24
- data/assets/_javascript.html.haml +0 -44
- data/assets/gitalytics.html.haml +0 -63
- data/lib/haml_helper.rb +0 -8
- data/test/files/block1 +0 -4
- data/test/files/block2 +0 -4
- data/test/files/block3 +0 -7
- data/test/files/git_log +0 -15
- data/test/lib/test_commit.rb +0 -31
- data/test/lib/test_gitlog.rb +0 -80
- data/test/lib/test_user.rb +0 -97
- data/test/test_helper.rb +0 -2
data/test/lib/test_user.rb
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')
|
|
2
|
-
require 'minitest/autorun'
|
|
3
|
-
require 'gitalytics/user'
|
|
4
|
-
require 'gitalytics/commit'
|
|
5
|
-
require 'date'
|
|
6
|
-
|
|
7
|
-
class TestUser < MiniTest::Unit::TestCase
|
|
8
|
-
def setup
|
|
9
|
-
@user = User.new('John ñ Doe', 'john@doe.com')
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def create_commit(hash, date, summary_data)
|
|
13
|
-
Commit.new(hash).tap do |commit|
|
|
14
|
-
commit.date = Date.parse(date)
|
|
15
|
-
summary_data.each { |summary| commit.summary << summary }
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def create_commits(user)
|
|
20
|
-
user.commits << create_commit(
|
|
21
|
-
'abcdef',
|
|
22
|
-
'2000-01-10',
|
|
23
|
-
[{ filename: 'a.rb', insertions: 1, deletions: 0 }])
|
|
24
|
-
user.commits << create_commit(
|
|
25
|
-
'abcdef',
|
|
26
|
-
'2000-01-01',
|
|
27
|
-
[{ filename: 'c.rb', insertions: 0, deletions: 1 }])
|
|
28
|
-
user.commits << create_commit(
|
|
29
|
-
'abcdef',
|
|
30
|
-
'2000-01-01',
|
|
31
|
-
[{ filename: 'd.rb', insertions: 4, deletions: 5 }])
|
|
32
|
-
user.commits << create_commit(
|
|
33
|
-
'abcdef',
|
|
34
|
-
'2000-01-08',
|
|
35
|
-
[{ filename: 'e.rb', insertions: 1, deletions: 1 }])
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def test_initial_color
|
|
39
|
-
assert_match(/\d{1,3}, \d{1,3}, \d{1,3}/, @user.colors)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def test_gravatar_is_md5
|
|
43
|
-
assert_match(/[a-f0-9]{32}/, @user.gravatar)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def test_first_commit
|
|
47
|
-
create_commits(@user)
|
|
48
|
-
|
|
49
|
-
assert_equal(Date.parse('2000-1-1'), @user.first_commit.date)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def test_last_commit
|
|
53
|
-
create_commits(@user)
|
|
54
|
-
|
|
55
|
-
assert_equal(Date.parse('2000-1-10'), @user.last_commit.date)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def test_commits_period
|
|
59
|
-
create_commits(@user)
|
|
60
|
-
|
|
61
|
-
assert_equal(10, @user.commits_period)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def test_working_days
|
|
65
|
-
create_commits(@user)
|
|
66
|
-
|
|
67
|
-
assert_equal(3, @user.working_days)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def test_weekday_commits
|
|
71
|
-
create_commits(@user)
|
|
72
|
-
|
|
73
|
-
assert_equal([0, 1, 0, 0, 0, 0, 3], @user.weekday_commits)
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
def test_total_insertions
|
|
77
|
-
create_commits(@user)
|
|
78
|
-
|
|
79
|
-
assert_equal(6, @user.total_insertions)
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def test_total_deletions
|
|
83
|
-
create_commits(@user)
|
|
84
|
-
|
|
85
|
-
assert_equal(7, @user.total_deletions)
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def test_total_changes
|
|
89
|
-
create_commits(@user)
|
|
90
|
-
|
|
91
|
-
assert_equal(13, @user.total_changes)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def test_rgba
|
|
95
|
-
assert_match(/rgba\(([\d]{,3}, ){3}1\)/, @user.rgba)
|
|
96
|
-
end
|
|
97
|
-
end
|
data/test/test_helper.rb
DELETED