hubstats 0.3.11 → 0.3.12
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 +8 -8
- data/.codeclimate.yml +7 -0
- data/CHANGELOG.markdown +13 -0
- data/app/assets/javascripts/hubstats/users.js +4 -0
- data/app/controllers/hubstats/deploys_controller.rb +3 -3
- data/app/controllers/hubstats/pull_requests_controller.rb +2 -6
- data/app/controllers/hubstats/repos_controller.rb +4 -4
- data/app/models/hubstats/label.rb +9 -8
- data/app/models/hubstats/pull_request.rb +10 -0
- data/app/models/hubstats/repo.rb +2 -0
- data/app/models/hubstats/user.rb +2 -0
- data/app/views/hubstats/deploys/show.html.erb +3 -0
- data/app/views/hubstats/repos/dashboard.html.erb +4 -0
- data/app/views/hubstats/tables/_repos.html.erb +1 -0
- data/app/views/hubstats/tables/_users.html.erb +1 -0
- data/lib/hubstats/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTIyNWM2ZWIwNWFmNjg5YWRmOWQ4ZjgyOGY4M2Q1ZmQ0ZjAzNjRhYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmJlZTIwMTgzYTk0NGJlMTg5YzBjZmFhMTFmOGUyNTI2MmEyOWY0YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjY4NTdlMGJmNmRlMDM3MmJhN2E4NzQ4MTY0YjUwZWFmYTgwNGYzNDE5OGZj
|
10
|
+
ODE2NzE5ZDc3MWYyY2IyMjQyOTZmMmI1YmM5YzZiOTM4Nzg3NTE3N2JhZjIz
|
11
|
+
YzY5OWFlZmMzNDk2ZjZkOWNmYTg1ZWZjZWE1NWY1ZWYzZGI2OGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmVjYTBiMmJmZDIxMWVkZTNjNDJiYTdlMjdiOGY5NjMyOWEwYTQ5ZWI5NDdj
|
14
|
+
YzFiNGE5OTg5OWM1N2EyYTQwYTYyYzMwOTE3M2I2OGZkMDc3ZWViYzRlYTcx
|
15
|
+
YTc5MThlOWIwMGEyMDYyOGRlOThhNTkyMzhiZTk1YzcwZTBkOTM=
|
data/.codeclimate.yml
ADDED
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
#### v0.3.12
|
2
|
+
* Solving the server bug
|
3
|
+
|
4
|
+
> Emma Sax: Andy Fleener, Nick LaMuro: https://github.com/sportngin/hubstats/pull/63
|
5
|
+
|
6
|
+
* Adding 2 lines to code climate yml
|
7
|
+
|
8
|
+
> Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/61
|
9
|
+
|
10
|
+
* Add a codeclimate yml file to ignore bootstrap.js
|
11
|
+
|
12
|
+
> Emma Sax: : https://github.com/sportngin/hubstats/pull/60
|
13
|
+
|
1
14
|
#### v0.3.11
|
2
15
|
* Trying to fix potential bug that makes commissioner run out of memory
|
3
16
|
|
@@ -5,6 +5,10 @@ $(document).ready(function() {
|
|
5
5
|
queryParameters = getUrlVars();
|
6
6
|
setUserDefaults(queryParameters);
|
7
7
|
|
8
|
+
$("#name").on("click", function(){
|
9
|
+
toggleOrder(queryParameters,$(this).attr('id'));
|
10
|
+
});
|
11
|
+
|
8
12
|
$("#deploys").on("click", function(){
|
9
13
|
toggleOrder(queryParameters,$(this).attr('id'));
|
10
14
|
});
|
@@ -18,10 +18,10 @@ module Hubstats
|
|
18
18
|
def show
|
19
19
|
@deploy = Hubstats::Deploy.includes(:repo, :pull_requests).find(params[:id])
|
20
20
|
repo = @deploy.repo
|
21
|
-
@pull_requests = @deploy.pull_requests
|
22
|
-
pull_request_count = @pull_requests.length
|
21
|
+
@pull_requests = @deploy.pull_requests.limit(20)
|
22
|
+
@pull_request_count = @pull_requests.length
|
23
23
|
@stats_basics = {
|
24
|
-
pull_count: pull_request_count,
|
24
|
+
pull_count: @pull_request_count,
|
25
25
|
net_additions: @deploy.find_net_additions,
|
26
26
|
comment_count: @deploy.find_comment_count,
|
27
27
|
additions: @deploy.total_changes(:additions),
|
@@ -6,12 +6,8 @@ module Hubstats
|
|
6
6
|
def index
|
7
7
|
URI.decode(params[:label]) if params[:label]
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
.belonging_to_repos(params[:repos])
|
12
|
-
.map(&:id)
|
13
|
-
|
14
|
-
@labels = Hubstats::Label.with_a_pull_request(pull_ids).order("pull_request_count DESC")
|
9
|
+
pull_requests = PullRequest.all_filtered(params, @timespan)
|
10
|
+
@labels = Hubstats::Label.count_by_pull_requests(pull_requests).order("pull_request_count DESC")
|
15
11
|
|
16
12
|
@pull_requests = Hubstats::PullRequest.includes(:user, :repo)
|
17
13
|
.belonging_to_users(params[:users]).belonging_to_repos(params[:repos])
|
@@ -25,10 +25,10 @@ module Hubstats
|
|
25
25
|
@deploy_count = Hubstats::Deploy.belonging_to_repo(@repo.id).deployed_since(@timespan).count(:all)
|
26
26
|
@comment_count = Hubstats::Comment.belonging_to_repo(@repo.id).created_since(@timespan).count(:all)
|
27
27
|
@user_count = Hubstats::User.with_pulls_or_comments(@timespan,@repo.id).only_active.length
|
28
|
-
@net_additions = Hubstats::PullRequest.belonging_to_repo(@repo.id).
|
29
|
-
Hubstats::PullRequest.belonging_to_repo(@repo.id).
|
30
|
-
@additions = Hubstats::PullRequest.belonging_to_repo(@repo.id).
|
31
|
-
@deletions = Hubstats::PullRequest.belonging_to_repo(@repo.id).
|
28
|
+
@net_additions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).sum(:additions).to_i -
|
29
|
+
Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).sum(:deletions).to_i
|
30
|
+
@additions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).average(:additions)
|
31
|
+
@deletions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).average(:deletions)
|
32
32
|
|
33
33
|
stats
|
34
34
|
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module Hubstats
|
2
2
|
class Label < ActiveRecord::Base
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
|
4
|
+
def self.count_by_pull_requests(pull_requests)
|
5
|
+
select("hubstats_labels.*")
|
6
|
+
.select("COUNT(hubstats_labels_pull_requests.pull_request_id) AS pull_request_count")
|
7
|
+
.joins(:pull_requests).merge(pull_requests)
|
8
|
+
.having("pull_request_count > 0")
|
9
|
+
.group("hubstats_labels.id")
|
10
|
+
.order("pull_request_count DESC")
|
11
|
+
end
|
11
12
|
|
12
13
|
scope :with_ids, lambda { |pull_ids| (where("hubstats_labels_pull_requests.pull_request_id" => pull_ids)) }
|
13
14
|
|
@@ -60,6 +60,16 @@ module Hubstats
|
|
60
60
|
self.labels = labels
|
61
61
|
end
|
62
62
|
|
63
|
+
def self.all_filtered(params, timespan)
|
64
|
+
filter_based_on_timespan(timespan, params[:state])
|
65
|
+
.belonging_to_users(params[:users])
|
66
|
+
.belonging_to_repos(params[:repos])
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.filter_based_on_timespan(timespan, state)
|
70
|
+
with_state(state).updated_since(timespan)
|
71
|
+
end
|
72
|
+
|
63
73
|
def self.state_based_order(timespan,state,order)
|
64
74
|
order = ["ASC","DESC"].detect{|order_type| order_type.to_s == order.to_s.upcase } || "DESC"
|
65
75
|
if state == "closed"
|
data/app/models/hubstats/repo.rb
CHANGED
data/app/models/hubstats/user.rb
CHANGED
@@ -18,6 +18,9 @@
|
|
18
18
|
<div class="row">
|
19
19
|
<h4> Pull Requests </h4>
|
20
20
|
<%= render 'hubstats/tables/pulls-condensed' %>
|
21
|
+
<% if @pull_request_count > 20 %>
|
22
|
+
<p class="pull-right"><%= link_to "View All", pulls_path(:deploys => @deploy.id) %></p>
|
23
|
+
<% end %>
|
21
24
|
</div>
|
22
25
|
</div>
|
23
26
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
<div class="repos">
|
3
3
|
<div class="row single-repo header">
|
4
4
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
5
|
+
<a class="header desc" id="name"> Repository Name <span class="octicon"></span> </a>
|
5
6
|
</div>
|
6
7
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
7
8
|
<a class="header desc" id="deploys"> Deploys <span class="octicon"></span> </a>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
<div class="users">
|
3
3
|
<div class="row single-user header">
|
4
4
|
<div class="col-lg-4 col-md-4 col-sm-4">
|
5
|
+
<a class="header desc" id="name"> GitHub Username <span class="octicon"></span> </a>
|
5
6
|
</div>
|
6
7
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
7
8
|
<a class="header desc" id="deploys"> Deploys <span class="octicon"></span> </a>
|
data/lib/hubstats/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.12
|
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-06-
|
12
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -131,6 +131,7 @@ executables: []
|
|
131
131
|
extensions: []
|
132
132
|
extra_rdoc_files: []
|
133
133
|
files:
|
134
|
+
- .codeclimate.yml
|
134
135
|
- .gitignore
|
135
136
|
- .octopolo.yml
|
136
137
|
- .rspec
|