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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc7cdafe1717b338369b2bacd9eb4eb3452a87b4
4
- data.tar.gz: 12ead924e9ef494af87a3760173aa3091ea66278
3
+ metadata.gz: a98f4434c615280c091a34ec1fbc9ff2e7220a73
4
+ data.tar.gz: 7828f0c7488f17c081490db141351e2aeb3598da
5
5
  SHA512:
6
- metadata.gz: 2103649a5c686604f104992fa93ff23f64d8dfc1228d9829284d8222ddf9711c40998796f495fcac884a9431f1dd1bf286c040f911d595bf81ad89c582bbeb96
7
- data.tar.gz: d67437810bf448c81ef61d65e1973a7a755292998453563f7d4d0f870e70aae221d3306ca4ab17253ade418252f005d19b5b46cf19618b911497fb10f86a3260
6
+ metadata.gz: a5aac6614367e91de9c5190feb90973903677f4c38e3ab8fa8c8f7d21cf9fa06983ca6ce4aabd83988c6a9f80e92c26edcc5ecc22847801710387db31bce06c7
7
+ data.tar.gz: d947ed9069ca67efab58e2c8f207f3860392034e66c95352dfa3d5ab000414b26a882e515451e4890fc3ef93131dea4f0260170b910a93cb5ae74c12b7e5880d
@@ -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="#">Gitalytics</a>
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." %>
@@ -6,7 +6,7 @@ require 'digest/md5'
6
6
 
7
7
  class Gitalytics
8
8
 
9
- VERSION = '1.0.2'
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 = lines.map{ |r| [r[:name], r[:email]] }.uniq
55
- users.map{ |u|
56
- commits = lines.select{ |r| r[:name] == u[0] }
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: u[0],
60
- email: u[1],
61
- gravatar: Digest::MD5.hexdigest(u[1]),
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,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitalytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Robaina