hubstats 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +2 -5
  4. data/CHANGELOG.markdown +9 -0
  5. data/Gemfile +1 -0
  6. data/app/controllers/hubstats/application_controller.rb +1 -1
  7. data/app/controllers/hubstats/deploys_controller.rb +14 -5
  8. data/app/controllers/hubstats/events_controller.rb +10 -2
  9. data/app/controllers/hubstats/users_controller.rb +1 -1
  10. data/app/models/hubstats/comment.rb +1 -6
  11. data/app/models/hubstats/deploy.rb +4 -6
  12. data/app/models/hubstats/label.rb +0 -2
  13. data/app/models/hubstats/pull_request.rb +5 -11
  14. data/app/models/hubstats/repo.rb +0 -8
  15. data/app/models/hubstats/team.rb +0 -1
  16. data/app/models/hubstats/user.rb +4 -8
  17. data/app/views/hubstats/deploys/show.html.erb +1 -1
  18. data/app/views/hubstats/pull_requests/show.html.erb +1 -1
  19. data/app/views/hubstats/repos/show.html.erb +2 -2
  20. data/app/views/hubstats/tables/{_comments-condensed.html.erb → _comments_condensed.html.erb} +0 -0
  21. data/app/views/hubstats/tables/{_deploys-condensed.html.erb → _deploys_condensed.html.erb} +0 -0
  22. data/app/views/hubstats/tables/{_pulls-condensed.html.erb → _pulls_condensed.html.erb} +0 -0
  23. data/app/views/hubstats/tables/{_repos-condensed.html.erb → _repos_condensed.html.erb} +0 -0
  24. data/app/views/hubstats/tables/{_users-condensed.html.erb → _users_condensed.html.erb} +0 -0
  25. data/app/views/hubstats/teams/show.html.erb +2 -2
  26. data/app/views/hubstats/users/show.html.erb +2 -2
  27. data/db/migrate/20140604130339_create_hubstats_pull_requests.rb +0 -1
  28. data/db/migrate/20140604130457_create_hubstats_users.rb +0 -1
  29. data/db/migrate/20140604130504_create_hubstats_comments.rb +0 -1
  30. data/db/migrate/20140604130550_create_hubstats_repos.rb +0 -1
  31. data/hubstats.gemspec +12 -11
  32. data/lib/hubstats/version.rb +1 -1
  33. data/spec/controllers/hubstats/deploys_controller_spec.rb +1 -1
  34. data/spec/lib/hubstats/github_api_spec.rb +1 -1
  35. data/test/dummy/config/application.rb +0 -6
  36. data/test/dummy/config/environments/development.rb +1 -10
  37. data/test/dummy/config/environments/production.rb +2 -4
  38. data/test/dummy/config/environments/test.rb +2 -7
  39. data/test/dummy/config/initializers/secret_token.rb +1 -0
  40. metadata +48 -34
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24009a4a6527e5b6f0728e28be81be575d9c388a
4
- data.tar.gz: 73080c209f89a6acf56ab571547432f694ead77a
3
+ metadata.gz: 1d0ed1ccc83782f9dcd5b82585e30b2b1b2fd67a
4
+ data.tar.gz: 75bd4646f6434e6e218c63724b543a172c429b47
5
5
  SHA512:
6
- metadata.gz: 736243798d4e36fc9ea81b86f143368213e52ea08d7f08432b7ad9ca43855821488a935c8ac2f36a798ee3bdf0713d9202500afca5a9d578af73933e0f8f42ad
7
- data.tar.gz: 3d112dd041ab75bcac5481abee78d7193d42310ba40528e2717505a484bece9d8d10b8e5f43562e68a9bb77448681d43d41c1c1ab2b38bbd5506551a70cdf39f
6
+ metadata.gz: f540d2f457868cf1972ec707b02e392f7f800cd37f119055ab8c21c86cce1a7b443407b85c08624424ea04529c71ee800a66322ab938a1fa5377c2d7a9533f8c
7
+ data.tar.gz: 38aab120621ceacfb01aea32db1147b640580d43897b72b0af0730e173f45b88bf98b27962fb001cb9b892d26c29a0a464ddd1f8535baf13777a7b951db5af47
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.2.2
1
+ ruby-2.2
data/.travis.yml CHANGED
@@ -4,12 +4,9 @@ branches:
4
4
  - master
5
5
  language: ruby
6
6
  cache: bundler
7
- env:
8
- - RAILS_VERSION=4.0
9
- - RAILS_VERSION=3.2
10
7
  rvm:
11
- - 2.1.2
12
- - 2.2.2
8
+ - 2.1
9
+ - 2.2
13
10
 
14
11
  script: bundle exec rspec
15
12
  before_script:
