gitalytics 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3f105e2f5f0c549981b100e5ebfa66d22c86fef
4
- data.tar.gz: 432428efcdfea8e4dc3c3eec59ece71a39092692
3
+ metadata.gz: e94b6bc74a8f579b8bb625c6e74d52df9db42743
4
+ data.tar.gz: c4c3afbc6db0329ce03fa4d59f299da22b083315
5
5
  SHA512:
6
- metadata.gz: 90fcb57c95019c47583cb0f6c9cc909d12addb5db13e430e118dc8f5ea2028adde466c9ac16ba7b862344ca93eb003a97d6ce5869edc33810a68d9269572f935
7
- data.tar.gz: ffb1ecd259992afa952df44a83d5c01f2492e3c855084d85a27068cd0366390f63ab622383f701ee0b08e7de9a06aa92412e55af3af7ab5cc21ae9bbb549af84
6
+ metadata.gz: 1815e7bb9f1422da99109c5e68208cfe6fd50c4084951b13d8d50283633029347c37d529142e44f1a4e620f7d2646cabee6b57c406ffdb24f16183b3ee5a9af8
7
+ data.tar.gz: 3c00ad0ff6a0d33fcbdc91f7119466fb3c77183b32cdf9523f1ca7bfc582e296064aedb32debaf21815ba2b89011c675ab3c5f992954a1a09c7dfa6028d1452a
data/.gitignore CHANGED
@@ -12,3 +12,5 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ gitalytics_result.html
16
+ .byebug_history
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
4
  - 2.1.5
6
5
  - 2.2.3
@@ -1,5 +1,11 @@
1
1
  ## Gitalytics Changelog
2
2
 
3
+ #### v.1.3.1
4
+ * Add Benchmark option.
5
+ * Fix lots of Rubocop's warnings.
6
+ * Use haml and partials for html report template.
7
+ * Improved code-smell.
8
+
3
9
  #### v.1.3.0
4
10
  * Changed CLI output text.
5
11
  * Re-structure of gem's source code.
@@ -9,6 +15,11 @@
9
15
  * Updated Bootstrap version.
10
16
  * Updated HTML report design.
11
17
 
18
+ #### v.1.2.2
19
+ * Sort users by commit count
20
+ * Fixed bug when author's name has special characters
21
+ * Minor code style fixes
22
+
12
23
  #### v.1.2.1
13
24
  * Fixed bug that prevented gitalytics to initialize correctly. (Thanks @willyschwindt)
14
25
 
data/Gemfile CHANGED
@@ -6,4 +6,5 @@ gem 'coveralls', require: false
6
6
 
7
7
  group :test do
8
8
  gem 'rake'
9
+ gem 'minitest'
9
10
  end
data/README.md CHANGED
@@ -3,13 +3,21 @@
3
3
  Get commits statistics for your git repository
4
4
  Based on gist by Tobin Harris: https://gist.github.com/tobinharris/396634
5
5
 
