gitalytics 1.2.1 → 1.2.2
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 +18 -5
- data/lib/gitalytics.rb +4 -2
- data/lib/gitlog.rb +1 -1
- data/lib/user.rb +9 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42ce0238a2282e8e07b38afc990e971c93083d3f
|
4
|
+
data.tar.gz: 4f3eb1308a8ed7c6b32a11987bfaa5eb022b8c40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 071ad7c30c498c430540f53b3478e76b7f069e71768e30f70f6eb86b5353110c5d542b49f37a36486a01e203501b7e16cd44b97496a45a28f5d60807d0764d79
|
7
|
+
data.tar.gz: 791dc2e44997462d29fd24c0ac40165eaff230cb59d5c108bb8f1910b8b40bb2a4a83db52e3b0afd950bd5da128d17d919651af6cabcc09647196095a82f32e4
|
data/assets/gitalytics.html.erb
CHANGED
@@ -87,6 +87,11 @@
|
|
87
87
|
text-align: center;
|
88
88
|
}
|
89
89
|
|
90
|
+
.dashboard-box a {
|
91
|
+
color: #555;
|
92
|
+
text-decoration: none;
|
93
|
+
}
|
94
|
+
|
90
95
|
.dashboard-box .glyphicon {
|
91
96
|
font-size: 48px;
|
92
97
|
}
|
@@ -132,9 +137,11 @@
|
|
132
137
|
<div class="row">
|
133
138
|
<div class="col-md-4">
|
134
139
|
<div class="dashboard-box">
|
135
|
-
<
|
136
|
-
|
137
|
-
|
140
|
+
<a href="#authors" data-open-tab="authors">
|
141
|
+
<span class="glyphicon glyphicon-user"></span><br>
|
142
|
+
<%= @users.count %>
|
143
|
+
authors
|
144
|
+
</a>
|
138
145
|
</div>
|
139
146
|
</div>
|
140
147
|
<div class="col-md-4">
|
@@ -182,7 +189,7 @@
|
|
182
189
|
<p class="lead">Compare the quantity of commits made by each of your repository contributors.<br/> Check who is writing most of the code of your project and maybe give him/her a prize! ;)</p>
|
183
190
|
<% @users.each do |user| %>
|
184
191
|
<a href="#" title="<%= user.name %> <small><%= user.email %></small>" class="user-avatar" data-content="<%= user.summary %>">
|
185
|
-
<img class="dp img-circle" src="<%= "http://www.gravatar.com/avatar/#{user.gravatar}" %>" style="width: 100px; height:100px; border-color:<%= user.rgba %>"></a>
|
192
|
+
<img class="dp img-circle" src="<%= "http://www.gravatar.com/avatar/#{user.gravatar}?d=mm" %>" style="width: 100px; height:100px; border-color:<%= user.rgba %>"></a>
|
186
193
|
<% end %>
|
187
194
|
</div>
|
188
195
|
|
@@ -229,7 +236,7 @@
|
|
229
236
|
|
230
237
|
// Data for Insertions vs. Deletions Bar Chart
|
231
238
|
var data = {
|
232
|
-
labels: [<%= @users.map{|d| "'#{d.
|
239
|
+
labels: [<%= @users.map{|d| "'#{d.escaped_name}'" }.join(',') %>],
|
233
240
|
datasets: [
|
234
241
|
{
|
235
242
|
data: [<%= @users.map{|d| "#{d.total_insertions}" }.join(',') %>],
|
@@ -263,6 +270,12 @@
|
|
263
270
|
};
|
264
271
|
var ctx = document.getElementById("usersRadarChart").getContext("2d");
|
265
272
|
var usersRadarChart = new Chart(ctx).Radar(data);
|
273
|
+
|
274
|
+
// Makes dashboard items link to tabs
|
275
|
+
$('a[data-open-tab]').click(function(e) {
|
276
|
+
e.preventDefault();
|
277
|
+
$('a[href="#' + $(this).attr('data-open-tab') + '"]').click();
|
278
|
+
});
|
266
279
|
</script>
|
267
280
|
</body>
|
268
281
|
</html>
|
data/lib/gitalytics.rb
CHANGED
@@ -7,7 +7,7 @@ require 'commit'
|
|
7
7
|
|
8
8
|
class Gitalytics
|
9
9
|
|
10
|
-
VERSION = '1.2.
|
10
|
+
VERSION = '1.2.2'
|
11
11
|
|
12
12
|
def analyze(options)
|
13
13
|
data = GitLog.parse_git_log
|
@@ -33,7 +33,9 @@ class Gitalytics
|
|
33
33
|
erb = ERB.new(template_file)
|
34
34
|
output_file = "gitalytics_result.html"
|
35
35
|
File.open(output_file, 'w+') do |file|
|
36
|
-
@users = data[:users]
|
36
|
+
@users = data[:users].sort do |x, y|
|
37
|
+
y.commits.length <=> x.commits.length
|
38
|
+
end
|
37
39
|
@commits = data[:commits]
|
38
40
|
file.write(erb.result(binding))
|
39
41
|
end
|
data/lib/gitlog.rb
CHANGED
data/lib/user.rb
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
require 'digest/md5'
|
2
|
+
require 'CGI'
|
2
3
|
|
3
4
|
class User
|
4
5
|
|
5
6
|
attr_accessor :name, :email, :commits, :colors
|
6
7
|
|
7
8
|
def initialize(name, email)
|
8
|
-
self.name
|
9
|
-
self.email
|
9
|
+
self.name = name
|
10
|
+
self.email = email
|
10
11
|
self.commits = []
|
11
|
-
self.colors
|
12
|
+
self.colors = [rand(255), rand(255), rand(255)].join(', ')
|
13
|
+
end
|
14
|
+
|
15
|
+
def escaped_name
|
16
|
+
CGI.escapeHTML(name)
|
12
17
|
end
|
13
18
|
|
14
19
|
def gravatar
|
@@ -49,9 +54,7 @@ class User
|
|
49
54
|
|
50
55
|
def weekday_commits
|
51
56
|
days = Array.new(7) {0}
|
52
|
-
commits.each
|
53
|
-
days[c.date.wday] += 1
|
54
|
-
end
|
57
|
+
commits.each { |c| days[c.date.wday] += 1 }
|
55
58
|
days
|
56
59
|
end
|
57
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitalytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gonzalo Robaina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Get usefull analytics from your git log
|
14
14
|
email: gonzalor@gmail.com
|
@@ -17,12 +17,12 @@ executables:
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- assets/gitalytics.html.erb
|
20
21
|
- bin/gitalytics
|
22
|
+
- lib/commit.rb
|
21
23
|
- lib/gitalytics.rb
|
22
24
|
- lib/gitlog.rb
|
23
25
|
- lib/user.rb
|
24
|
-
- lib/commit.rb
|
25
|
-
- assets/gitalytics.html.erb
|
26
26
|
homepage: http://rubygems.org/gems/gitalytics
|
27
27
|
licenses:
|
28
28
|
- MIT
|
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
45
|
rubyforge_project:
|
46
|
-
rubygems_version: 2.
|
46
|
+
rubygems_version: 2.4.6
|
47
47
|
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: Git Analytics
|