data/CHANGELOG.markdown CHANGED
@@ -1,8 +1,17 @@
1
+ #### v0.7.0
2
+ * Upgrading Hubstats to Rails 4.2.5
3
+
4
+ > Brian Bergstrom, Emma Sax: Andy Fleener: https://github.com/sportngin/hubstats/pull/93
5
+
1
6
  #### v0.6.0
2
7
  * Deleting unused columns from Hubstats database
3
8
 
4
9
  > Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/97
5
10
 
11
+ * Rake task should update teams based on whitelist; users show page should show team
12
+
13
+ > Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/95
14
+
6
15
  #### v0.5.12
7
16
  * Restrict mysql2 dependency to compatible version
8
17
 
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ gemspec
7
7
 
8
8
  # jquery-rails is used by the dummy application
9
9
  gem "jquery-rails"
10
+ gem 'bootstrap-datepicker-rails'
10
11
 
11
12
  # Declare any dependencies that are still in development here instead of in
12
13
  # your gemspec. These might include edge Rails or gems from your path or
@@ -1,5 +1,5 @@
1
1
  module Hubstats
2
- class ApplicationController < ApplicationController
2
+ class ApplicationController < ::ApplicationController
3
3
  before_filter :set_time
4
4
 
5
5
  # Private - Reads the cookie, and then either sets @start_date and @end_date to be the cookie's values
@@ -40,13 +40,14 @@ module Hubstats
40
40
  #
41
41
  # Returns - nothing, but makes a new deploy
42
42
  def create
43
- if params[:git_revision].nil? || params[:repo_name].nil? || params[:pull_request_ids].nil?
43
+ new_params = deploy_params
44
+ if new_params[:git_revision].nil? || new_params[:repo_name].nil? || new_params[:pull_request_ids].nil?
44
45
  render text: "Missing a necessary parameter: git revision, pull request ids, or repository name.", :status => 400 and return
45
46
  else
46
47
  @deploy = Deploy.new
47
- @deploy.deployed_at = params[:deployed_at]
48
- @deploy.git_revision = params[:git_revision]
49
- @repo = Hubstats::Repo.where(full_name: params[:repo_name])
48
+ @deploy.deployed_at = new_params[:deployed_at]
49
+ @deploy.git_revision = new_params[:git_revision]
50
+ @repo = Hubstats::Repo.where(full_name: new_params[:repo_name])
50
51
 
51
52
  if !valid_repo(@repo)
52
53
  render text: "Repository name is invalid.", :status => 400 and return
@@ -54,7 +55,7 @@ module Hubstats
54
55
  @deploy.repo_id = @repo.first.id.to_i
55
56
  end
56
57
 
57
- pull_request_id_array = params[:pull_request_ids].split(",").map {|i| i.strip.to_i}
58
+ pull_request_id_array = new_params[:pull_request_ids].split(",").map {|i| i.strip.to_i}
58
59
  if !valid_pr_ids(pull_request_id_array)
59
60
  render text: "No pull request ids given.", :status => 400 and return
60
61
  else
@@ -101,5 +102,13 @@ module Hubstats
101
102
  @deploy.user_id = pull.merged_by
102
103
  return true
103
104
  end
105
+
106
+ # Private - Allows only these parameters to be added when creating a deploy
107
+ #
108
+ # Returns - hash of parameters
109
+ private
110
+ def deploy_params
111
+ params.permit(:git_revision, :repo_name, :deployed_at, :user_id, :pull_request_ids)
112
+ end
104
113
  end
105
114
  end
@@ -13,13 +13,13 @@ module Hubstats
13
13
  verify_signature(request)
14
14
 
15
15
  kind = request.headers['X-Github-Event']
16
- event = params.with_indifferent_access
16
+ event = event_params.with_indifferent_access
17
17
 
18
18
  raw_parameters = request.request_parameters
19
19
  event[:github_action] = raw_parameters["action"]
20
20
 
21
21
  eventsHandler = Hubstats::EventsHandler.new()
22
- eventsHandler.route(event,kind)
22
+ eventsHandler.route(event, kind)
23
23
 
24
24
  render :nothing => true
25
25
  end
@@ -36,5 +36,13 @@ module Hubstats
36
36
  signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), Hubstats.config.webhook_endpoint, payload_body)
37
37
  return 500, "Signatures didn't match!" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE'])
38
38
  end
39
+
40
+ # Private - Allows only these parameters to be added when creating an event
41
+ #
42
+ # Returns - hash of parameters
43
+ private
44
+ def event_params
45
+ params.permit!
46
+ end
39
47
  end
40
48
  end
@@ -13,7 +13,7 @@ module Hubstats
13
13
  elsif params[:id]
14
14
  @users = Hubstats::User.where(id: params[:id].split(",")).order("login ASC")
15
15
  else