6
- [![Code Climate](https://codeclimate.com/github/pepito2k/gitalytics.png)](https://codeclimate.com/github/pepito2k/gitalytics)
7
6
  [![Gem Version](https://badge.fury.io/rb/gitalytics.png)](http://badge.fury.io/rb/gitalytics)
8
7
  [![Dependency Status](https://gemnasium.com/pepito2k/gitalytics.png)](https://gemnasium.com/pepito2k/gitalytics)
9
8
  [![Build Status](https://travis-ci.org/pepito2k/gitalytics.png)](https://travis-ci.org/pepito2k/gitalytics)
9
+
10
10
  [![Coverage Status](https://coveralls.io/repos/pepito2k/gitalytics/badge.png?branch=master)](https://coveralls.io/r/pepito2k/gitalytics?branch=master)
11
+ [![Code Climate](https://codeclimate.com/github/pepito2k/gitalytics.png)](https://codeclimate.com/github/pepito2k/gitalytics)
12
+ [![codebeat badge](https://codebeat.co/badges/166f8f5d-5596-44ef-a762-4b89fc5b531f)](https://codebeat.co/projects/github-com-pepito2k-gitalytics)
13
+
14
+ [![GitHub forks](https://img.shields.io/github/forks/pepito2k/gitalytics.svg)](https://github.com/pepito2k/gitalytics/network)
15
+ [![GitHub stars](https://img.shields.io/github/stars/pepito2k/gitalytics.svg)](https://github.com/pepito2k/gitalytics/stargazers)
16
+ [![GitHub issues](https://img.shields.io/github/issues/pepito2k/gitalytics.svg)](https://github.com/pepito2k/gitalytics/issues)
17
+
18
+ ![Total Downloads](http://ruby-gem-downloads-badge.herokuapp.com/gitalytics?type=total)
11
19
 
12
- ![Gitalytics Screenshot](http://photos.gonzalo.robaina.me/gitalytics_screen.png "Gitalytics Screenshot")
20
+ ![Gitalytics Screenshot](http://photos.gonzalo.robaina.me.s3.amazonaws.com/gitalytics_screen.png "Gitalytics Screenshot")
13
21
 
14
22
  ## Installation
15
23
 
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require "bundler/gem_tasks"
1
2
  require 'rake/testtask'
2
3
 
3
4
  Rake::TestTask.new do |t|
@@ -0,0 +1,50 @@
1
+ / Start Authors
2
+ #authors.tab-pane
3
+ .page-header
4
+ %h1 Authors
5
+ %p.lead
6
+ Compare the quantity of commits made by each of your repository contributors.
7
+ %br/
8
+ Check who is writing most of the code of your project and maybe give him/her a prize! ;)
9
+ .row
10
+ %p
11
+ So far, #{users.size} contributors commited something to your project.
12
+ - users.each do |user|
13
+ .col-md-4
14
+ / Twitter Profile start
15
+ .twPc-div
16
+ %a.twPc-bg.twPc-block{style: "background-color: #{user.rgba}"}
17
+ %div
18
+ %a.twPc-avatarLink{href: "#", title: "#{user.name}"}
19
+ %img.twPc-avatarImg{alt: "#{user.name}", src: "http://www.gravatar.com/avatar/#{user.gravatar}?d=mm"}/
20
+ .twPc-divUser
21
+ .twPc-divName
22
+ %a{href: "#"}= user.name
23
+ %span
24
+ %a{href: "mailto:#{user.email}"}
25
+ %span= user.email
26
+ .twPc-divStats
27
+ %ul.twPc-Arrange
28
+ %li.twPc-ArrangeSizeFit
29
+ %span.twPc-StatLabel.twPc-block Commits
30
+ %span.twPc-StatValue.commits= user.commits.size
31
+ %li.twPc-ArrangeSizeFit
32
+ %span.twPc-StatLabel.twPc-block Inserts
33
+ %span.twPc-StatValue.insertions= user.total_insertions
34
+ %li.twPc-ArrangeSizeFit
35
+ %span.twPc-StatLabel.twPc-block Deletes
36
+ %span.twPc-StatValue.deletions= user.total_deletions
37
+ / Twitter Profile end
38
+ .row
39
+ %h2 Commits count per user
40
+ .col-md-6
41
+ %canvas#usersPieChart{height: "400", width: "550"}
42
+ .col-md-6
43
+ %ul
44
+ - users.each do |u|
45
+ %li
46
+ %canvas.usersColorLegend{height: "15", style: "background-color: #{u.rgba}", width: "30"}
47
+ = u.name
48
+ %ul
49
+
50
+ / End Authors
@@ -0,0 +1,21 @@
1
+ / Start Commits
2
+ #commits.tab-pane
3
+ .page-header
4
+ %h1 Commits
5
+ %p.lead A few basic stats on single commits.
6
+ - shortest_commit = commits.min_by { |c| c.subject.length }
7
+ - longest_commit = commits.max_by { |c| c.subject.length }
8
+ %h2 Shortest commit message
9
+ %blockquote
10
+ %p= shortest_commit.subject
11
+ %footer
12
+ = shortest_commit.author.name
13
+ %cite= shortest_commit.date.strftime('%a %-d, %B %Y')
14
+ %hr/
15
+ %h2 Longest commit message
16
+ %blockquote
17
+ %p= longest_commit.subject
18
+ %footer
19
+ = longest_commit.author.name
20
+ %cite= longest_commit.date.strftime('%a %-d, %B %Y')
21
+ / End Commits
@@ -0,0 +1,190 @@
1
+ :css
2
+ /* Sticky footer styles
3
+ -------------------------------------------------- */
4
+
5
+ html,
6
+ body {
7
+ height: 100%;
8
+ /* The html and body elements cannot have any padding or margin. */
9
+ }
10
+
11
+ /* Wrapper for page content to push down footer */
12
+ #wrap {
13
+ min-height: 100%;
14
+ height: auto;
15
+ /* Negative indent footer by its height */
16
+ margin: 0 auto -60px;
17
+ /* Pad bottom by footer height */
18
+ padding: 0 0 60px;
19
+ }
20
+
21
+ /* Set the fixed height of the footer here */
22
+ #footer {
23
+ background-color: #f5f5f5;
24
+ height: 60px;
25
+ margin-top: 60px;
26
+ }
27
+
28
+ /* Twitter Profile styles
29
+ -------------------------------------------------- */
30
+ .twPc-div {
31
+ background: #fff none repeat scroll 0 0;
32
+ border: 1px solid #e1e8ed;
33
+ border-radius: 6px;
34
+ height: 150px;
35
+ max-width: 340px;
36
+ margin-bottom: 40px;
37
+ }
38
+ .twPc-bg {
39
+ border-bottom: 1px solid #e1e8ed;
40
+ border-radius: 4px 4px 0 0;
41
+ height: 40px;
42
+ width: 100%;
43
+ }
44
+ .twPc-block {
45
+ display: block !important;
46
+ }
47
+ .twPc-button {
48
+ margin: -35px -10px 0;
49
+ text-align: right;
50
+ width: 100%;
51
+ }
52
+ .twPc-avatarLink {
53
+ background-color: #fff;
54
+ border-radius: 6px;
55
+ display: inline-block !important;
56
+ float: left;
57
+ margin: -30px 5px 0 8px;
58
+ max-width: 100%;
59
+ padding: 1px;
60
+ vertical-align: bottom;
61
+ }
62
+ .twPc-avatarImg {
63
+ border: 2px solid #fff;
64
+ border-radius: 7px;
65
+ box-sizing: border-box;
66
+ color: #fff;
67
+ height: 72px;
68
+ width: 72px;
69
+ }
70
+ .twPc-divUser {
71
+ margin: 5px 0 0;
72
+ }
73
+ .twPc-divName {
74
+ font-size: 18px;
75
+ font-weight: 700;
76
+ line-height: 21px;
77
+ white-space: nowrap;
78
+ overflow: hidden;
79
+ text-overflow: ellipsis
80
+ }
81
+ .twPc-divName a {
82
+ color: inherit !important;
83
+ }
84
+ .twPc-divStats {
85
+ margin-left: 11px;
86
+ padding: 10px 0;
87
+ }
88
+ .twPc-Arrange {
89
+ box-sizing: border-box;
90
+ display: table;
91
+ margin: 0;
92
+ min-width: 100%;
93
+ padding: 0;
94
+ table-layout: auto;
95
+ }
96
+ ul.twPc-Arrange {
97
+ list-style: outside none none;
98
+ margin: 0;
99
+ padding: 0;
100
+ }
101
+ .twPc-ArrangeSizeFit {
102
+ display: table-cell;
103
+ padding: 0;
104
+ vertical-align: top;
105
+ }
106
+ .twPc-ArrangeSizeFit a:hover {
107
+ text-decoration: none;
108
+ }
109
+ .twPc-StatValue {
110
+ display: block;
111
+ font-size: 18px;
112
+ font-weight: 500;
113
+ transition: color 0.15s ease-in-out 0s;
114
+ }
115
+ .twPc-StatValue.commits {
116
+ color: #a650c0;
117
+ }
118
+ .twPc-StatValue.insertions {
119
+ color: #539734;
120
+ }
121
+ .twPc-StatValue.deletions {
122
+ color: #c03c24;
123
+ }
124
+ .twPc-StatLabel {
125
+ color: #8899a6;
126
+ font-size: 10px;
127
+ letter-spacing: 0.02em;
128
+ overflow: hidden;
129
+ text-transform: uppercase;
130
+ transition: color 0.15s ease-in-out 0s;
131
+ }
132
+
133
+ /* Custom page CSS
134
+ -------------------------------------------------- */
135
+ /* Not required for template or sticky footer method. */
136
+
137
+ #wrap > .container {
138
+ padding: 60px 15px 0;
139
+ }
140
+ .container .text-muted {
141
+ margin: 20px 0;
142
+ }
143
+
144
+ #footer > .container {
145
+ padding-left: 15px;
146
+ padding-right: 15px;
147
+ }
148
+
149
+ .user-avatar {
150
+ margin: 0 10px 10px 0;
151
+ }
152
+
153
+ .dp {
154
+ box-sizing: border-box;
155
+ border:10px solid #eee;
156
+ transition: all 0.2s ease-in-out;
157
+ }
158
+
159
+ .dp:hover {
160
+ border:2px solid #eee;
161
+ transform:rotate(360deg);
162
+ -ms-transform:rotate(360deg);
163
+ -webkit-transform:rotate(360deg);
164
+ /*-webkit-font-smoothing:antialiased;*/
165
+ }
166
+
167
+ .dashboard-box {
168
+ background-color: #f3f3f3;
169
+ border-radius: 10px;
170
+ margin-bottom: 30px;
171
+ padding: 20px;
172
+ text-align: center;
173
+ }
174
+
175
+ .dashboard-box a {
176
+ color: #555;
177
+ text-decoration: none;
178
+ }
179
+
180
+ .dashboard-box .glyphicon {
181
+ font-size: 48px;
182
+ }
183
+
184
+ #authors li {
185
+ list-style: none;
186
+ }
187
+
188
+ .usersColorLegend {
189
+ vertical-align: middle;
190
+ }
@@ -0,0 +1,45 @@
1
+ / Start Dashboard
2
+ #dashboard.tab-pane.active
3
+ .page-header
4
+ %h1 Dashboard
5
+ %p.lead A quick overview of the activity on your git repository.
6
+ .row
7
+ .col-md-4
8
+ .dashboard-box
9
+ %a{"data-open-tab" => "authors", href: "#authors"}
10
+ %span.glyphicon.glyphicon-user
11
+ %br/
12
+ = users.count
13
+ authors
14
+ .col-md-4
15
+ .dashboard-box
16
+ %span.glyphicon.glyphicon-list
17
+ %br/
18
+ = commits.count
19
+ commits
20
+ .col-md-4
21
+ .dashboard-box
22
+ %span.glyphicon.glyphicon-file
23
+ %br/
24
+ = commits.map{ |c| c.files_committed }.flatten.uniq.compact.count
25
+ files committed
26
+ .row
27
+ .col-md-4
28
+ .dashboard-box
29
+ %span.glyphicon.glyphicon-plus
30
+ %br/
31
+ = commits.inject(0) { |total, commit| total + commit.insertions }
32
+ insertions
33
+ .col-md-4
34
+ .dashboard-box
35
+ %span.glyphicon.glyphicon-minus
36
+ %br/
37
+ = commits.inject(0) { |total, commit| total + commit.deletions }
38
+ deletions
39
+ .col-md-4
40
+ .dashboard-box
41
+ %span.glyphicon.glyphicon-calendar
42
+ %br/
43
+ = (commits.max_by(&:date).date - commits.min_by(&:date).date).to_i + 1
44
+ days
45
+ / End Dashboard
@@ -0,0 +1,24 @@
1
+ / Start Dates
2
+ #dates.tab-pane
3
+ .page-header
4
+ %h1 Dates
5
+ %p.lead When are those commits happening?
6
+ - first_commit = commits.min_by(&:date)
7
+ - last_commit = commits.max_by(&:date)
8
+ %h2 First Commit Ever
9
+ %blockquote
10
+ %p= first_commit.subject
11
+ %footer
12
+ = first_commit.author.name
13
+ %cite= first_commit.date.strftime('%a %-d, %B %Y')
14
+ %hr/
15
+ %h2 Last Commit
16
+ %blockquote
17
+ %p= last_commit.subject
18
+ %footer
19
+ = last_commit.author.name
20
+ %cite= last_commit.date.strftime('%a %-d, %B %Y')
21
+ %hr/
22
+ %h2 Most Busy Days
23
+ %canvas#daysBarChart{height: "400", width: "1100"}
24
+ / End Dates
@@ -0,0 +1,44 @@
1
+ :javascript
2
+ $('.user-avatar').popover({ trigger: 'hover', html: true }).click(function(e){
3
+ e.preventDefault();
4
+ });
5
+
6
+ // Data for Users Pie Chart
7
+ var data = {
8
+ datasets: [{
9
+ data: [#{users.map{|u| "#{u.commits.count}" }.join(', ')}],
10
+ backgroundColor: [#{users.map{|u| "'#{u.rgba}'" }.join(', ')}]
11
+ }],
12
+ labels: [#{users.map{|u| "'#{u.name}'" }.join(', ')}
13
+ ]
14
+ };
15
+ var ctx = document.getElementById("usersPieChart").getContext("2d");
16
+ var usersPieChart = new Chart(ctx,{
17
+ type: 'pie',
18
+ data: data,
19
+ options: {
20
+ legend: { display: false }
21
+ }
22
+ });
23
+
24
+ // Data for Weekday commits per user
25
+ var data = {
26
+ labels: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
27
+ datasets: [
28
+ { data : [#{weekday_commits.join(', ')}] }
29
+ ]
30
+ };
31
+ var ctx = document.getElementById("daysBarChart").getContext("2d");
32
+ var myBarChart = new Chart(ctx, {
33
+ type: 'bar',
34
+ data: data,
35
+ options: {
36
+ legend: { display: false }
37
+ }
38
+ });
39
+
40
+ // Makes dashboard items link to tabs
41
+ $('a[data-open-tab]').click(function(e) {
42
+ e.preventDefault();
43
+ $('.navbar-nav').find('a[href="#' + $(this).attr('data-open-tab') + '"]').click();
44
+ });