hubstats 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +8 -8
  2. data/README.rdoc +1 -3
  3. data/app/assets/stylesheets/hubstats/application.css +35 -9
  4. data/app/controllers/hubstats/pull_requests_controller.rb +3 -10
  5. data/app/controllers/hubstats/repos_controller.rb +12 -10
  6. data/app/controllers/hubstats/users_controller.rb +9 -7
  7. data/app/views/hubstats/partials/_comment-condensed.html.erb +22 -0
  8. data/app/views/hubstats/partials/_comment.html.erb +10 -1
  9. data/app/views/hubstats/partials/_header.html.erb +3 -3
  10. data/app/views/hubstats/partials/_pull-condensed.html.erb +27 -0
  11. data/app/views/hubstats/partials/_pull.html.erb +5 -1
  12. data/app/views/hubstats/{metrics → partials}/_quick_stats.html.erb +1 -0
  13. data/app/views/hubstats/partials/_repo.html.erb +20 -0
  14. data/app/views/hubstats/partials/_user-condensed.html.erb +30 -0
  15. data/app/views/hubstats/partials/_user.html.erb +8 -4
  16. data/app/views/hubstats/pull_requests/index.html.erb +2 -3
  17. data/app/views/hubstats/pull_requests/show.html.erb +12 -4
  18. data/app/views/hubstats/repos/dashboard.html.erb +10 -7
  19. data/app/views/hubstats/repos/index.html.erb +1 -1
  20. data/app/views/hubstats/repos/show.html.erb +17 -10
  21. data/app/views/hubstats/tables/_comments-condensed.html.erb +7 -0
  22. data/app/views/hubstats/tables/_comments.html.erb +7 -0
  23. data/app/views/hubstats/tables/_pulls-condensed.html.erb +8 -0
  24. data/app/views/hubstats/tables/_pulls.html.erb +8 -0
  25. data/app/views/hubstats/tables/_repos-condensed.html.erb +8 -0
  26. data/app/views/hubstats/tables/_repos.html.erb +8 -0
  27. data/app/views/hubstats/tables/_users-condensed.html.erb +7 -0
  28. data/app/views/hubstats/tables/_users.html.erb +7 -0
  29. data/app/views/hubstats/users/index.html.erb +7 -3
  30. data/app/views/hubstats/users/show.html.erb +13 -10
  31. data/config/routes.rb +2 -2
  32. data/lib/hubstats/events_handler.rb +1 -11
  33. data/lib/hubstats/version.rb +1 -1
  34. data/test/dummy/config/routes.rb +1 -1
  35. data/test/dummy/log/development.log +0 -0
  36. data/test/dummy/log/test.log +33 -0
  37. data/test/dummy/tmp/cache/assets/CAD/3D0/sprockets%2F781852b612e12270af6602bdb8f985a4 +0 -0
  38. data/test/dummy/tmp/cache/assets/CBC/4C0/sprockets%2F43796510bea9e088167ff07f3d0a8484 +0 -0
  39. data/test/dummy/tmp/cache/assets/D20/FF0/sprockets%2F941bab9382328e98fd569386d1ec0af5 +0 -0
  40. metadata +15 -10
  41. data/app/views/hubstats/metrics/_comments_table.html.erb +0 -10
  42. data/app/views/hubstats/metrics/_pulls_table.html.erb +0 -14
  43. data/app/views/hubstats/metrics/_repos_table.html.erb +0 -8
  44. data/app/views/hubstats/metrics/_users_table.html.erb +0 -14
  45. data/app/views/hubstats/pull_requests/repo_index.html.erb +0 -8
  46. data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2JhNzMwNDg0MmYwM2RjNjczYmMyOTY0YTBiMjI2YjY5NDE4OGZiOQ==
4
+ ZGJjMGNlNWFiMzEyZjE0Zjk2MGRlNTJmNGQzM2JjY2QxOTYxY2NhYw==
5
5
  data.tar.gz: !binary |-
6
- ZGQwNjg0Yjc4Nzk0MDQwMWI5ZjViODBjZmYxNjRmMTIwMDlhNGE3Nw==
6
+ NGFjNTQzNjgzMjM2ZDQ4MzBmZTM1ZDZhMjg0Y2ZhNDQxMDZmOGQ5Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDNiOGY2YzM5ZjM0MmUzNTllNDI4Zjk0YTQ4NDc4ZjQzMzAwM2FiYjFlMDE1
10
- OWQwMTExOWZjNTI1ZDAzNTkyNGM1NjE1MTBiMWI0ZDZlMWQ2ZGQxZjM5MmQ5
11
- YTI4OTJiODc2NWRmMTg3NDA3ODhjMDMwMmRjMjhiMTEwNjU0NDE=
9
+ ODVkOWJiZDczNmUzODAzNjBmZWFmNjc2YmNiODJmNzM0MmZlYjg3Y2JhMzk2
10
+ OWY0MmYxMTZlNmUyZGNmMWYxNTkzMzM4MTJkMDM1N2EzMjhhODVmOTE1NTc4
11
+ YmNhZGJjMzE4NjVlNDJhOWM4ZDNlYjNiZjUxNTRjMWI4NmJlYjk=
12
12
  data.tar.gz: !binary |-