16
- @users = Hubstats::User.only_active.with_all_metrics(@start_date, @end_date)
16
+ @users = Hubstats::User.with_all_metrics(@start_date, @end_date)
17
17
  .with_id(params[:users])
18
18
  .custom_order(params[:order])
19
19
  .paginate(:page => params[:page], :per_page => 15)
@@ -7,7 +7,7 @@ module Hubstats
7
7
  scope :created_in_date_range, lambda {|start_date, end_date| where("hubstats_comments.created_at BETWEEN ? AND ?", start_date, end_date)}
8
8
  scope :belonging_to_pull_request, lambda {|pull_request_id| where(pull_request_id: pull_request_id)}
9
9
  scope :belonging_to_user, lambda {|user_id| where(user_id: user_id)}
10
- scope :belonging_to_team, lambda {|user_id| where(user_id: user_id.split(',')) if user_id}
10
+ scope :belonging_to_team, lambda {|user_ids| where(user_id: user_ids) if user_ids}
11
11
  scope :belonging_to_repo, lambda {|repo_id| where(repo_id: repo_id)}
12
12
 
13
13
  # Public - Gets the number of PRs that a user commented on that were not their own PR.
@@ -20,11 +20,6 @@ module Hubstats
20
20
  .where("hubstats_pull_requests.user_id != hubstats_comments.user_id")
21
21
  .group("hubstats_comments.user_id")
22
22
  }
23
-
24
- attr_accessible :id, :html_url, :url, :pull_request_url, :diff_hunk, :path,
25
- :position, :original_position, :line, :commit_id, :original_commit_id,
26
- :body, :created_at, :updated_at, :user_id, :pull_request_id, :repo_id,
27
- :kind
28
23
 
29
24
  belongs_to :user
30
25
  belongs_to :pull_request
@@ -13,13 +13,13 @@ module Hubstats
13
13
 
14
14
  # Various checks that can be used to filter, sort, and find info about deploys.
15
15
  scope :deployed_in_date_range, lambda {|start_date, end_date| where("hubstats_deploys.deployed_at BETWEEN ? AND ?", start_date, end_date)}
16
- scope :group, lambda {|group| group_by(:repo_id) if group }
16
+ scope :group_by_repo, lambda {|group| group_by(:repo_id) if group }
17
17
  scope :belonging_to_repo, lambda {|repo_id| where(repo_id: repo_id)}
18
18
  scope :belonging_to_user, lambda {|user_id| where(user_id: user_id)}
19
19
  scope :belonging_to_repos, lambda {|repo_id| where(repo_id: repo_id.split(',')) if repo_id}
20
20
  scope :belonging_to_users, lambda {|user_id| where(user_id: user_id.split(',')) if user_id}
21
- scope :with_repo_name, select('DISTINCT hubstats_repos.name as repo_name, hubstats_deploys.*').joins("LEFT JOIN hubstats_repos ON hubstats_repos.id = hubstats_deploys.repo_id")
22
- scope :with_user_name, select('DISTINCT hubstats_users.login as user_name, hubstats_deploys.*').joins("LEFT JOIN hubstats_users ON hubstats_users.id = hubstats_deploys.user_id")
21
+ scope :with_repo_name, -> { select('DISTINCT hubstats_repos.name as repo_name, hubstats_deploys.*').joins("LEFT JOIN hubstats_repos ON hubstats_repos.id = hubstats_deploys.repo_id") }
22
+ scope :with_user_name, -> { select('DISTINCT hubstats_users.login as user_name, hubstats_deploys.*').joins("LEFT JOIN hubstats_users ON hubstats_users.id = hubstats_deploys.user_id") }
23
23
 
24
24
  scope :belonging_to_teams, lambda {|teams|
25
25
  if teams
@@ -28,8 +28,6 @@ module Hubstats
28
28
  where(user_id: user_list.split(','))
29
29
  end
30
30
  }
31
-
32
- attr_accessible :git_revision, :repo_id, :deployed_at, :user_id, :pull_request_ids
33
31
 
34
32
  belongs_to :user
35
33
  belongs_to :repo
@@ -58,7 +56,7 @@ module Hubstats
58
56
  elsif group == "repo"
59
57
  with_repo_name.order("repo_name ASC")
60
58
  else
61
- scoped
59
+ all
62
60
  end
63
61
  end
64
62
 
@@ -22,8 +22,6 @@ module Hubstats
22
22
  .order("pull_request_count DESC")
23
23
  end
24
24
 
25
- attr_accessible :url, :name, :color
26
-
27
25
  has_and_belongs_to_many :pull_requests, :join_table => 'hubstats_labels_pull_requests'
28
26
 
29
27
  # Public - Checks if the label is currently existing, and if it isn't, then makes a new label with
@@ -16,18 +16,12 @@ module Hubstats
16
16
  scope :belonging_to_repos, lambda {|repo_id| where(repo_id: repo_id.split(',')) if repo_id}
