gitalytics 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/gitalytics.html.erb +8 -2
- data/lib/gitalytics.rb +9 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a98f4434c615280c091a34ec1fbc9ff2e7220a73
|
4
|
+
data.tar.gz: 7828f0c7488f17c081490db141351e2aeb3598da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5aac6614367e91de9c5190feb90973903677f4c38e3ab8fa8c8f7d21cf9fa06983ca6ce4aabd83988c6a9f80e92c26edcc5ecc22847801710387db31bce06c7
|
7
|
+
data.tar.gz: d947ed9069ca67efab58e2c8f207f3860392034e66c95352dfa3d5ab000414b26a882e515451e4890fc3ef93131dea4f0260170b910a93cb5ae74c12b7e5880d
|
data/assets/gitalytics.html.erb
CHANGED
@@ -62,9 +62,15 @@
|
|
62
62
|
}
|
63
63
|
|
64
64
|
.media {
|
65
|
+
height: 125px;
|
65
66
|
margin-bottom: 20px;
|
66
67
|
}
|
67
68
|
|
69
|
+
.media-body {
|
70
|
+
color: #444;
|
71
|
+
font-size: 12px;
|
72
|
+
}
|
73
|
+
|
68
74
|
.dp {
|
69
75
|
box-sizing: border-box;
|
70
76
|
border:10px solid #eee;
|
@@ -97,7 +103,7 @@
|
|
97
103
|
<span class="icon-bar"></span>
|
98
104
|
<span class="icon-bar"></span>
|
99
105
|
</button>
|
100
|
-
<a class="navbar-brand" href="
|
106
|
+
<a class="navbar-brand" href="https://rubygems.org/gems/gitalytics">Gitalytics</a>
|
101
107
|
</div>
|
102
108
|
<div class="collapse navbar-collapse">
|
103
109
|
<ul class="nav navbar-nav">
|
@@ -127,7 +133,7 @@
|
|
127
133
|
<img class="media-object dp img-circle" src="<%= "http://www.gravatar.com/avatar/#{user[:gravatar]}" %>" style="width: 100px; height:100px; border-color:<%= "##{user[:color]}" %>">
|
128
134
|
</a>
|
129
135
|
<div class="media-body">
|
130
|
-
<h4 class="media-heading"><%= user[:name] %></h4>
|
136
|
+
<h4 class="media-heading"><%= user[:name] %><br><small><%= user[:email] %></small></h4>
|
131
137
|
<hr style="margin:8px auto">
|
132
138
|
<%= "#{user[:commits].count} commits between #{(user[:last_date] - user[:first_date]).to_i + 1} days." %>
|
133
139
|
<%= "He did something useful on #{user[:working_days]} of those days." %>
|
data/lib/gitalytics.rb
CHANGED
@@ -6,7 +6,7 @@ require 'digest/md5'
|
|
6
6
|
|
7
7
|
class Gitalytics
|
8
8
|
|
9
|
-
VERSION = '1.0.
|
9
|
+
VERSION = '1.0.4'
|
10
10
|
|
11
11
|
attr_accessor :data
|
12
12
|
|
@@ -27,7 +27,7 @@ class Gitalytics
|
|
27
27
|
private
|
28
28
|
def log_to_hash
|
29
29
|
lines = []
|
30
|
-
command = "git log --pretty='%cn|%ce|%cd|%s'"
|
30
|
+
command = "git log --pretty='%cn|%ce|%cd|%s' --reverse"
|
31
31
|
result = `#{command}`
|
32
32
|
|
33
33
|
result.each_line do |line|
|
@@ -51,14 +51,15 @@ class Gitalytics
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def get_user_data(lines)
|
54
|
-
users =
|
55
|
-
|
56
|
-
|
54
|
+
users = {}
|
55
|
+
lines.each{ |r| users[r[:email]] = r[:name] }
|
56
|
+
users.map{ |email, name|
|
57
|
+
commits = lines.select{ |r| r[:email] == email }
|
57
58
|
dates = commits.map{ |c| c[:date] }
|
58
59
|
{
|
59
|
-
name:
|
60
|
-
email:
|
61
|
-
gravatar: Digest::MD5.hexdigest(
|
60
|
+
name: name,
|
61
|
+
email: email,
|
62
|
+
gravatar: Digest::MD5.hexdigest(email),
|
62
63
|
color: "%06x" % (rand * 0xffffff),
|
63
64
|
commits: commits,
|
64
65
|
first_date: dates.min,
|