13
- M2YxNWRjYWIwNDk4YTg4NGFkY2I0YjYzZjEyZDc5NDAxZTRjMmU3NjRmY2Ji
14
- Yjg4ZWU2MGU5NGZmZWViOWQ3N2IyMzI1MjRhZDk5NjE3MDUwNjE1MDg4Mjdi
15
- NDkwZWNlMmIwZTdiZmE0NTQxOWM3YWZlMWQ0NTk0MDAzMjk1MmI=
13
+ YWUwYzIzMjRmMmVlMjYwYjU4MjFhNmZhZTdkMmVlYjg5ZTA1YWIyNDBkM2Mw
14
+ ZmJiOTdmOTI5NDFhMjYyYWUyMzc0NWQ2YmY5M2YzMTAxNGNiODgxYzliMzQw
15
+ ZGRmNGEzZmM2MmJlYzg2NmI4MGI2ZGY4ZjdlOTdjODI3ZDRlMjU=
@@ -31,6 +31,4 @@ Hubstats needs to know what repos for it to watch. You can set it to watch eithe
31
31
  rake hubstats:setup
32
32
  Add 'mount Hubstats::Engine => "/hubstats"' to your routes file
33
33
 
34
- This project rocks and uses MIT-LICENSE.
35
-
36
- Sport Ngin
34
+ This project rocks and uses MIT-LICENSE.
@@ -31,53 +31,79 @@
31
31
  .text-large {
32
32
  font-size: 32px;
33
33
  }
34
+
35
+ .text-small {
36
+ font-size: 12px;
37
+ margin: 0px;
38
+ }
34
39
  .stat-label {
35
40
  display: inline-block;
36
41
  }
37
42
 
38
43
  .single-comment > .user-image,
44
+ .single-comment > .user-image-small,
39
45
  .single-pull > .user-image,
46
+ .single-pull > .user-image-small,
40
47
  .single-user > .user-image,
41
48
  .single-user > .user-image-small {
42
49
  padding: 5px;
43
50
  }
44
51
 