17
17
  scope :belonging_to_teams, lambda {|team_id| where(team_id: team_id.split(',')) if team_id}
18
18
  scope :belonging_to_users, lambda {|user_id| where(user_id: user_id.split(',')) if user_id}
19
- scope :group, lambda {|group| group_by(:repo_id) if group }
19
+ scope :group_by_repo, lambda {|group| group_by(:repo_id) if group }
20
20
  scope :with_state, lambda {|state| (where(state: state) unless state == 'all') if state}
21
21
  scope :with_label, lambda {|label_name| joins(:labels).where(hubstats_labels: {name: label_name.split(',')}) if label_name}
22
- scope :distinct, select("DISTINCT hubstats_pull_requests.*")
23
- scope :with_repo_name, select('DISTINCT hubstats_repos.name as repo_name, hubstats_pull_requests.*').joins("LEFT JOIN hubstats_repos ON hubstats_repos.id = hubstats_pull_requests.repo_id")
24
- scope :with_user_name, select('DISTINCT hubstats_users.login as user_name, hubstats_pull_requests.*').joins("LEFT JOIN hubstats_users ON hubstats_users.id = hubstats_pull_requests.user_id")
25
-
26
- attr_accessible :id, :url, :html_url, :diff_url, :patch_url, :issue_url, :commits_url,
27
- :review_comments_url, :review_comment_url, :comments_url, :statuses_url, :number,
28
- :state, :title, :body, :created_at, :updated_at, :closed_at, :merged_at,
29
- :merge_commit_sha, :merged, :mergeable, :comments, :commits, :additions,
30
- :deletions, :changed_files, :user_id, :repo_id, :merged_by, :team_id
22
+ scope :distincter, -> { select("DISTINCT hubstats_pull_requests.*") }
23
+ scope :with_repo_name, -> { select('DISTINCT hubstats_repos.name as repo_name, hubstats_pull_requests.*').joins("LEFT JOIN hubstats_repos ON hubstats_repos.id = hubstats_pull_requests.repo_id") }
24
+ scope :with_user_name, -> { select('DISTINCT hubstats_users.login as user_name, hubstats_pull_requests.*').joins("LEFT JOIN hubstats_users ON hubstats_users.id = hubstats_pull_requests.user_id") }
31
25
 
32
26
  belongs_to :user
33
27
  belongs_to :repo
@@ -141,7 +135,7 @@ module Hubstats
141
135
  elsif group == 'repo'
142
136
  with_repo_name.order("repo_name asc")
143
137
  else
144
- scoped
138
+ all
145
139
  end
146
140
  end
147
141
 
@@ -75,14 +75,6 @@ module Hubstats
75
75
  .group("hubstats_repos.id")
76
76
  }
77
77
 
78
- attr_accessible :id, :name, :full_name, :homepage, :language, :description, :default_branch,
79
- :url, :html_url, :clone_url, :git_url, :ssh_url, :svn_url, :mirror_url,
80
- :hooks_url, :issue_events_url, :events_url, :contributors_url, :git_commits_url,
81
- :issue_comment_url, :merges_url, :issues_url, :pulls_url, :labels_url,
82
- :forks_count, :stargazers_count, :watchers_count, :size, :open_issues_count,
83
- :has_issues, :has_wiki, :has_downloads,:fork, :private,
84
- :pushed_at, :created_at, :updated_at, :owner_id
85
-
86
78
  has_many :pull_requests
87
79
  has_many :deploys
88
80
  has_many :comments
@@ -45,7 +45,6 @@ module Hubstats
45
45
  .group("hubstats_teams.id")
46
46
  }
47
47
 
48
- attr_accessible :name, :hubstats
49
48
  has_and_belongs_to_many :users, :join_table => 'hubstats_teams_users', :uniq => true
50
49
 
51
50
  # Public - Checks if the team is currently existing, and if it isn't, then makes a new team with
@@ -3,9 +3,9 @@ module Hubstats
3
3
 
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
- 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")
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") }
9
9
  scope :with_contributions, lambda {|start_date, end_date, repo_id| with_all_metrics_repos(start_date, end_date, repo_id) if repo_id}
10
10
 
11
11
  # Public - Counts all of the deploys for selected user that occurred between the start_date and end_date.
@@ -160,10 +160,6 @@ module Hubstats
160
160
  .joins("LEFT JOIN (#{deploys_count(start_date, end_date).to_sql}) AS deploys ON deploys.user_id = hubstats_users.id")
161
161
  .group("hubstats_users.id")
162
162
  }
163
-
164
- attr_accessible :login, :id, :avatar_url, :gravatar_id, :url, :html_url, :followers_url,
165
- :following_url, :gists_url, :starred_url, :subscriptions_url, :organizations_url,
166
- :repos_url, :events_url, :received_events_url, :role, :site_admin, :created_at, :updated_at
167
163
 
