hubstats 0.5.1 → 0.5.2
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 +4 -4
- data/CHANGELOG.markdown +13 -0
- data/app/assets/javascripts/hubstats/users.js +0 -8
- data/app/controllers/hubstats/teams_controller.rb +7 -1
- data/app/models/hubstats/pull_request.rb +1 -0
- data/app/models/hubstats/team.rb +6 -74
- data/app/models/hubstats/user.rb +25 -1
- data/app/views/hubstats/partials/_quick_addition_stats.html.erb +20 -20
- data/app/views/hubstats/partials/_quick_stats.html.erb +46 -40
- data/app/views/hubstats/partials/_team.html.erb +16 -6
- data/app/views/hubstats/partials/_user-condensed.html.erb +2 -2
- data/app/views/hubstats/tables/_teams.html.erb +6 -6
- data/app/views/hubstats/teams/show.html.erb +8 -1
- data/lib/hubstats/version.rb +1 -1
- data/spec/controllers/hubstats/teams_controller_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 537f94c651e1ab391a44870a9cb81a6a1d5dda01
|
4
|
+
data.tar.gz: 95c9ad450b14a38ef5273f8517084223bd2bcec0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5250264e9388e49cb1d8b0a1c11da9df645a4cccb79edea71507c08d615537ad9d82275bc704b1020e01f253a4f8306bc5d84a29eaac3cec0344120906a1fec9
|
7
|
+
data.tar.gz: 1e17e63ba54907c3d692683d10c95b0148d3470b7b48bba7ab464d7a38cd0782744e4e2a8e5d9d5160b09bbfcca2bdec404546507275d09518121276adaac8f5
|
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
#### v0.5.2
|
2
|
+
* Change deployments count to comments count on user condensed page
|
3
|
+
|
4
|
+
> Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/79
|
5
|
+
|
6
|
+
* Adding PRs per developer and Comments per reviewer to team page
|
7
|
+
|
8
|
+
> Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/78
|
9
|
+
|
10
|
+
* Making the team's user column to be developers/reviewers
|
11
|
+
|
12
|
+
> Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/77
|
13
|
+
|
1
14
|
#### v0.5.1
|
2
15
|
* adding hubstats; fixing little error in readme
|
3
16
|
|
@@ -37,14 +37,6 @@ $(document).ready(function() {
|
|
37
37
|
$("#deletions").on("click", function(){
|
38
38
|
toggleOrder(queryParameters,$(this).attr('id'));
|
39
39
|
});
|
40
|
-
|
41
|
-
$("#repocount").on("click", function(){
|
42
|
-
toggleOrder(queryParameters,$(this).attr('id'));
|
43
|
-
});
|
44
|
-
|
45
|
-
$("#usercount").on("click", function(){
|
46
|
-
toggleOrder(queryParameters,$(this).attr('id'));
|
47
|
-
});
|
48
40
|
});
|
49
41
|
|
50
42
|
/* toggleOrder
|
@@ -14,7 +14,7 @@ module Hubstats
|
|
14
14
|
else
|
15
15
|
@teams = Hubstats::Team.where(hubstats: true).with_all_metrics(@start_date, @end_date)
|
16
16
|
.with_id(params[:teams])
|
17
|
-
.
|
17
|
+
.order_by_name
|
18
18
|
.paginate(:page => params[:page], :per_page => 15)
|
19
19
|
end
|
20
20
|
|
@@ -35,6 +35,9 @@ module Hubstats
|
|
35
35
|
@users = @team.users.where("login NOT IN (?)", Hubstats.config.github_config["ignore_users_list"]).order("login ASC")
|
36
36
|
@user_count = @users.length
|
37
37
|
@comment_count = Hubstats::Comment.belonging_to_team(@users.pluck(:id)).created_in_date_range(@start_date, @end_date).count(:all)
|
38
|
+
repos_pr = @pull_requests.pluck(:repo_id)
|
39
|
+
repos_comment = Hubstats::Comment.where("user_id IN (?)", @users).pluck(:repo_id)
|
40
|
+
@repo_count = repos_pr.concat(repos_comment).uniq.count
|
38
41
|
@net_additions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).sum(:additions).to_i -
|
39
42
|
Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).sum(:deletions).to_i
|
40
43
|
@additions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).average(:additions)
|
@@ -53,6 +56,9 @@ module Hubstats
|
|
53
56
|
pull_count: @pull_count,
|
54
57
|
user_count: @user_count,
|
55
58
|
comment_count: @comment_count,
|
59
|
+
repo_count: @repo_count
|
60
|
+
}
|
61
|
+
@stats_additions = {
|
56
62
|
avg_additions: @additions.round.to_i,
|
57
63
|
avg_deletions: @deletions.round.to_i,
|
58
64
|
net_additions: @net_additions
|
@@ -80,6 +80,7 @@ module Hubstats
|
|
80
80
|
def self.update_teams_in_pulls(days)
|
81
81
|
pulls = created_since(days)
|
82
82
|
pulls.each {|pull| pull.assign_team_from_user}
|
83
|
+
puts "Finished updating the teams of past pull requests"
|
83
84
|
end
|
84
85
|
|
85
86
|
# Public - Filters all of the pull requests between start_date and end_date that are the given state
|
data/app/models/hubstats/team.rb
CHANGED
@@ -3,20 +3,6 @@ module Hubstats
|
|
3
3
|
|
4
4
|
scope :with_id, lambda {|team_id| where(id: team_id.split(',')) if team_id}
|
5
5
|
|
6
|
-
# Public - Counts all of the users that are a part of the selected team.
|
7
|
-
#
|
8
|
-
# start_date - the start of the date range
|
9
|
-
# end_date - the end of the date range
|
10
|
-
#
|
11
|
-
# Returns - the count of users
|
12
|
-
scope :users_count, lambda {|start_date, end_date|
|
13
|
-
select("hubstats_teams.id as team_id")
|
14
|
-
.select("COUNT(DISTINCT hubstats_teams_users.user_id) AS user_count")
|
15
|
-
.where("hubstats_users.login NOT IN (?)", Hubstats.config.github_config["ignore_users_list"])
|
16
|
-
.joins(:users)
|
17
|
-
.group("hubstats_teams.id")
|
18
|
-
}
|
19
|
-
|
20
6
|
# Public - Counts all of the comments a selected team's members have written that occurred between the start_date and end_date.
|
21
7
|
#
|
22
8
|
# start_date - the start of the date range
|
@@ -31,19 +17,6 @@ module Hubstats
|
|
31
17
|
.group("hubstats_teams.id")
|
32
18
|
}
|
33
19
|
|
34
|
-
# Public - Counts all of the repos a selected team's members have made PRs or comments on.
|
35
|
-
#
|
36
|
-
# start_date - the start of the date range
|
37
|
-
# end_date - the end of the data range
|
38
|
-
#
|
39
|
-
# Returns - count of repos
|
40
|
-
scope :repos_count, lambda {|start_date, end_date|
|
41
|
-
select("hubstats_teams.id as team_id")
|
42
|
-
.select("IFNULL(COUNT(DISTINCT hubstats_pull_requests.repo_id),0) AS repo_count")
|
43
|
-
.joins(sanitize_sql_array(["LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.team_id = hubstats_teams.id AND (hubstats_pull_requests.merged_at BETWEEN ? AND ?) AND hubstats_pull_requests.merged = '1'", start_date, end_date]))
|
44
|
-
.group("hubstats_teams.id")
|
45
|
-
}
|
46
|
-
|
47
20
|
# Public - Counts all of the merged pull requests for selected team's users that occurred between the start_date and end_date.
|
48
21
|
#
|
49
22
|
# start_date - the start of the date range
|
@@ -57,34 +30,16 @@ module Hubstats
|
|
57
30
|
.group("hubstats_teams.id")
|
58
31
|
}
|
59
32
|
|
60
|
-
# Public -
|
61
|
-
# and the end_date.
|
62
|
-
#
|
63
|
-
# start_date - the start of the date range
|
64
|
-
# end_date - the end of the data range
|
65
|
-
#
|
66
|
-
# Returns - the additions and deletions
|
67
|
-
scope :net_additions_count, lambda {|start_date, end_date|
|
68
|
-
select("hubstats_teams.id as team_id")
|
69
|
-
.select("SUM(IFNULL(hubstats_pull_requests.additions, 0)) AS additions")
|
70
|
-
.select("SUM(IFNULL(hubstats_pull_requests.deletions, 0)) AS deletions")
|
71
|
-
.joins(sanitize_sql_array(["LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.team_id = hubstats_teams.id AND (hubstats_pull_requests.merged_at BETWEEN ? AND ?) AND hubstats_pull_requests.merged = '1'", start_date, end_date]))
|
72
|
-
.group("hubstats_teams.id")
|
73
|
-
}
|
74
|
-
|
75
|
-
# Public - Joins all of the metrics together for selected team: net additions, comments, repos, pull requests, and users.
|
33
|
+
# Public - Joins all of the metrics together for selected team: net additions, comments, repos, and pull requests.
|
76
34
|
#
|
77
35
|
# start_date - the start of the date range
|
78
36
|
# end_date - the end of the data range
|
79
37
|
#
|
80
38
|
# Returns - all of the stats about the team
|
81
39
|
scope :with_all_metrics, lambda {|start_date, end_date|
|
82
|
-
select("hubstats_teams.*,
|
83
|
-
.joins("LEFT JOIN (#{net_additions_count(start_date, end_date).to_sql}) AS net_additions ON net_additions.team_id = hubstats_teams.id")
|
40
|
+
select("hubstats_teams.*, pull_request_count, comment_count")
|
84
41
|
.joins("LEFT JOIN (#{pull_requests_count(start_date, end_date).to_sql}) AS pull_requests ON pull_requests.team_id = hubstats_teams.id")
|
85
42
|
.joins("LEFT JOIN (#{comments_count(start_date, end_date).to_sql}) AS comments ON comments.team_id = hubstats_teams.id")
|
86
|
-
.joins("LEFT JOIN (#{repos_count(start_date, end_date).to_sql}) AS repos ON repos.team_id = hubstats_teams.id")
|
87
|
-
.joins("LEFT JOIN (#{users_count(start_date, end_date).to_sql}) AS users ON users.team_id = hubstats_teams.id")
|
88
43
|
.group("hubstats_teams.id")
|
89
44
|
}
|
90
45
|
|
@@ -126,34 +81,11 @@ module Hubstats
|
|
126
81
|
team.save!
|
127
82
|
end
|
128
83
|
|
129
|
-
# Public -
|
130
|
-
# if none of these are selected, then the default is to order by pull request count in descending order.
|
131
|
-
#
|
132
|
-
# order_params - the param of what the teams should be sorted by
|
84
|
+
# Public - Orders the list of data by name (alphabetical)
|
133
85
|
#
|
134
|
-
# Returns - the
|
135
|
-
def self.
|
136
|
-
|
137
|
-
order = order_params.include?('asc') ? "ASC" : "DESC"
|
138
|
-
case order_params.split('-').first
|
139
|
-
when 'usercount'
|
140
|
-
order("user_count #{order}")
|
141
|
-
when 'pulls'
|
142
|
-
order("pull_request_count #{order}")
|
143
|
-
when 'comments'
|
144
|
-
order("comment_count #{order}")
|
145
|
-
when 'netadditions'
|
146
|
-
order("additions - deletions #{order}")
|
147
|
-
when 'repocount'
|
148
|
-
order("repo_count #{order}")
|
149
|
-
when 'name'
|
150
|
-
order("name #{order}")
|
151
|
-
else
|
152
|
-
order("pull_request_count #{order}")
|
153
|
-
end
|
154
|
-
else
|
155
|
-
order("pull_request_count DESC")
|
156
|
-
end
|
86
|
+
# Returns - the data ordered alphabetically by name
|
87
|
+
def self.order_by_name
|
88
|
+
order("name ASC")
|
157
89
|
end
|
158
90
|
end
|
159
91
|
end
|
data/app/models/hubstats/user.rb
CHANGED
@@ -4,6 +4,8 @@ module Hubstats
|
|
4
4
|
# Various checks that can be used to filter and find info about users.
|
5
5
|
scope :with_id, lambda {|user_id| where(id: user_id.split(',')) if user_id}
|
6
6
|
scope :only_active, having("comment_count > 0 OR pull_request_count > 0 OR deploy_count > 0")
|
7
|
+
scope :is_developer, having("pull_request_count > 0")
|
8
|
+
scope :is_reviewer, having("comment_count > 0")
|
7
9
|
scope :with_contributions, lambda {|start_date, end_date, repo_id| with_all_metrics_repos(start_date, end_date, repo_id) if repo_id}
|
8
10
|
|
9
11
|
# Public - Counts all of the deploys for selected user that occurred between the start_date and end_date.
|
@@ -205,7 +207,7 @@ module Hubstats
|
|
205
207
|
end
|
206
208
|
|
207
209
|
# Public - Designed so that the list of users can be ordered based on deploys, pulls, comments, net additions, or name.
|
208
|
-
#
|
210
|
+
# If none of these are selected, then the default is to order by pull request count in descending order.
|
209
211
|
#
|
210
212
|
# order_params - the param of what the users should be sorted by
|
211
213
|
#
|
@@ -232,6 +234,28 @@ module Hubstats
|
|
232
234
|
end
|
233
235
|
end
|
234
236
|
|
237
|
+
# Public - Counts all of the pull requests for the users and sees if the count of PRs is greater than 0 (if they are a developer).
|
238
|
+
# Then counts all of the developers.
|
239
|
+
#
|
240
|
+
# start_date - the starting date that we want to count the PRs from
|
241
|
+
# end_date - the ending date that we want to count the PRs from
|
242
|
+
#
|
243
|
+
# Returns - the count of total users that have PRs > 0
|
244
|
+
def self.count_active_developers(start_date, end_date)
|
245
|
+
self.pull_requests_count(start_date, end_date).is_developer.to_a.count
|
246
|
+
end
|
247
|
+
|
248
|
+
# Public - Counts all of the comments for the users and sees if the count of comments is greater than 0 (if they are a reviewer).
|
249
|
+
# Then counts all of the reviewers.
|
250
|
+
#
|
251
|
+
# start_date - the starting date that we want to count the comments from
|
252
|
+
# end_date - the ending date that we want to count the comments from
|
253
|
+
#
|
254
|
+
# Returns - the count of total users that have comments > 0
|
255
|
+
def self.count_active_reviewers(start_date, end_date)
|
256
|
+
self.comments_count(start_date, end_date).is_reviewer.to_a.count
|
257
|
+
end
|
258
|
+
|
235
259
|
# Public - Gets the first team where the user is belongs to and where hubstats bool is true.
|
236
260
|
#
|
237
261
|
# Returns - the first team that the user belongs to where hubstats bool is true, if nothing
|
@@ -2,32 +2,32 @@
|
|
2
2
|
<div class="col-lg-<%= (12-(@stats_additions.length)*2)/2 %>"></div>
|
3
3
|
|
4
4
|
<% if @stats_additions.has_key? :net_additions %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
6
|
+
<h1> <%= @stats_additions[:net_additions] %> </h1>
|
7
|
+
<h4> Net Additions </h4>
|
8
|
+
</div>
|
9
9
|
<% end %>
|
10
10
|
<% if @stats_additions.has_key? :avg_additions %>
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
12
|
+
<h1> <%= @stats_additions[:avg_additions] %> </h1>
|
13
|
+
<h4> Average Additions per Pull Request </h4>
|
14
|
+
</div>
|
15
15
|
<% end %>
|
16
16
|
<% if @stats_additions.has_key? :avg_deletions%>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
18
|
+
<h1><%= @stats_additions[:avg_deletions] %> </h1>
|
19
|
+
<h4> Average Deletions per Pull Request </h4>
|
20
|
+
</div>
|
21
21
|
<% end %>
|
22
22
|
<% if @stats_additions.has_key? :additions %>
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
24
|
+
<h1> <%= @stats_additions[:additions] %> </h1>
|
25
|
+
<h4> Additions </h4>
|
26
|
+
</div>
|
27
27
|
<% end %>
|
28
28
|
<% if @stats_additions.has_key? :deletions%>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
30
|
+
<h1><%= @stats_additions[:deletions] %> </h1>
|
31
|
+
<h4> Deletions </h4>
|
32
|
+
</div>
|
33
33
|
<% end %>
|
@@ -2,62 +2,68 @@
|
|
2
2
|
<div class="col-lg-<%= (12-(@stats_basics.length)*2)/2 %>"></div>
|
3
3
|
|
4
4
|
<% if @stats_basics.has_key? :user_count %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
6
|
+
<h1> <%= @stats_basics[:user_count] %> </h1>
|
7
|
+
<h4> Active Users </h4>
|
8
|
+
</div>
|
9
9
|
<% end %>
|
10
10
|
<% if @stats_basics.has_key? :deploy_count %>
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
12
|
+
<h1> <%= @stats_basics[:deploy_count] %> </h1>
|
13
|
+
<h4> Deployments </h4>
|
14
|
+
</div>
|
15
15
|
<% end %>
|
16
16
|
<% if @stats_basics.has_key? :pull_count %>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
18
|
+
<h1> <%= @stats_basics[:pull_count] %> </h1>
|
19
|
+
<h4> Merged Pull Requests </h4>
|
20
|
+
</div>
|
21
21
|
<% end %>
|
22
22
|
<% if @stats_basics.has_key? :comment_count %>
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
24
|
+
<h1><%= @stats_basics[:comment_count] %> </h1>
|
25
|
+
<h4> Comments </h4>
|
26
|
+
</div>
|
27
27
|
<% end %>
|
28
28
|
<% if @stats_basics.has_key? :review_count %>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
30
|
+
<h1> <%= @stats_basics[:review_count] %> </h1>
|
31
|
+
<h4> Code Reviews </h4>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
<% if @stats_basics.has_key? :repo_count %>
|
35
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
36
|
+
<h1> <%= @stats_basics[:repo_count] %> </h1>
|
37
|
+
<h4> Repositories with Pull Requests or Comments </h4>
|
38
|
+
</div>
|
33
39
|
<% end %>
|
34
40
|
<% if @stats_basics.has_key? :net_additions %>
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
41
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
42
|
+
<h1> <%= @stats_basics[:net_additions] %> </h1>
|
43
|
+
<h4> Net Additions </h4>
|
44
|
+
</div>
|
39
45
|
<% end %>
|
40
46
|
<% if @stats_basics.has_key? :avg_additions %>
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
47
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
48
|
+
<h1> <%= @stats_basics[:avg_additions] %> </h1>
|
49
|
+
<h4> Average Additions per Pull Request </h4>
|
50
|
+
</div>
|
45
51
|
<% end %>
|
46
52
|
<% if @stats_basics.has_key? :avg_deletions%>
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
53
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
54
|
+
<h1><%= @stats_basics[:avg_deletions] %> </h1>
|
55
|
+
<h4> Average Deletions per Pull Request </h4>
|
56
|
+
</div>
|
51
57
|
<% end %>
|
52
58
|
<% if @stats_basics.has_key? :additions %>
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
59
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
60
|
+
<h1> <%= @stats_basics[:additions] %> </h1>
|
61
|
+
<h4> Additions </h4>
|
62
|
+
</div>
|
57
63
|
<% end %>
|
58
64
|
<% if @stats_basics.has_key? :deletions%>
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
65
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
66
|
+
<h1><%= @stats_basics[:deletions] %> </h1>
|
67
|
+
<h4> Deletions </h4>
|
68
|
+
</div>
|
63
69
|
<% end %>
|
@@ -11,7 +11,8 @@
|
|
11
11
|
<!-- Show all of the stats for the individual team -->
|
12
12
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
13
13
|
<div class="text-center">
|
14
|
-
<span class="text-large"><%= team.
|
14
|
+
<span class="text-large"><%= team.users.count_active_developers(@start_date, @end_date) %> /
|
15
|
+
<%= team.users.count_active_reviewers(@start_date, @end_date) %></span>
|
15
16
|
</div>
|
16
17
|
</div>
|
17
18
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
@@ -22,19 +23,28 @@
|
|
22
23
|
</div>
|
23
24
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
24
25
|
<div class="text-center">
|
25
|
-
<span class="text-large"
|
26
|
-
|
26
|
+
<span class="text-large"><% if team.users.count_active_developers(@start_date, @end_date) != 0 %>
|
27
|
+
<%= (team.pull_request_count.to_f / team.users.count_active_developers(@start_date, @end_date).to_f).round(2) %>
|
28
|
+
<% else %>
|
29
|
+
<%= 0 %>
|
30
|
+
<% end %></span>
|
31
|
+
<span class="mega-octicon octicon-git-pull-request"></span>
|
27
32
|
</div>
|
28
33
|
</div>
|
29
34
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
30
35
|
<div class="text-center">
|
31
|
-
<span class="text-large"><%= team.
|
32
|
-
<span class="mega-octicon octicon-
|
36
|
+
<span class="text-large"><%= team.comment_count %></span>
|
37
|
+
<span class="mega-octicon octicon-comment"></span>
|
33
38
|
</div>
|
34
39
|
</div>
|
35
40
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
36
41
|
<div class="text-center">
|
37
|
-
<span class="text-large"
|
42
|
+
<span class="text-large"><% if team.users.count_active_reviewers(@start_date, @end_date) != 0 %>
|
43
|
+
<%= (team.comment_count.to_f / team.users.count_active_reviewers(@start_date, @end_date).to_f).round(2) %>
|
44
|
+
<% else %>
|
45
|
+
<%= 0 %>
|
46
|
+
<% end %></span>
|
47
|
+
<span class="mega-octicon octicon-comment"></span>
|
38
48
|
</div>
|
39
49
|
</div>
|
40
50
|
</div>
|
@@ -20,8 +20,8 @@
|
|
20
20
|
</div>
|
21
21
|
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
22
22
|
<div class="pull-right">
|
23
|
-
<span class="text-large"><%= Hubstats::
|
24
|
-
<span class="mega-octicon octicon-
|
23
|
+
<span class="text-large"><%= Hubstats::Comment.belonging_to_user(user.id).created_in_date_range(@start_date, @end_date).count(:all) %></span>
|
24
|
+
<span class="mega-octicon octicon-comment"></span>
|
25
25
|
</div>
|
26
26
|
</div>
|
27
27
|
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
@@ -3,22 +3,22 @@
|
|
3
3
|
<div class="teams">
|
4
4
|
<div class="row single-user header">
|
5
5
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
6
|
-
<a class="header desc"
|
6
|
+
<a class="header desc"> Team Name <span class="octicon"></span> </a>
|
7
7
|
</div>
|
8
8
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
9
|
-
<a class="header desc"
|
9
|
+
<a class="header desc"> Developers / Reviewers <span class="octicon"></span> </a>
|
10
10
|
</div>
|
11
11
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
12
|
-
<a class="header desc"
|
12
|
+
<a class="header desc"> Merged Pull Requests <span class="octicon"></span> </a>
|
13
13
|
</div>
|
14
14
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
15
|
-
<a class="header desc"
|
15
|
+
<a class="header desc"> Pull Requests per Developer <span class="octicon"></span></a>
|
16
16
|
</div>
|
17
17
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
18
|
-
<a class="header desc"
|
18
|
+
<a class="header desc"> Comments <span class="octicon"></span></a>
|
19
19
|
</div>
|
20
20
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
21
|
-
<a class="header desc"
|
21
|
+
<a class="header desc"> Comments per Reviewer <span class="octicon"></span></a>
|
22
22
|
</div>
|
23
23
|
</div>
|
24
24
|
<%= render partial: 'hubstats/partials/team', collection: @teams, as: :team %>
|
@@ -5,7 +5,14 @@
|
|
5
5
|
<h1 class="title text-center"><%= @team.name %></a> </h1>
|
6
6
|
|
7
7
|
<!-- Show all of the stats about the team -->
|
8
|
-
|
8
|
+
<%= render 'hubstats/partials/quick_stats' %>
|
9
|
+
<br>
|
10
|
+
<br>
|
11
|
+
<br>
|
12
|
+
<br>
|
13
|
+
<br>
|
14
|
+
<br>
|
15
|
+
<%= render 'hubstats/partials/quick_addition_stats' %>
|
9
16
|
</div>
|
10
17
|
|
11
18
|
<div class="row">
|
data/lib/hubstats/version.rb
CHANGED
@@ -10,7 +10,7 @@ module Hubstats
|
|
10
10
|
team2 = create(:team, :name => "Team Two", :hubstats => false)
|
11
11
|
team3 = create(:team, :name => "Team Three", :hubstats => true)
|
12
12
|
team4 = create(:team, :name => "Team Four", :hubstats => true)
|
13
|
-
expect(Hubstats::Team).to receive_message_chain("with_id.
|
13
|
+
expect(Hubstats::Team).to receive_message_chain("with_id.order_by_name.paginate").and_return([team4, team1, team3, team2])
|
14
14
|
allow(Hubstats).to receive_message_chain(:config, :github_config, :[]).with("ignore_users_list") { ["user"] }
|
15
15
|
get :index
|
16
16
|
expect(response).to have_http_status(200)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Hursh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|