45
- .user-image > img{
52
+
53
+ .user-image > img,
54
+ .repo-image {
46
55
  width: 55px;
47
56
  height: 55px;
48
57
  }
49
58
 
50
- .user-image-small > img{
51
- width: 45px;
52
- height: 45px;
59
+ .repo-octicon-small {
60
+ font-size: 36px !important;
61
+ }
62
+
63
+ .repo-image-small {
64
+ padding: 5px !important;
65
+ }
66
+
67
+ .user-image-small > img,
68
+ .repo-image-small > .repo-octicon-small{
69
+ width: 36px;
70
+ height: 36px;
53
71
  }
54
72
 
55
- .pulls, .comments, .users {
73
+ .pulls, .comments, .users, .repos {
56
74
  margin: 15px 0px 15px 0px;
57
75
  border: 1px solid #ccc;
58
76
  border-radius: 5px;
59
77
  }
60
78
 
61
- .pulls > .col, .comments > .col, .users > .col{
79
+ .pulls > .col, .comments > .col, .users > .col, .repos > .col{
62
80
  padding: 0px 5px 0px 5px;
63
81
  }
64
82
 
65
- .row .single-pull, .row .single-comment, .row .single-user{
83
+ .row .single-pull,
84
+ .row .single-comment,
85
+ .row .single-user,
86
+ .row .single-repo {
66
87
  padding:5px;
67
88
  margin: 0px;
68
89
  border-bottom: 1px solid #ccc;
69
90
  }
70
91
 
71
92
  .comment-info > .well {
93
+ word-wrap: break-word;
72
94
  padding: 10px;
73
95
  margin-bottom: 5px;
74
96
  }
75
97
 
76
- .single-pull > .pull-info, .single-user > .user-info {
98
+ .single-pull > .pull-info,
99
+ .single-user > .user-info,
100
+ .single-repo > .repo-info {
77
101
  padding: 0px;
78
102
  }
79
103
 
80
- .pull-info > h4, .user-info > h4 {
104
+ .pull-info > h4,
105
+ .user-info > h4,
106
+ .repo-info > h4 {
81
107
  margin: 0px;
82
108
  }
83
109
 
@@ -21,20 +21,13 @@ module Hubstats
21
21
  .paginate(:page => params[:page], :per_page => 15)
22
22
  end
23
23
 
24
- def repo_index
25
- @repo = Hubstats::Repo.where(name: params[:repo]).first
26
- @pull_requests = Hubstats::PullRequest.belonging_to_repo(@repo.id).closed_since(@timespan).order("closed_at DESC")
27
- end
28
-
29
24
  def show
30
25
  @repo = Hubstats::Repo.where(name: params[:repo]).first
31
26
  @pull_request = Hubstats::PullRequest.belonging_to_repo(@repo.id).where(id: params[:id]).first
32
- @comments = Hubstats::Comment.belonging_to_pull_request(params[:id]).includes(:user).created_since(@timespan)
27
+ @comments = Hubstats::Comment.belonging_to_pull_request(params[:id]).includes(:user).created_since(@timespan).limit(20)
28
+ @comment_count = Hubstats::Comment.belonging_to_pull_request(params[:id]).includes(:user).created_since(@timespan).count(:all)
33
29
  @stats = {
34
- github: @pull_request.html_url,
35
- comment_count: @comments.count(:all),
36
- additions: @pull_request.additions.to_i,
37
- deletions: @pull_request.deletions.to_i,
30
+ comment_count: @comment_count,
38
31
  net_additions: @pull_request.additions.to_i - @pull_request.deletions.to_i
39
32
  }
40
33
  end
@@ -20,15 +20,17 @@ module Hubstats
20
20
 
21
21
  def show
22
22
  @repo = Hubstats::Repo.where(name: params[:repo]).first
23
- @pull_requests = Hubstats::PullRequest.belonging_to_repo(@repo.id).closed_since(@timespan).order("closed_at DESC").limit(20)
24
- @users = Hubstats::User.with_pulls_or_comments(@timespan,@repo.id).only_active
23
+ @pull_requests = Hubstats::PullRequest.belonging_to_repo(@repo.id).updated_since(@timespan).order("updated_at DESC").limit(20)
24
+ @users = Hubstats::User.with_pulls_or_comments(@timespan,@repo.id).only_active.limit(20)
25
+ @pull_count = Hubstats::PullRequest.belonging_to_repo(@repo.id).updated_since(@timespan).count(:all)
26
+ @user_count = Hubstats::User.with_pulls_or_comments(@timespan,@repo.id).only_active.length
25
27
  @stats = {
26
- user_count: @users.length,
27
- pull_count: Hubstats::PullRequest.belonging_to_repo(@repo.id).closed_since(@timespan).count(:all),
28
+ user_count: @user_count,
29
+ pull_count: @pull_count,
28
30
  comment_count: Hubstats::Comment.belonging_to_repo(@repo.id).created_since(@timespan).count(:all),
29
- avg_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:additions).to_i,
30
- avg_deletions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:deletions).to_i,
31
- net_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).sum(:additions).to_i - Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).sum(:deletions).to_i
31
+ avg_additions: Hubstats::PullRequest.updated_since(@timespan).belonging_to_repo(@repo.id).average(:additions).to_i,
32
+ avg_deletions: Hubstats::PullRequest.updated_since(@timespan).belonging_to_repo(@repo.id).average(:deletions).to_i,
33
+ net_additions: Hubstats::PullRequest.updated_since(@timespan).belonging_to_repo(@repo.id).sum(:additions).to_i - Hubstats::PullRequest.updated_since(@timespan).belonging_to_repo(@repo.id).sum(:deletions).to_i
32
34
  }
33
35
  end
34
36
 
@@ -39,10 +41,10 @@ module Hubstats
39
41
  @user_count = Hubstats::User.with_pulls_or_comments(@timespan).only_active.length
40
42
  @stats = {
41
43
  user_count: @user_count,
42
- pull_count: Hubstats::PullRequest.closed_since(@timespan).count(:all),
44
+ pull_count: Hubstats::PullRequest.updated_since(@timespan).count(:all),
43
45
  comment_count: Hubstats::Comment.created_since(@timespan).count(:all),
44
- avg_additions: Hubstats::PullRequest.closed_since(@timespan).average(:additions).to_i,
45
- avg_deletions: Hubstats::PullRequest.closed_since(@timespan).average(:deletions).to_i
46
+ avg_additions: Hubstats::PullRequest.updated_since(@timespan).average(:additions).to_i,
47
+ avg_deletions: Hubstats::PullRequest.updated_since(@timespan).average(:deletions).to_i
46
48
  }
47
49
  end
48
50
  end
@@ -9,7 +9,7 @@ module Hubstats
9
9
  elsif params[:id] ##
10
10
  @users = Hubstats::User.where(id: params[:id].split(",")).order("login ASC")
11
11
  else
12
- @users = Hubstats::User.with_all_metrics(@timespan).with_id(params[:users]).custom_order(params[:order]).paginate(:page => params[:page], :per_page => 15)
12
+ @users = Hubstats::User.only_active.with_all_metrics(@timespan).with_id(params[:users]).custom_order(params[:order]).paginate(:page => params[:page], :per_page => 15)
13
13
  end
14
14
 
15
15
  respond_to do |format|
@@ -20,16 +20,18 @@ module Hubstats
20
20
 
21
21
  def show
22
22
  @user = Hubstats::User.where(login: params[:id]).first
23
- @pull_requests = Hubstats::PullRequest.belonging_to_user(@user.id).closed_since(@timespan).order("closed_at DESC").limit(20)
23
+ @pull_requests = Hubstats::PullRequest.belonging_to_user(@user.id).updated_since(@timespan).order("updated_at DESC").limit(20)
24
24
  @comments = Hubstats::Comment.belonging_to_user(@user.id).created_since(@timespan).order("created_at DESC").limit(20)
25
25
  @review = Hubstats::User.pulls_reviewed_count(@timespan).where(login: params[:id]).first
26
+ @pull_count = Hubstats::PullRequest.belonging_to_user(@user.id).updated_since(@timespan).count(:all)
27
+ @comment_count = Hubstats::Comment.belonging_to_user(@user.id).created_since(@timespan).count(:all)
26
28
  @stats = {
27
- pull_count: Hubstats::PullRequest.belonging_to_user(@user.id).closed_since(@timespan).count(:all),
28
- comment_count: Hubstats::Comment.belonging_to_user(@user.id).created_since(@timespan).count(:all),
29
+ pull_count: @pull_count,
30
+ comment_count: @comment_count,
29
31
  review_count: @review ? @review.reviews_count : 0,
30
- avg_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_user(@user.id).average(:additions).to_i,
31
- avg_deletions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_user(@user.id).average(:deletions).to_i,
32
- net_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_user(@user.id).sum(:additions).to_i - Hubstats::PullRequest.closed_since(@timespan).belonging_to_user(@user.id).sum(:deletions).to_i
32
+ avg_additions: Hubstats::PullRequest.updated_since(@timespan).belonging_to_user(@user.id).average(:additions).to_i,
33
+ avg_deletions: Hubstats::PullRequest.updated_since(@timespan).belonging_to_user(@user.id).average(:deletions).to_i,
34
+ net_additions: Hubstats::PullRequest.updated_since(@timespan).belonging_to_user(@user.id).sum(:additions).to_i - Hubstats::PullRequest.updated_since(@timespan).belonging_to_user(@user.id).sum(:deletions).to_i
33
35
  }
34
36
  end
35
37
 
@@ -0,0 +1,22 @@
1
+ <div class="row single-comment">
2
+ <div class="user-image-small col-lg-1 col-md-1 col-sm-2 col-xs-2">
3
+ <img src= <%= comment.user.avatar_url%> alt= <%= comment.user.login %> >
4
+ </div>
5
+
6
+ <div class="comment-info col-lg-10 col-md-10 col-sm-8 col-xs-8">
7
+ <%= link_to comment.user.login, user_path(comment.user) %> commented
8
+ <%= "#{time_ago_in_words(comment.created_at)} ago "%> <br>
9
+ <div class="well">
10
+ <%= comment.body %>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
15
+ <div class="pull-right">
16
+ <a class="subtle" href=<%= comment.html_url %> >
17
+ <span class="octicon octicon-mark-github"></span>
18
+ </a>
19
+ </span>
20
+ </div>
21
+ </div>
22
+ </div>
@@ -3,11 +3,20 @@
3
3
  <img src= <%= comment.user.avatar_url%> alt= <%= comment.user.login %> >
4
4
  </div>
5
5
 
6
- <div class="comment-info col-lg-11 col-md-11 col-sm-11">
6
+ <div class="comment-info col-lg-10 col-md-10 col-sm-10">
7
7
  <%= link_to comment.user.login, user_path(comment.user) %> commented
8
8
  <%= "#{time_ago_in_words(comment.created_at)} ago "%> <br>
9
9
  <div class="well">
10
10
  <%= comment.body %>
11
11
  </div>
12
12
  </div>
13
+
14
+ <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
15
+ <div class="pull-right">
16
+ <a class="subtle" href=<%= comment.html_url %> >
17
+ <span class="octicon octicon-mark-github"></span>
18
+ </a>
19
+ </span>
20
+ </div>
21
+ </div>
13
22
  </div>
@@ -9,13 +9,13 @@
9
9
  <span class="icon-bar"></span>
10
10
  <span class="icon-bar"></span>
11
11
  </button>
12
- <a class="navbar-brand title" href="/hubstats/">Hubstats: Github Metrics</a>
12
+ <a class="navbar-brand title" href="/">Hubstats</a>
13
13
  </div>
14
14
 
15
15
  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
16
16
  <ul class="nav navbar-nav navbar-right">
17
- <li><%= link_to "Metrics", root_path%></li>
18
- <li><%= link_to "Pulls", pulls_path%></li>
17
+ <li><%= link_to "Metrics", metrics_path%></li>
18
+ <li><%= link_to "Pulls", root_path%></li>
19
19
  <li><%= link_to "Users", users_path%></li>
20
20
  <li>
21
21
  <select class="form-control push-down" id="time-select">
@@ -0,0 +1,27 @@
1
+ <div class="row single-pull">
2
+ <div class="user-image-small col-lg-1 col-md-1 col-sm-1 col-xs-2" >
3
+ <img src= <%= pull.user.avatar_url%> alt= <%= pull.user.login %> >
4
+ </div>
5
+
6
+ <div class="pull-info col-lg-9 col-md-9 col-sm-9 col-xs-8">
7
+ <h4>
8
+ <%= link_to pull.title, repo_pull_path({:repo => pull.repo.name, :id => pull.id}) %>
9
+ </h4>
10
+ by <%= link_to pull.user.login, user_path(pull.user) %>
11
+ <% if pull.state == 'closed' %>
12
+ <%= "closed #{time_ago_in_words(pull.closed_at)} ago "%>
13
+ <% else %>
14
+ <%= "opened #{time_ago_in_words(pull.created_at)} ago "%>
15
+ <% end %>
16
+ </div>
17
+
18
+ <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2" >
19
+ <div class="pull-right">
20
+ # <%= pull.number %>
21
+ <a class="subtle" href=<%= pull.html_url %> >
22
+ <span class="octicon octicon-mark-github"></span>
23
+ </a>
24
+ </span>
25
+ </div>
26
+ </div>
27
+ </div>
@@ -22,7 +22,11 @@
22
22
 
23
23
  <div class="col-lg-2 col-md-2 col-sm-2" >
24
24
  <div class="pull-right">
25
- # <%= pull.number %>
25
+ # <%= pull.number %>
26
+ <a class="subtle" href=<%= pull.html_url %> >
27
+ <span class="octicon octicon-mark-github"></span>
28
+ </a>
29
+ </span>
26
30
  </div>
27
31
  </div>
28
32
  </div>
@@ -1,3 +1,4 @@
1
+ <div class="col-lg-<%= (12-(@stats.length)*2)/2 %>"></div>
1
2
  <% if @stats.has_key? :user_count %>
2
3
  <div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
3
4
  <h1> <%= @stats[:user_count] %> </h1>
@@ -0,0 +1,20 @@
1
+ <div class="row single-repo">
2
+ <div class="repo-image-small col-lg-1 col-md-1 col-sm-1 col-xs-2" >
3
+ <span class="repo-octicon-small mega-octicon octicon-repo"></span>
4
+
5
+ </div>
6
+ <div class="repo-info col-lg-10 col-md-10 col-sm-10 col-xs-8">
7
+ <h4>
8
+ <%= link_to repo.name, repo_path(repo)%>
9
+ </h4>
10
+ updated <%= distance_of_time_in_words(DateTime.now,repo.updated_at) %> ago
11
+ </div>
12
+ <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
13
+ <div class="pull-right">
14
+ <a class="subtle" href=<%= repo.html_url %> >
15
+ <span class="octicon octicon-mark-github"></span>
16
+ </a>
17
+ </span>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -0,0 +1,30 @@
1
+ <div class="row single-user">
2
+ <div class="user-image-small col-lg-1 col-md-1 col-sm-1 col-xs-2" >
3
+ <img src= <%= user.avatar_url%> alt= <%= user.login %> >
4
+ </div>
5
+ <div class="user-info col-lg-3 col-md-3 col-sm-3 col-xs-3">
6
+ <h4>
7
+ <%= link_to user.login, user_path(user) %>
8
+ </h4>
9
+ </div>
10
+ <div class="col-lg-3 col-lg-offset-1 col-md-3 col-sm-3 col-xs-3">
11
+ <div class="pull-right">
12
+ <span class="text-large"><%= user.pull_request_count %></span>
13
+ <span class="mega-octicon octicon-git-pull-request"></span>
14
+ </div>
15
+ </div>
16
+ <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
17
+ <div class="pull-right">
18
+ <span class="text-large"><%= user.comment_count %></span>
19
+ <span class="mega-octicon octicon-comment"></span>
20
+ </div>
21
+ </div>
22
+ <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
23
+ <div class="pull-right">
24
+ <a class="subtle" href=<%= user.html_url %> >
25
+ <span class="octicon octicon-mark-github"></span>
26
+ </a>
27
+ </span>
28
+ </div>
29
+ </div>
30
+ </div>
@@ -15,27 +15,31 @@
15
15
  </h4>
16
16
  </div>
17
17
  <div class="col-lg-2 col-md-2 col-sm-2">
18
- <div class="push-down pull-right">
18
+ <div class="pull-right">
19
19
  <span class="text-large"><%= user.pull_request_count %></span>
20
20
  <span class="mega-octicon octicon-git-pull-request"></span>
21
+ <p class="text-small text-center"> pulls </p>
21
22
  </div>
22
23
  </div>
23
24
  <div class="col-lg-2 col-md-2 col-sm-2">
24
- <div class="push-down pull-right">
25
+ <div class="pull-right">
25
26
  <span class="text-large"><%= user.comment_count %></span>
26
27
  <span class="mega-octicon octicon-comment"></span>
28
+ <p class="text-small text-center"> comments </p>
27
29
  </div>
28
30
  </div>
29
31
  <div class="col-lg-2 col-md-2 col-sm-2">
30
- <div class="push-down pull-right">
32
+ <div class="pull-right">
31
33
  <span class="text-large"><%= user.average_additions %></span>
32
34
  <span class="mega-octicon octicon-plus"></span>
35
+ <p class="text-small text-center"> additions </p>
33
36
  </div>
34
37
  </div>
35
38
  <div class="col-lg-2 col-md-2 col-sm-2">
36
- <div class="push-down pull-right">
39
+ <div class="pull-right">
37
40
  <span class="text-large"><%= user.average_deletions %></span>
38
41
  <span class="mega-octicon octicon-dash"></span>
42
+ <p class="text-small text-center"> deletions </p>
39
43
  </div>
40
44
  </div>
41
45
 
@@ -47,9 +47,8 @@
47
47
  </label>
48
48
  </div>
49
49
 
50
- <div class="pulls">
51
- <%= render partial: 'hubstats/partials/pull', collection: @pull_requests, as: :pull %>
52
- </div>
50
+ <%= render 'hubstats/tables/pulls' %>
51
+
53
52
 
54
53
  <div class="text-center">
55
54
  <%= will_paginate @posts, renderer: BootstrapPagination::Rails %>
@@ -1,11 +1,19 @@
1
1
  <div class="container" id="repo">
2
2
  <div class="row">
3
- <h3> <%= @pull_request.title.titleize %> </h3>
4
- <%= render 'hubstats/metrics/quick_stats' %>
3
+ <h1 class="title text-center">
4
+ <%= link_to @repo.name.titleize, repo_path %> /
5
+ <a href=<%=@pull_request.html_url%>>
6
+ <%= @pull_request.title.titleize %>
7
+ </a>
8
+ </h1>
9
+ <%= render 'hubstats/partials/quick_stats' %>
5
10
  </div>
6
11
 
7
- <div class="col col-lg-7">
8
- <%= render 'hubstats/metrics/comments_table' %>
12
+ <div class="col col-lg-8 col-lg-offset-2">
13
+ <div class="row">
14
+ <h4> Comments </h4>
15
+ <%= render 'hubstats/tables/comments' %>
16
+ </div>
9
17
  </div>
10
18
  </div>
11
19
 
@@ -1,21 +1,24 @@
1
1
  <div class="container" id="splash">
2
2
  <div class="row text-center">
3
- <%= render 'hubstats/metrics/quick_stats' %>
3
+ <%= render 'hubstats/partials/quick_stats' %>
4
4
  </div>
5
5
  <div class="row">
6
- <div class="col col-lg-5">
7
- <h3> Recently Active Repositories </h3>
8
- <%= render 'hubstats/metrics/repos_table' %>
6
+
7
+ <div class="col col-lg-6">
8
+ <h3> Active Repositories </h3>
9
+ <%= render 'hubstats/tables/repos' %>
9
10
  <% if @repo_count > 20 %>
10
11
  <p class="pull-right"><%= link_to "View All", repos_path %></p>
11
12
  <% end %>
12
13
  </div>
13
- <div class="col col-lg-5 col-lg-offset-2">
14
- <h3> Most Active Users </h3>
15
- <%= render 'hubstats/metrics/users_table' %>
14
+
15
+ <div class="col col-lg-6">
16
+ <h3> Active Users </h3>
17
+ <%= render 'hubstats/tables/users-condensed' %>
16
18
  <% if @user_count > 20 %>
17
19
  <p class="pull-right"><%= link_to "View All", users_path %></p>
18
20
  <% end %>
19
21
  </div>
22
+
20
23
  </div>
21
24
  </div>
@@ -2,7 +2,7 @@
2
2
  <div class="row">
3
3
  <div class="col col-lg-5">
4
4
  <h3> Recently Active Repositories </h3>
5
- <%= render 'hubstats/metrics/repos_table' %>
5
+ <%= render 'hubstats/table/repos_table' %>
6
6
  </div>
7
7
  </div>
8
8
  </div
@@ -1,18 +1,25 @@
1
1
  <div class="container" id="repo">
2
+
2
3
  <div class="row">
3
- <h1 class="title text-center"> <%= @repo.name.titleize %> </h1>
4
- <%= render 'hubstats/metrics/quick_stats' %>
4
+ <h1 class="title text-center"><a href=<%=@repo.html_url%>> <%= @repo.name.titleize %> </a></h1>
5
+ <%= render 'hubstats/partials/quick_stats' %>
5
6
  </div>
7
+
6
8
  <div class="row">
7
- <div class="col col-lg-5">
8
- <h3> Pull Requests since <%= time_ago_in_words(@timespan) %> ago</h3>
9
- <%= render 'hubstats/metrics/pulls_table' %>
9
+
10
+ <div class="col col-lg-6">
11
+ <h3> Pull Requests</h3>
12
+ <%= render 'hubstats/tables/pulls-condensed'%>
13
+ <% if @pull_count > 20 %>
14
+ <p class="pull-right"><%= link_to "View All", pulls_path(:repos => @repo.id) %></p>
15
+ <% end %>
10
16
  </div>
11
- <div class="col col-lg-5 col-lg-offset-2">
12
- <div class="row">
13
- <h3> Most Active Users </h3>
14
- <%= render 'hubstats/metrics/users_table' %>
15
- </div>
17
+
18
+ <div class="col col-lg-6">
19
+ <h3> Active Users </h3>
20
+ <%= render 'hubstats/tables/users-condensed' %>
16
21
  </div>
22
+
17
23
  </div>
24
+
18
25
  </div>
@@ -0,0 +1,7 @@
1
+ <% if @comments.length > 0 %>
2
+ <div class="comments">
3
+ <%= render partial: 'hubstats/partials/comment-condensed', collection: @comments, as: :comment %>
4
+ </div>
5
+ <% else %>
6
+ <p> No comments to show </p>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <% if @comments.length > 0 %>
2
+ <div class="comments">
3
+ <%= render partial: 'hubstats/partials/comment', collection: @comments, as: :comment %>
4
+ </div>
5
+ <% else %>
6
+ <p> No comments to show </p>
7
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% if @pull_requests.length > 0 %>
2
+ <div class="pulls">
3
+ <%= render partial: 'hubstats/partials/pull-condensed', collection: @pull_requests, as: :pull %>
4
+ </div>
5
+ <% else %>
6
+ <p> No pull requests to show </p>
7
+ <% end %>
8
+
@@ -0,0 +1,8 @@
1
+ <% if @pull_requests.length > 0 %>
2
+ <div class="pulls">
3
+ <%= render partial: 'hubstats/partials/pull', collection: @pull_requests, as: :pull %>
4
+ </div>
5
+ <% else %>
6
+ <p> No pull requests to show </p>
7
+ <% end %>
8
+
@@ -0,0 +1,8 @@
1
+ <% if @repos.length > 0 %>
2
+ <div class="repos">
3
+ <%= render partial: 'hubstats/partials/repo-condensed', collection: @repos, as: :repo %>
4
+ </div>
5
+ <% else %>
6
+ <p> No repos to show </p>
7
+ <% end %>
8
+
@@ -0,0 +1,8 @@
1
+ <% if @repos.length > 0 %>
2
+ <div class="repos">
3
+ <%= render partial: 'hubstats/partials/repo', collection: @repos, as: :repo %>
4
+ </div>
5
+ <% else %>
6
+ <p> No repos to show </p>
7
+ <% end %>
8
+
@@ -0,0 +1,7 @@
1
+ <% if @users.length > 0 %>
2
+ <div class="users">
3
+ <%= render partial: 'hubstats/partials/user-condensed', collection: @users, as: :user %>
4
+ </div>
5
+ <% else %>
6
+ <p> No users to show </p>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <% if @users.length > 0 %>
2
+ <div class="users">
3
+ <%= render partial: 'hubstats/partials/user', collection: @users, as: :user %>
4
+ </div>
5
+ <% else %>
6
+ <p> No users to show </p>
7
+ <% end %>
@@ -1,6 +1,10 @@
1
1
  <div class="container" id="user"%>
2
2
  <div class="row"%>
3
3
  <div class="col-lg-3">
4
+ <div class="form-group">
5
+ <input class="select2-control" id="repos">
6
+ </input>
7
+ </div>
4
8
  <div class="form-group">
5
9
  <input class="select2-control" id="users">
6
10
  </input>
@@ -24,9 +28,9 @@
24
28
  </label>
25
29
  </div>
26
30
 
27
- <div class="users">
28
- <%= render partial: 'hubstats/partials/user', collection: @users, as: :user %>
29
- </div>
31
+
32
+ <%= render 'hubstats/tables/users' %>
33
+
30
34
  <div class="text-center">
31
35
  <%= will_paginate @users, renderer: BootstrapPagination::Rails %>
32
36
  </div>
@@ -1,18 +1,21 @@
1
1
  <div class="container" id="repo">
2
2
  <div class="row">
3
- <h1 class="title text-center"> <%= @user.login %> </h1>
4
- <%= render 'hubstats/metrics/quick_stats' %>
3
+ <h1 class="title text-center"><a href=<%=@user.html_url%>> <%= @user.login %></a> </h1>
4
+ <%= render 'hubstats/partials/quick_stats' %>
5
5
  </div>
6
6
  <div class="row">
7
- <div class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2">
8
- <h3> Comments </h3>
9
- <% if @comments.length > 0 %>
10
- <div class="comments">
11
- <%= render partial: 'hubstats/partials/comment', collection: @comments, as: :comment %>
12
- </div>
13
- <% else %>
14
- <p> No comments to show </p>
7
+
8
+ <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5">
9
+ <h3> Pull Requests</h3>
10
+ <%= render 'hubstats/tables/pulls-condensed' %>
11
+ <% if @pull_count > 20 %>
12
+ <p class="pull-right"><%= link_to "View All", pulls_path(:users => @user.id) %></p>
15
13
  <% end %>
16
14
  </div>
15
+
16
+ <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
17
+ <h3> Comments </h3>
18
+ <%= render 'hubstats/tables/comments-condensed' %>
19
+ </div>
17
20
  </div>
18
21
  </div>
@@ -1,7 +1,8 @@
1
1
  Hubstats::Engine.routes.draw do
2
- root to: "repos#dashboard"
2
+ root to: "pull_requests#index"
3
3
 
4
4
  post "/handler" => "events#handler", :as => "handler"
5
+ get "/metrics" => "repos#dashboard", :as => "metrics"
5
6
  get "/pulls" => "pull_requests#index", :as => :pulls
6
7
  get "/users" => "users#index", :as => :users
7
8
  get "/repos" => "repos#index", :as => :repos
@@ -9,7 +10,6 @@ Hubstats::Engine.routes.draw do
9
10
 
10
11
  get "/:repo" => "repos#show", :as => :repo
11
12
  scope "/:repo", :as => :repo do
12
- get '/pulls' => "pull_requests#repo_index", :as => :pulls
13
13
  get '/pull/:id' => "pull_requests#show", :as => :pull
14
14
  end
15
15
 
@@ -29,9 +29,7 @@ module Hubstats
29
29
  comment[:repo_id] = payload[:repository][:id]
30
30
  comment[:pull_number] = get_pull_number(payload)
31
31
 
32
- comment = Hubstats::Comment.create_or_update(comment.with_indifferent_access)
33
- update_labels_from_comment(payload) if (kind == "Issue")
34
- comment
32
+ Hubstats::Comment.create_or_update(comment.with_indifferent_access)
35
33
  end
36
34
 
37
35
  #grabs the number off of anyone of the various places it can be
@@ -47,13 +45,5 @@ module Hubstats
47
45
  end
48
46
  end
49
47
 
50
- def update_labels_from_comment(payload)
51
- repo_id = payload[:repository][:id]
52
- number = payload[:issue][:number]
53
- labels = payload[:issue][:labels]
54
- pull = Hubstats::PullRequest.belonging_to_repo(repo_id).where(number: number).first
55
- pull.add_labels(labels)
56
- end
57
-
58
48
  end
59
49
  end
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- mount Hubstats::Engine => "/hubstats"
2
+ mount Hubstats::Engine => "/"
3
3
  end
@@ -19710,3 +19710,36 @@ Connecting to database specified by database.yml
19710
19710
  Hubstats::User Exists (0.1ms) SELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1
19711
19711
   (0.1ms) RELEASE SAVEPOINT active_record_1
19712
19712
   (0.4ms) ROLLBACK
19713
+ Connecting to database specified by database.yml
19714
+  (0.0ms) BEGIN
19715
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
19716
+  (0.1ms) ROLLBACK
19717
+  (0.0ms) BEGIN
19718
+  (0.1ms) ROLLBACK
19719
+  (0.1ms) BEGIN
19720
+  (0.2ms) ROLLBACK
19721
+  (0.1ms) BEGIN
19722
+  (0.1ms) ROLLBACK
19723
+  (0.1ms) BEGIN
19724
+  (0.1ms) ROLLBACK
19725
+  (0.1ms) BEGIN
19726
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
19727
+  (0.1ms) ROLLBACK
19728
+  (0.1ms) BEGIN
19729
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
19730
+  (0.1ms) ROLLBACK
19731
+  (0.1ms) BEGIN
19732
+  (0.1ms) ROLLBACK
19733
+  (0.1ms) BEGIN
19734
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
19735
+  (0.1ms) ROLLBACK
19736
+  (0.1ms) BEGIN
19737
+  (0.1ms) ROLLBACK
19738
+  (0.1ms) BEGIN
19739
+ Mysql2::Error: Table 'hubstats_test.hubstats_pull_requests' doesn't exist: SHOW FULL FIELDS FROM `hubstats_pull_requests`
19740
+  (0.1ms) ROLLBACK
19741
+  (0.0ms) BEGIN
19742
+  (0.1ms) ROLLBACK
19743
+  (0.1ms) BEGIN
19744
+ Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
19745
+  (0.1ms) ROLLBACK
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Hursh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -166,21 +166,28 @@ files:
166
166
  - app/models/hubstats/pull_request.rb
167
167
  - app/models/hubstats/repo.rb
168
168
  - app/models/hubstats/user.rb
169
- - app/views/hubstats/metrics/_comments_table.html.erb
170
- - app/views/hubstats/metrics/_pulls_table.html.erb
171
- - app/views/hubstats/metrics/_quick_stats.html.erb
172
- - app/views/hubstats/metrics/_repos_table.html.erb
173
- - app/views/hubstats/metrics/_users_table.html.erb
169
+ - app/views/hubstats/partials/_comment-condensed.html.erb
174
170
  - app/views/hubstats/partials/_comment.html.erb
175
171
  - app/views/hubstats/partials/_header.html.erb
172
+ - app/views/hubstats/partials/_pull-condensed.html.erb
176
173
  - app/views/hubstats/partials/_pull.html.erb
174
+ - app/views/hubstats/partials/_quick_stats.html.erb
175
+ - app/views/hubstats/partials/_repo.html.erb
176
+ - app/views/hubstats/partials/_user-condensed.html.erb
177
177
  - app/views/hubstats/partials/_user.html.erb
178
178
  - app/views/hubstats/pull_requests/index.html.erb
179
- - app/views/hubstats/pull_requests/repo_index.html.erb
180
179
  - app/views/hubstats/pull_requests/show.html.erb
181
180
  - app/views/hubstats/repos/dashboard.html.erb
182
181
  - app/views/hubstats/repos/index.html.erb
183
182
  - app/views/hubstats/repos/show.html.erb
183
+ - app/views/hubstats/tables/_comments-condensed.html.erb
184
+ - app/views/hubstats/tables/_comments.html.erb
185
+ - app/views/hubstats/tables/_pulls-condensed.html.erb
186
+ - app/views/hubstats/tables/_pulls.html.erb
187
+ - app/views/hubstats/tables/_repos-condensed.html.erb
188
+ - app/views/hubstats/tables/_repos.html.erb
189
+ - app/views/hubstats/tables/_users-condensed.html.erb
190
+ - app/views/hubstats/tables/_users.html.erb
184
191
  - app/views/hubstats/users/index.html.erb
185
192
  - app/views/hubstats/users/show.html.erb
186
193
  - app/views/layouts/hubstats/application.html.erb
@@ -313,7 +320,6 @@ files:
313
320
  - test/dummy/tmp/cache/assets/E30/D10/sprockets%2F5be1e5ad45bde1dbd7fb9f8d720277ea
314
321
  - test/dummy/tmp/cache/assets/E41/A20/sprockets%2F23cef5db9fa9d95cf84a2c688b5fe6ab
315
322
  - test/dummy/tmp/cache/assets/E4E/EF0/sprockets%2F5783afe3d038c6cdce49c1cbdaa12acb
316
- - test/dummy/tmp/pids/server.pid
317
323
  - test/functional/hubstats/splash_controller_test.rb
318
324
  - test/hubstats_test.rb
319
325
  - test/integration/navigation_test.rb
@@ -454,7 +460,6 @@ test_files:
454
460
  - test/dummy/tmp/cache/assets/E30/D10/sprockets%2F5be1e5ad45bde1dbd7fb9f8d720277ea
455
461
  - test/dummy/tmp/cache/assets/E41/A20/sprockets%2F23cef5db9fa9d95cf84a2c688b5fe6ab
456
462
  - test/dummy/tmp/cache/assets/E4E/EF0/sprockets%2F5783afe3d038c6cdce49c1cbdaa12acb
457
- - test/dummy/tmp/pids/server.pid
458
463
  - test/functional/hubstats/splash_controller_test.rb
459
464
  - test/hubstats_test.rb
460
465
  - test/integration/navigation_test.rb
@@ -1,10 +0,0 @@
1
- <div class="row">
2
- <h4> Comments </h4>
3
- <% if @comments.length > 0 %>
4
- <div class="comments">
5
- <%= render partial: 'hubstats/partials/comment', collection: @comments, as: :comment %>
6
- </div>
7
- <% else %>
8
- <p> No comments to show </p>
9
- <% end %>
10
- </div>
@@ -1,14 +0,0 @@
1
- <table class="table">
2
- <tr>
3
- <th>Pull Request</th>
4
- <th>User</th>
5
- <th>Closed</th>
6
- </tr>
7
- <% @pull_requests.each do |pull| %>
8
- <tr>
9
- <td><%= link_to pull.title, repo_pull_path({:repo => @repo.name, :id => pull.id}) %></td>
10
- <td><%= pull.user.login %></td>
11
- <td><%= distance_of_time_in_words(DateTime.now,pull.closed_at) %> ago</td>
12
- </tr>
13
- <% end %>
14
- </table>
@@ -1,8 +0,0 @@
1
- <table class="table">
2
- <% @repos.each do |repo| %>
3
- <tr>
4
- <td><%= link_to repo.name, repo_path(repo)%></td>
5
- <td><%= distance_of_time_in_words(DateTime.now,repo.updated_at) %> ago</td>
6
- </tr>
7
- <% end %>
8
- </table>
@@ -1,14 +0,0 @@
1
- <table class="table">
2
- <tr>
3
- <th> User </th>
4
- <th class="title"> Pull Requests </th>
5
- <th class="title"> Comments </th>
6
- </tr>
7
- <% @users.each do |user| %>
8
- <tr>
9
- <td><%= link_to user.login, user_path(user) %> </td>
10
- <td class="numeric"><%= user.pull_request_count %> </td>
11
- <td class="numeric"><%= user.comment_count %></td>
12
- </tr>
13
- <% end %>
14
- </table>
@@ -1,8 +0,0 @@
1
- <div class="container" id="pulls">
2
- <div class="row">
3
- <div class="col col-lg-5 col-lg-offset-2">
4
- <h3> All Pull Requests</h3>
5
- <%= render 'hubstats/metrics/pulls_table' %>
6
- </div>
7
- </div>
8
- </div>
@@ -1 +0,0 @@
1
- 48351