168
164
  validates :id, presence: true, uniqueness: true
169
165
 
@@ -179,7 +175,7 @@ module Hubstats
179
175
  #
180
176
  # Returns - the user
181
177
  def self.create_or_update(github_user)
182
- github_user[:role] = github_user.delete :type ##changing :type in to :role
178
+ github_user[:role] = github_user.delete :type ##changing :type into :role
183
179
  github_user = github_user.to_h.with_indifferent_access unless github_user.is_a? Hash
184
180
 
185
181
  user_data = github_user.slice(*Hubstats::User.column_names.map(&:to_sym))
@@ -20,7 +20,7 @@
20
20
  <div class="col col-lg-8 col-lg-offset-2">
21
21
  <div class="row">
22
22
  <h4> Merged Pull Requests </h4>
23
- <%= render 'hubstats/tables/pulls-condensed' %>
23
+ <%= render 'hubstats/tables/pulls_condensed' %>
24
24
  <% if @pull_request_count > 20 %>
25
25
  <p class="pull-right"><%= link_to "View All", pulls_path(:deploys => @deploy.id) %></p>
26
26
  <% end %>
@@ -18,7 +18,7 @@
18
18
  <div class="row">
19
19
  <%if @pull_request.state == "closed"%>
20
20
  <h4> Deployment </h4>
21
- <%= render 'hubstats/tables/deploys-condensed' %>
21
+ <%= render 'hubstats/tables/deploys_condensed' %>
22
22
  <%end%>
23
23
  </div>
24
24
  </div>
@@ -20,7 +20,7 @@
20
20
  <!-- Show all of the merged pull requests in a "condensed" view -->
21
21
  <div class="col col-lg-6">
22
22
  <h3> Merged Pull Requests</h3>
23
- <%= render 'hubstats/tables/pulls-condensed'%>
23
+ <%= render 'hubstats/tables/pulls_condensed'%>
24
24
  <% if @pull_count > 20 %>
25
25
  <p class="pull-right"><%= link_to "View All", pulls_path(:repos => @repo.id) %></p>
26
26
  <% end %>
@@ -29,7 +29,7 @@
29
29
  <!-- Show all of the deploys in a "condensed" view -->
30
30
  <div class="col col-lg-6">
31
31
  <h3> Deployments </h3>
32
- <%= render "hubstats/tables/deploys-condensed" %>
32
+ <%= render "hubstats/tables/deploys_condensed" %>
33
33
  <% if @deploy_count > 20 %>
34
34
  <p class="pull-right"><%= link_to "View All", deploys_path(:repos => @repo.id) %></p>
35
35
  <% end %>
@@ -20,7 +20,7 @@
20
20
  <!-- Show all of this team's merged pull requests in a "condensed" view -->
21
21
  <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5">
22
22
  <h3> Merged Pull Requests</h3>
23
- <%= render 'hubstats/tables/pulls-condensed' %>
23
+ <%= render 'hubstats/tables/pulls_condensed' %>
24
24
  <% if @pull_count > 20 %>
25
25
  <p class="pull-right"><%= link_to "View All", pulls_path(:teams => @team.id) %></p>
26
26
  <% end %>
@@ -29,7 +29,7 @@
29
29
  <!-- Show all of this team's users in a "condensed" view -->
30
30
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
31
31
  <h3> Active Users </h3>
32
- <%= render 'hubstats/tables/users-condensed' %>
32
+ <%= render 'hubstats/tables/users_condensed' %>
33
33
  </div>
34
34
  </div>
35
35
  </div>
@@ -22,7 +22,7 @@
22
22
  <!-- Show all of this user's merged pull requests in a "condensed" view -->
23
23
  <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5">
24
24
  <h3> Merged Pull Requests</h3>
25
- <%= render 'hubstats/tables/pulls-condensed' %>
25
+ <%= render 'hubstats/tables/pulls_condensed' %>
26
26
  <% if @pull_count > 20 %>
27
27
  <p class="pull-right"><%= link_to "View All", pulls_path(:users => @user.id) %></p>
28
28
  <% end %>
@@ -31,7 +31,7 @@
31
31
  <!-- Show all of this user's deploys in a "condensed" view -->
32
32
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
33
33
  <h3> Deployments </h3>
34
- <%= render 'hubstats/tables/deploys-condensed' %>
34
+ <%= render 'hubstats/tables/deploys_condensed' %>
35
35
  <% if @deploy_count > 20 %>
36
36
  <p class="pull-right"><%= link_to "View All", deploys_path(:users => @user.id) %></p>
37
37
  <% end %>
@@ -1,7 +1,6 @@
1
1
  class CreateHubstatsPullRequests < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :hubstats_pull_requests do |t|
4
- t.integer :id
5
4
  t.integer :number
6
5
  t.belongs_to :user
7
6
  t.belongs_to :repo
@@ -2,7 +2,6 @@ class CreateHubstatsUsers < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :hubstats_users do |t|
4
4
  t.string :login
5
- t.integer :id
6
5
  t.string :role
7
6
  t.boolean :site_admin
8
7
  t.timestamps
@@ -1,7 +1,6 @@
1
1
  class CreateHubstatsComments < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :hubstats_comments do |t|
4
- t.integer :id
5
4
  t.string :kind
6
5
  t.belongs_to :user
7
6
  t.belongs_to :pull_request
@@ -1,7 +1,6 @@
1
1
  class CreateHubstatsRepos < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :hubstats_repos do |t|
4
- t.integer :id
5
4
  t.belongs_to :owner
6
5
  t.string :name
7
6
  t.string :full_name
data/hubstats.gemspec CHANGED
@@ -16,16 +16,17 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files -z`.split("\x0")
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
18
 
19
- s.add_dependency "rails", "~> 3.2.18"
20
- s.add_dependency "octokit", "~> 4.0"
21
- s.add_dependency "will_paginate-bootstrap"
22
- s.add_dependency "select2-rails", "3.5.9"
23
- s.add_dependency "bootstrap-datepicker-rails", "~> 1.4.0"
19
+ s.add_dependency "rails", "~> 4.2"
20
+ s.add_dependency "octokit", "~> 4.2"
21
+ s.add_dependency "will_paginate-bootstrap", "~> 1.0"
22
+ s.add_dependency "select2-rails", "~> 3.0"
23
+ s.add_dependency "sass-rails"
24
+ s.add_dependency "bootstrap-datepicker-rails", "~> 1.5"
24
25
 
25
- s.add_development_dependency "mysql2",'~> 0.3.20'
26
- s.add_development_dependency "rspec-rails",'~> 3.0.0.beta'
27
- s.add_development_dependency "shoulda-matchers", "~> 2.6"
28
- s.add_development_dependency "factory_girl_rails", "~> 4.4"
29
- s.add_development_dependency "faker", "~> 1.3"
30
- s.add_development_dependency "test-unit", "~> 3.0"
26
+ s.add_development_dependency "mysql2",'~> 0.3.2'
27
+ s.add_development_dependency "rspec-rails",'~> 3.4'
28
+ s.add_development_dependency "shoulda-matchers", "~> 2.8"
29
+ s.add_development_dependency "factory_girl_rails", "~> 4.5"
30
+ s.add_development_dependency "faker", "~> 1.6"
31
+ s.add_development_dependency "test-unit", "~> 3.1"
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -59,11 +59,11 @@ module Hubstats
59
59
  "repo_name" => "example/name",
60
60
  "deployed_at" => "2009-02-03 03:00:00 -0500",
61
61
  "pull_request_ids" => "33364992, 5870592, 33691392"})
62
+ expect(response).to have_http_status(200)
62
63
  expect(assigns(:deploy).git_revision).to eq("c1a2b37")
63
64
  expect(assigns(:deploy).deployed_at).to eq("2009-02-03 03:00:00 -0500")
64
65
  expect(assigns(:deploy).repo_id).to eq(505050)
65
66
  expect(assigns(:deploy).user_id).to eq(202020)
66
- expect(response).to have_http_status(200)
67
67
  end
68
68
 
69
69
  it 'should create a deploy without a deployed_at because nil time turns into current time' do
@@ -112,8 +112,8 @@ module Hubstats
112
112
  it 'should update the teams in the database based on a given whitelist' do
113
113
  allow(Hubstats).to receive_message_chain(:config, :github_config, :[]).with("team_list") { ["Team One", "Team Two", "Team Three", "Team Four"] }
114
114
  allow(Hubstats::Team).to receive(:all).and_return( [team1, team2, team3, team4, team5] )
115
+ expect(team5).to receive(:update_column).with(:hubstats, false)
115
116
  subject.deprecate_teams_from_file
116
- expect(Hubstats::Team.where(name: "Team Five").first.hubstats).to eq(false)
117
117
  end
118
118
  end
119
119
 
@@ -53,12 +53,6 @@ module Dummy
53
53
  # like if you have constraints or database-specific column types
54
54
  # config.active_record.schema_format = :sql
55
55
 
56
- # Enforce whitelist mode for mass assignment.
57
- # This will create an empty whitelist of attributes available for mass-assignment for all models
58
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
59
- # parameters by using an attr_accessible or attr_protected declaration.
60
- config.active_record.whitelist_attributes = true
61
-
62
56
  # Enable the asset pipeline
63
57
  config.assets.enabled = true
64
58
 
@@ -5,9 +5,7 @@ Dummy::Application.configure do
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
8
+ config.eager_load = false
11
9
 
12
10
  # Show full error reports and disable caching
13
11
  config.consider_all_requests_local = true
@@ -22,13 +20,6 @@ Dummy::Application.configure do
22
20
  # Only use best-standards-support built into browsers
23
21
  config.action_dispatch.best_standards_support = :builtin
24
22
 
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
27
-
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
31
-
32
23
  # Do not compress assets
33
24
  config.assets.compress = false
34
25
 
@@ -3,13 +3,14 @@ Dummy::Application.configure do
3
3
 
4
4
  # Code is not reloaded between requests
5
5
  config.cache_classes = true
6
+ config.eager_load = false
6
7
 
7
8
  # Full error reports are disabled and caching is turned on
8
9
  config.consider_all_requests_local = false
9
10
  config.action_controller.perform_caching = true
10
11
 
11
12
  # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
+ config.serve_static_files = false
13
14
 
14
15
  # Compress JavaScripts and CSS
15
16
  config.assets.compress = true
@@ -54,9 +55,6 @@ Dummy::Application.configure do
54
55
  # Disable delivery errors, bad email addresses will be ignored
55
56
  # config.action_mailer.raise_delivery_errors = false
56
57
 
57
- # Enable threaded mode
58
- # config.threadsafe!
59
-
60
58
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
61
59
  # the I18n.default_locale when a translation can not be found)
62
60
  config.i18n.fallbacks = true
@@ -6,14 +6,12 @@ Dummy::Application.configure do
6
6
  # your test database is "scratch space" for the test suite and is wiped
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
+ config.eager_load = false
9
10
 
10
11
  # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
+ config.serve_static_files = true
12
13
  config.static_cache_control = "public, max-age=3600"
13
14
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
15
  # Show full error reports and disable caching
18
16
  config.consider_all_requests_local = true
19
17
  config.action_controller.perform_caching = false
@@ -29,9 +27,6 @@ Dummy::Application.configure do
29
27
  # ActionMailer::Base.deliveries array.
30
28
  config.action_mailer.delivery_method = :test
31
29
 
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
30
  # Print deprecation notices to the stderr
36
31
  config.active_support.deprecation = :stderr
37
32
  end
@@ -5,3 +5,4 @@
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
7
  Dummy::Application.config.secret_token = '8fc9a32d6e2d0d41ea3cd968e27cfee1e819a8516920a9cad3ec6a000ddfe8559a55752f9566d8cebba4466844e0790c0d664c2c989bb253925f4713ff2609f5'
8
+ Dummy::Application.config.secret_key_base = 'c598609edbe079079483ddc558a997ce28cc6ca3ae3d03a7332e2037292a4b99aeff5827c3f768995843ffbb94032b5b0852ff332f137aa1485c8c65773050eb'
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.6.0
4
+ version: 0.7.0
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: 2016-01-12 00:00:00.000000000 Z
12
+ date: 2016-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,154 +17,168 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 3.2.18
20
+ version: '4.2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 3.2.18
27
+ version: '4.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: octokit
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '4.0'
34
+ version: '4.2'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '4.0'
41
+ version: '4.2'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: will_paginate-bootstrap
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: '1.0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: '1.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: select2-rails
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '='
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 3.5.9
62
+ version: '3.0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '='
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 3.5.9
69
+ version: '3.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: sass-rails
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: bootstrap-datepicker-rails
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - "~>"
75
89
  - !ruby/object:Gem::Version
76
- version: 1.4.0
90
+ version: '1.5'
77
91
  type: :runtime
78
92
  prerelease: false
79
93
  version_requirements: !ruby/object:Gem::Requirement
80
94
  requirements:
81
95
  - - "~>"
82
96
  - !ruby/object:Gem::Version
83
- version: 1.4.0
97
+ version: '1.5'
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: mysql2
86
100
  requirement: !ruby/object:Gem::Requirement
87
101
  requirements:
88
102
  - - "~>"
89
103
  - !ruby/object:Gem::Version
90
- version: 0.3.20
104
+ version: 0.3.2
91
105
  type: :development
92
106
  prerelease: false
93
107
  version_requirements: !ruby/object:Gem::Requirement
94
108
  requirements:
95
109
  - - "~>"
96
110
  - !ruby/object:Gem::Version
97
- version: 0.3.20
111
+ version: 0.3.2
98
112
  - !ruby/object:Gem::Dependency
99
113
  name: rspec-rails
100
114
  requirement: !ruby/object:Gem::Requirement
101
115
  requirements:
102
116
  - - "~>"
103
117
  - !ruby/object:Gem::Version
104
- version: 3.0.0.beta
118
+ version: '3.4'
105
119
  type: :development
106
120
  prerelease: false
107
121
  version_requirements: !ruby/object:Gem::Requirement
108
122
  requirements:
109
123
  - - "~>"
110
124
  - !ruby/object:Gem::Version
111
- version: 3.0.0.beta
125
+ version: '3.4'
112
126
  - !ruby/object:Gem::Dependency
113
127
  name: shoulda-matchers
114
128
  requirement: !ruby/object:Gem::Requirement
115
129
  requirements:
116
130
  - - "~>"
117
131
  - !ruby/object:Gem::Version
118
- version: '2.6'
132
+ version: '2.8'
119
133
  type: :development
120
134
  prerelease: false
121
135
  version_requirements: !ruby/object:Gem::Requirement
122
136
  requirements:
123
137
  - - "~>"
124
138
  - !ruby/object:Gem::Version
125
- version: '2.6'
139
+ version: '2.8'
126
140
  - !ruby/object:Gem::Dependency
127
141
  name: factory_girl_rails
128
142
  requirement: !ruby/object:Gem::Requirement
129
143
  requirements:
130
144
  - - "~>"
131
145
  - !ruby/object:Gem::Version
132
- version: '4.4'
146
+ version: '4.5'
133
147
  type: :development
134
148
  prerelease: false
135
149
  version_requirements: !ruby/object:Gem::Requirement
136
150
  requirements:
137
151
  - - "~>"
138
152
  - !ruby/object:Gem::Version
139
- version: '4.4'
153
+ version: '4.5'
140
154
  - !ruby/object:Gem::Dependency
141
155
  name: faker
142
156
  requirement: !ruby/object:Gem::Requirement
143
157
  requirements:
144
158
  - - "~>"
145
159
  - !ruby/object:Gem::Version
146
- version: '1.3'
160
+ version: '1.6'
147
161
  type: :development
148
162
  prerelease: false
149
163
  version_requirements: !ruby/object:Gem::Requirement
150
164
  requirements:
151
165
  - - "~>"
152
166
  - !ruby/object:Gem::Version
153
- version: '1.3'
167
+ version: '1.6'
154
168
  - !ruby/object:Gem::Dependency
155
169
  name: test-unit
156
170
  requirement: !ruby/object:Gem::Requirement
157
171
  requirements:
158
172
  - - "~>"
159
173
  - !ruby/object:Gem::Version
160
- version: '3.0'
174
+ version: '3.1'
161
175
  type: :development
162
176
  prerelease: false
163
177
  version_requirements: !ruby/object:Gem::Requirement
164
178
  requirements:
165
179
  - - "~>"
166
180
  - !ruby/object:Gem::Version
167
- version: '3.0'
181
+ version: '3.1'
168
182
  description: Github Statistics
169
183
  email:
170
184
  - elliothursh@gmail.com
@@ -249,19 +263,19 @@ files:
249
263
  - app/views/hubstats/pull_requests/show.html.erb
250
264
  - app/views/hubstats/repos/index.html.erb
251
265
  - app/views/hubstats/repos/show.html.erb
252
- - app/views/hubstats/tables/_comments-condensed.html.erb
253
266
  - app/views/hubstats/tables/_comments.html.erb
254
- - app/views/hubstats/tables/_deploys-condensed.html.erb
267
+ - app/views/hubstats/tables/_comments_condensed.html.erb
255
268
  - app/views/hubstats/tables/_deploys.html.erb
269
+ - app/views/hubstats/tables/_deploys_condensed.html.erb
256
270
  - app/views/hubstats/tables/_grouped_deploys.html.erb
257
271
  - app/views/hubstats/tables/_grouped_pulls.html.erb
258
- - app/views/hubstats/tables/_pulls-condensed.html.erb
259
272
  - app/views/hubstats/tables/_pulls.html.erb
260
- - app/views/hubstats/tables/_repos-condensed.html.erb
273
+ - app/views/hubstats/tables/_pulls_condensed.html.erb
261
274
  - app/views/hubstats/tables/_repos.html.erb
275
+ - app/views/hubstats/tables/_repos_condensed.html.erb
262
276
  - app/views/hubstats/tables/_teams.html.erb
263
- - app/views/hubstats/tables/_users-condensed.html.erb
264
277
  - app/views/hubstats/tables/_users.html.erb
278
+ - app/views/hubstats/tables/_users_condensed.html.erb
265
279
  - app/views/hubstats/teams/index.html.erb
266
280
  - app/views/hubstats/teams/show.html.erb
267
281
  - app/views/hubstats/users/index.html.erb
@@ -381,7 +395,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
395
  version: '0'
382
396
  requirements: []
383
397
  rubyforge_project:
384
- rubygems_version: 2.4.8
398
+ rubygems_version: 2.4.6
385
399
  signing_key:
386
400
  specification_version: 4
387
401
  summary: Github Statistics