hubstats 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWYyZjlmNzg3MDZkYWMzYTMzYjliMDJmNTc2Mjc2YjgzNDRjZjJjZA==
4
+ M2JhYzkwN2YzYTZjMWJkZDA3N2JiMjI5MDFhM2VmNDg5ZjdjMjhhNQ==
5
5
  data.tar.gz: !binary |-
6
- NjA2ZTBlOTQyMjc1N2ViYTVlZjk4Zjg0ZjBhODk3NzAzMWQyYWRmNQ==
6
+ YmU5YWU3ZDllNzNjYjE3NDAxZWQ4YjRmZDFkOGM1ZTQ3NmVlNTJiOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjliZjUzOWNkNDlhNDY0ZTE0ZDRmMWZiY2M5ZTI1ZWM3NzNiZmE0OWNjOTlk
10
- MzJmNWM2OGRhNGU0MDAyMzdjNmE3YmM1ZTc2OGQ4YTNmOWZmN2ZiMGM5Y2Zi
11
- MmNiMjY1MTc3MTlmZGY4NzBhZTI4ZGYxYWY0ZmVjZDg3OGMwYTY=
9
+ NmM5NzFkOWFmOTI2NjA3MjE1YmU2NTE3MTI4NGY0NmY0NTI3ZDg4Mjg0OWVk
10
+ OGRhNWExNGQzYzVhYTRhMjE5YmM0MjdkNTUwYjNiNzUwZDYzNzdlMjIwMTUx
11
+ YmExOGNmZDdjNjQyN2JjZDgxYTUyNWVlZmJhNzA0NmMzOGIzY2M=
12
12
  data.tar.gz: !binary |-
13
- N2NhOWJkMjczNmYxNjFlNWY2YmRlZTVmZWUyZjdiZjUzYmZhN2NhZTcwYmI0
14
- NGUwM2E3NDEzMWE4ZDhjN2VjN2Y5YjMzMTIyOWQwYTkwMzZkZmIzNjg3YWQ2
15
- MmZmNjYxNTU0ZWJlM2JiMzRjZjJhMjdiN2U0MTQ3NzE4MTUyYmQ=
13
+ MWVkN2M1ZjZiZjNlMWM3ZGExNGJlNzMzNDMwMDNhYTQ2MDFlNDhkNDQxMDlm
14
+ N2QzNjg2YTU1ZmQ2YmU2ZDQyYmZkMWRiMGZmMjgwMWY5MWMzZjMwZDQ0MzNk
15
+ ODYwMjA0YTkyMzg1YjYwM2U4ZjMwOGI1ZGFiYTFjYmNjNzliYjQ=
@@ -9,9 +9,9 @@ module Hubstats
9
9
  user_count: Hubstats::User.with_pulls_or_comments(@timespan).only_active.length,
10
10
  pull_count: Hubstats::PullRequest.closed_since(@timespan).count(:all),
11
11
  comment_count: Hubstats::Comment.created_since(@timespan).count(:all),
12
- avg_additions: Hubstats::PullRequest.closed_since(@timespan).average(:additions).round.to_i,
13
- avg_deletions: Hubstats::PullRequest.closed_since(@timespan).average(:deletions).round.to_i,
14
- net_additions: Hubstats::PullRequest.closed_since(@timespan).sum(:additions).round.to_i - Hubstats::PullRequest.closed_since(@timespan).sum(:deletions).round.to_i
12
+ avg_additions: Hubstats::PullRequest.closed_since(@timespan).average(:additions).to_i,
13
+ avg_deletions: Hubstats::PullRequest.closed_since(@timespan).average(:deletions).to_i,
14
+ net_additions: Hubstats::PullRequest.closed_since(@timespan).sum(:additions).to_i - Hubstats::PullRequest.closed_since(@timespan).sum(:deletions).to_i
15
15
  }
16
16
  end
17
17
 
@@ -23,9 +23,9 @@ module Hubstats
23
23
  user_count: @users.length,
24
24
  pull_count: Hubstats::PullRequest.belonging_to_repo(@repo.id).closed_since(@timespan).count(:all),
25
25
  comment_count: Hubstats::Comment.belonging_to_repo(@repo.id).created_since(@timespan).count(:all),
26
- avg_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:additions).round.to_i,
27
- avg_deletions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:deletions).round.to_i,
28
- net_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).sum(:additions).round.to_i - Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).sum(:deletions).round.to_i
26
+ avg_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:additions).to_i,
27
+ avg_deletions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:deletions).to_i,
28
+ 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
29
29
  }
30
30
  end
31
31
  end
@@ -22,19 +22,67 @@ module Hubstats
22
22
  return ent
23
23
  end
24
24
 
25
- def self.pulls_since(repo_url, time, options={})
26
- options.reverse_merge!(:state => 'closed', :sort => 'created', :direction => 'desc', :per_page => 100)
27
- hub = client({:auto_paginate => true })
28
- hub.paginate(repo_url+'/pulls', :state => options[:state], :sort => options[:sort], :direction => options[:direction], :per_page => options[:per_page] ) do |data, last_response|
29
- while (last_response.rels[:next] && hub.rate_limit.remaining > 0)
30
- break if !last_response.data.detect{|v| v.closed_at.to_datetime > time.to_datetime}
31
- last_response = last_response.rels[:next].get
32
- data.concat(last_response.data) if last_response.data.is_a?(Array)
25
+ def self.inline(repo_name, kind, options={})
26
+ path = ["repos",repo_name,kind].join('/')
27
+ octo = client({:auto_paginate => true })
28
+ octo.paginate(path, options) do |data, last_response|
29
+ data.each{|v| route(v,kind,repo_name)}
30
+ data = last_response.data
31
+ wait_limit(1,octo.rate_limit)
32
+ end
33
+ end
34
+
35
+ def self.create_hook(repo)
36
+ begin
37
+ client.create_hook(
38
+ repo.full_name,
39
+ 'web',
40
+ {
41
+ :url => 'https://commissioner.sportngin.com/hubstats/handler',
42
+ :content_type => 'json'
43
+ },
44
+ {
45
+ :events => [
46
+ 'pull_request',
47
+ 'pull_request_review_comment',
48
+ 'commit_comment',
49
+ 'issues',
50
+ 'issue_comment',
51
+ 'member'
52
+ ],
53
+ :active => true
54
+ }
55
+ )
56
+
57
+ puts "Hook on #{repo.full_name} successfully created"
58
+ rescue Octokit::UnprocessableEntity
59
+ puts "Hook on #{repo.full_name} already existed"
60
+ end
61
+ end
62
+
63
+ def self.update_pulls
64
+ grab_size = 250
65
+ begin
66
+ while Hubstats::PullRequest.where(deletions: nil).where(additions: nil).count > 0
67
+ client = Hubstats::GithubAPI.client
68
+ incomplete = Hubstats::PullRequest.where(deletions: nil).where(additions: nil).limit(grab_size)
69
+
70
+ incomplete.each do |pull|
71
+ repo = Hubstats::Repo.where(id: pull.repo_id).first
72
+ pr = client.pull_request(repo.full_name, pull.number)
73
+ Hubstats::PullRequest.create_or_update(HubHelper.pull_setup(pr))
74
+ end
75
+
76
+ Hubstats::GithubAPI.wait_limit(grab_size,client.rate_limit)
33
77
  end
34
- return data.reject!{|v| v.closed_at.to_datetime < time.to_datetime }
78
+ puts "All Pull Requests are up to date"
79
+ rescue Faraday::ConnectionFailed
80
+ puts "Connection Timeout, restarting pull request updating"
81
+ update_pulls
35
82
  end
36
83
  end
37
84
 
85
+
38
86
  def self.wait_limit(grab_size,rate_limit)
39
87
  if rate_limit.remaining < grab_size
40
88
  puts "Hit Github rate limit, waiting #{Time.at(rate_limit.resets_in).utc.strftime("%H:%M:%S")} to get more"
@@ -42,19 +90,6 @@ module Hubstats
42
90
  end
43
91
  end
44
92
 
45
- def self.inline(repo_name, kind, options={})
46
- path = ["repos",repo_name].join('/')
47
- octo = client({:auto_paginate => true })
48
- octo.paginate([path,kind].join('/'), options) do |data, last_response|
49
- while (last_response.rels[:next])
50
- last_response = last_response.rels[:next].get
51
- data.concat(last_response.data) if last_response.data.is_a?(Array)
52
- data.map{|v| route(v,kind,repo_name)}.clear
53
- wait_limit(1,octo.rate_limit)
54
- end
55
- end.map{|v| route(v,kind,repo_name)}.clear
56
- end
57
-
58
93
  def self.route(object, kind, repo_name = nil)
59
94
  if kind == "pulls/comments"
60
95
  repo = Hubstats::Repo.where(full_name: repo_name).first
@@ -70,4 +105,5 @@ module Hubstats
70
105
  end
71
106
  end
72
107
  end
73
- end
108
+ end
109
+
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -3,19 +3,17 @@ namespace :hubstats do
3
3
 
4
4
  desc "Pull members from Github saves in database"
5
5
  task :users, [:repo] => :environment do |t, args|
6
- raise ArgumentError, "Must be called with repo argument. [:org/:repo]" if args[:repo].nil?
7
- repo = args[:repo]
8
- puts "Adding contributors to " + repo
6
+ repo = repo_checker(args[:repo])
7
+ puts "Adding contributors to " + repo.full_name
9
8
 
10
- Hubstats::GithubAPI.client({:auto_paginate => true}).contribs(args[:repo]).each do |contributor|
9
+ Hubstats::GithubAPI.client({:auto_paginate => true}).contribs(repo.full_name).each do |contributor|
11
10
  cont = Hubstats::User.create_or_update(contributor)
12
11
  end
13
12
  end
14
13
 
15
14
  desc "Pull comments from Github saves in database"
16
15
  task :comments, [:repo] => :environment do |t, args|
17
- raise ArgumentError, "Must be called with repo argument. [:org/:repo]" if args[:repo].nil?
18
- repo = Hubstats::Repo.where(full_name: args[:repo]).first
16
+ repo = repo_checker(args[:repo])
19
17
  puts "Adding comments to " + repo.full_name
20
18
 
21
19
  pull_comments = Hubstats::GithubAPI.inline(repo.full_name,'pulls/comments')
@@ -25,8 +23,7 @@ namespace :hubstats do
25
23
 
26
24
  desc "Pull pull requests from Github saves in database"
27
25
  task :pulls, [:repo] => :environment do |t, args|
28
- raise ArgumentError, "Must be called with repo argument. [:org/:repo]" if args[:repo].nil?
29
- repo = Hubstats::Repo.where(full_name: args[:repo]).first
26
+ repo = repo_checker(args[:repo])
30
27
  puts "Adding pulls to " + repo.full_name
31
28
 
32
29
  pull_requests = Hubstats::GithubAPI.inline(repo.full_name,'pulls', :state => "all")
@@ -34,34 +31,30 @@ namespace :hubstats do
34
31
 
35
32
  desc "Pull repos from Github save to database"
36
33
  task :all => :environment do
37
- client = Hubstats::GithubAPI.client({:auto_paginate => true})
38
34
  get_repos.each do |repo|
39
- re = Hubstats::Repo.create_or_update(repo)
35
+ repo = Hubstats::Repo.create_or_update(repo)
36
+ Hubstats::GithubAPI.create_hook(repo)
40
37
 
41
- Rake::Task["hubstats:populate:users"].execute({repo: "#{re.full_name}"})
42
- Rake::Task["hubstats:populate:pulls"].execute({repo: "#{re.full_name}"})
43
- Rake::Task["hubstats:populate:comments"].execute({repo: "#{re.full_name}"})
38
+ Rake::Task["hubstats:populate:users"].execute({repo: repo})
39
+ Rake::Task["hubstats:populate:pulls"].execute({repo: repo})
40
+ Rake::Task["hubstats:populate:comments"].execute({repo: repo})
44
41
  end
45
42
  puts "Finished with initial population, grabing extra info for pull requests"
46
- Rake::Task["hubstats:populate:update"].execute()
43
+ Rake::Task["hubstats:populate:update"].execute
47
44
  end
48
45
 
49
46
  desc "indivdually gets and updates pull requests"
50
47
  task :update => :environment do
51
- grab_size = 250
52
- while Hubstats::PullRequest.where(deletions: nil).where(additions: nil).count() > 0
53
- client = Hubstats::GithubAPI.client
54
- puts client.rate_limit.remaining
55
- incomplete = Hubstats::PullRequest.where(deletions: nil).where(additions: nil).limit(grab_size)
56
-
57
- incomplete.each do |pull|
58
- repo = Hubstats::Repo.where(id: pull.repo_id).first
59
- pr = client.pull_request(repo.full_name, pull.number)
60
- Hubstats::PullRequest.create_or_update(HubHelper.pull_setup(pr))
61
- end
48
+ Hubstats::GithubAPI.update_pulls
49
+ end
62
50
 
63
- Hubstats::GithubAPI.wait_limit(grab_size,client.rate_limit)
64
- end
51
+ def repo_checker(args)
52
+ raise ArgumentError, "Must be called with repo argument. [:org/:repo]" if args.nil?
53
+ if args.is_a? String
54
+ return Hubstats::Repo.where(full_name: args).first
55
+ else
56
+ return args
57
+ end
65
58
  end
66
59
 
67
60
  def get_repos
@@ -77,9 +70,4 @@ namespace :hubstats do
77
70
  repos
78
71
  end
79
72
  end
80
- end
81
-
82
- def pull_setup(pull_request)
83
- pull_request[:repository] = pull_request[:base][:repo]
84
- return pull_request
85
73
  end
@@ -5,4 +5,4 @@
5
5
 
6
6
  config: # Must include either org_name || repo_list
7
7
  # org_name: sportngin
8
- repo_list: ['sportngin/hubstats','sportngin/soyuz']
8
+ repo_list: ['sportngin/stat_ngin', 'sportngin/hubstats']
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20140702142617) do
14
+ ActiveRecord::Schema.define(:version => 20140604130550) do
15
15
 
16
16
  create_table "hubstats_comments", :force => true do |t|
17
17
  t.string "html_url"
Binary file
@@ -9076,3 +9076,142 @@ Connecting to database specified by database.yml
9076
9076
   (0.1ms) SAVEPOINT active_record_1
9077
9077
   (0.1ms) RELEASE SAVEPOINT active_record_1
9078
9078
   (0.5ms) ROLLBACK
9079
+ Connecting to database specified by database.yml
9080
+  (0.1ms) BEGIN
9081
+  (0.1ms) ROLLBACK
9082
+  (0.1ms) BEGIN
9083
+  (0.1ms) ROLLBACK
9084
+  (0.1ms) BEGIN
9085
+  (0.1ms) ROLLBACK
9086
+  (0.1ms) BEGIN
9087
+  (0.1ms) ROLLBACK
9088
+  (0.1ms) BEGIN
9089
+ Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
9090
+  (0.1ms) ROLLBACK
9091
+  (0.1ms) BEGIN
9092
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
9093
+  (0.1ms) ROLLBACK
9094
+  (0.1ms) BEGIN
9095
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
9096
+  (0.1ms) ROLLBACK
9097
+  (0.1ms) BEGIN
9098
+ Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
9099
+  (0.1ms) ROLLBACK
9100
+ Connecting to database specified by database.yml
9101
+  (0.1ms) BEGIN
9102
+ Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
9103
+  (0.1ms) ROLLBACK
9104
+  (0.1ms) BEGIN
9105
+ Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
9106
+  (0.1ms) ROLLBACK
9107
+  (0.1ms) BEGIN
9108
+  (0.1ms) ROLLBACK
9109
+  (0.1ms) BEGIN
9110
+  (0.1ms) ROLLBACK
9111
+  (0.1ms) BEGIN
9112
+  (0.1ms) ROLLBACK
9113
+  (0.1ms) BEGIN
9114
+  (0.1ms) ROLLBACK
9115
+  (0.1ms) BEGIN
9116
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
9117
+  (0.1ms) ROLLBACK
9118
+  (0.1ms) BEGIN
9119
+ Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
9120
+  (0.1ms) ROLLBACK
9121
+ Connecting to database specified by database.yml
9122
+  (0.1ms) BEGIN
9123
+ Hubstats::User Load (0.2ms) SELECT `hubstats_users`.* FROM `hubstats_users`
9124
+ Hubstats::User Load (0.3ms) SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
9125
+  (0.1ms) SAVEPOINT active_record_1
9126
+ Hubstats::User Exists (0.2ms) SELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1
9127
+ SQL (0.2ms) INSERT INTO `hubstats_users` (`avatar_url`, `created_at`, `events_url`, `followers_url`, `following_url`, `gists_url`, `gravatar_id`, `html_url`, `id`, `login`, `organizations_url`, `received_events_url`, `repos_url`, `role`, `site_admin`, `starred_url`, `subscriptions_url`, `updated_at`, `url`) VALUES (NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, NULL, NULL, NULL, 10, 'elliothursh', NULL, NULL, NULL, 'User', NULL, NULL, NULL, '2014-07-02 20:41:59', NULL)
9128
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9129
+  (0.1ms) SAVEPOINT active_record_1
9130
+ Hubstats::User Exists (0.2ms) SELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1
9131
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9132
+ Hubstats::User Load (0.2ms) SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
9133
+  (0.1ms) SAVEPOINT active_record_1
9134
+ 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
9135
+  (0.2ms) UPDATE `hubstats_users` SET `login` = 'johnappleseed', `updated_at` = '2014-07-02 20:41:59' WHERE `hubstats_users`.`id` = 10
9136
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9137
+  (0.7ms) ROLLBACK
9138
+  (0.1ms) BEGIN
9139
+ Hubstats::User Load (0.2ms) SELECT `hubstats_users`.* FROM `hubstats_users`
9140
+ Hubstats::User Load (0.2ms) SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
9141
+  (0.1ms) SAVEPOINT active_record_1
9142
+ Hubstats::User Exists (0.1ms) SELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1
9143
+ SQL (0.2ms) INSERT INTO `hubstats_users` (`avatar_url`, `created_at`, `events_url`, `followers_url`, `following_url`, `gists_url`, `gravatar_id`, `html_url`, `id`, `login`, `organizations_url`, `received_events_url`, `repos_url`, `role`, `site_admin`, `starred_url`, `subscriptions_url`, `updated_at`, `url`) VALUES (NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, NULL, NULL, NULL, 10, 'elliothursh', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', NULL)
9144
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9145
+  (0.1ms) SAVEPOINT active_record_1
9146
+ 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
9147
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9148
+  (0.4ms) ROLLBACK
9149
+  (0.0ms) BEGIN
9150
+ Hubstats::Repo Load (0.2ms) SELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1
9151
+  (0.1ms) SAVEPOINT active_record_1
9152
+ SQL (0.3ms) INSERT INTO `hubstats_repos` (`clone_url`, `contributors_url`, `created_at`, `default_branch`, `description`, `events_url`, `fork`, `forks_count`, `full_name`, `git_commits_url`, `git_url`, `has_downloads`, `has_issues`, `has_wiki`, `homepage`, `hooks_url`, `html_url`, `id`, `issue_comment_url`, `issue_events_url`, `issues_url`, `labels_url`, `language`, `merges_url`, `mirror_url`, `name`, `open_issues_count`, `owner_id`, `private`, `pulls_url`, `pushed_at`, `size`, `ssh_url`, `stargazers_count`, `svn_url`, `updated_at`, `url`, `watches_count`) VALUES (NULL, NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 151, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HellWorld', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', NULL, NULL)
9153
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9154
+  (0.1ms) SAVEPOINT active_record_1
9155
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9156
+ Hubstats::User Load (0.2ms) SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
9157
+  (0.1ms) SAVEPOINT active_record_1
9158
+ Hubstats::User Exists (0.2ms) SELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1
9159
+ SQL (0.2ms) INSERT INTO `hubstats_users` (`avatar_url`, `created_at`, `events_url`, `followers_url`, `following_url`, `gists_url`, `gravatar_id`, `html_url`, `id`, `login`, `organizations_url`, `received_events_url`, `repos_url`, `role`, `site_admin`, `starred_url`, `subscriptions_url`, `updated_at`, `url`) VALUES (NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, NULL, NULL, NULL, 10, 'elliothursh', NULL, NULL, NULL, 'User', NULL, NULL, NULL, '2014-07-02 20:41:59', NULL)
9160
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9161
+  (0.1ms) SAVEPOINT active_record_1
9162
+ Hubstats::User Exists (0.2ms) SELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1
9163
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9164
+ Hubstats::Repo Load (0.2ms) SELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1
9165
+  (0.1ms) SAVEPOINT active_record_1
9166
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9167
+ Hubstats::PullRequest Load (0.2ms) SELECT `hubstats_pull_requests`.* FROM `hubstats_pull_requests` WHERE `hubstats_pull_requests`.`id` = 100 LIMIT 1
9168
+  (0.1ms) SAVEPOINT active_record_1
9169
+ SQL (24.3ms) INSERT INTO `hubstats_pull_requests` (`additions`, `body`, `changed_files`, `closed_at`, `comments`, `comments_url`, `commits`, `commits_url`, `created_at`, `deletions`, `diff_url`, `html_url`, `id`, `issue_url`, `merge_commit_sha`, `mergeable`, `merged`, `merged_at`, `number`, `patch_url`, `repo_id`, `review_comment_url`, `review_comments_url`, `state`, `statuses_url`, `title`, `updated_at`, `url`, `user_id`) VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 151, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', NULL, 10)
9170
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9171
+  (0.1ms) SAVEPOINT active_record_1
9172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9173
+  (0.6ms) ROLLBACK
9174
+  (0.1ms) BEGIN
9175
+ Hubstats::Repo Load (0.2ms) SELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1
9176
+  (0.1ms) SAVEPOINT active_record_1
9177
+ SQL (0.2ms) INSERT INTO `hubstats_repos` (`clone_url`, `contributors_url`, `created_at`, `default_branch`, `description`, `events_url`, `fork`, `forks_count`, `full_name`, `git_commits_url`, `git_url`, `has_downloads`, `has_issues`, `has_wiki`, `homepage`, `hooks_url`, `html_url`, `id`, `issue_comment_url`, `issue_events_url`, `issues_url`, `labels_url`, `language`, `merges_url`, `mirror_url`, `name`, `open_issues_count`, `owner_id`, `private`, `pulls_url`, `pushed_at`, `size`, `ssh_url`, `stargazers_count`, `svn_url`, `updated_at`, `url`, `watches_count`) VALUES (NULL, NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 151, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HellWorld', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', NULL, NULL)
9178
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9179
+  (0.1ms) SAVEPOINT active_record_1
9180
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9181
+ Hubstats::User Load (0.1ms) SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
9182
+  (0.0ms) SAVEPOINT active_record_1
9183
+ Hubstats::User Exists (0.1ms) SELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1
9184
+ SQL (0.2ms) INSERT INTO `hubstats_users` (`avatar_url`, `created_at`, `events_url`, `followers_url`, `following_url`, `gists_url`, `gravatar_id`, `html_url`, `id`, `login`, `organizations_url`, `received_events_url`, `repos_url`, `role`, `site_admin`, `starred_url`, `subscriptions_url`, `updated_at`, `url`) VALUES (NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, NULL, NULL, NULL, 10, 'elliothursh', NULL, NULL, NULL, 'User', NULL, NULL, NULL, '2014-07-02 20:41:59', NULL)
9185
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9186
+  (0.0ms) SAVEPOINT active_record_1
9187
+ Hubstats::User Exists (0.2ms) SELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1
9188
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9189
+ Hubstats::Repo Load (0.2ms) SELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1
9190
+  (0.0ms) SAVEPOINT active_record_1
9191
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9192
+ Hubstats::PullRequest Load (0.1ms) SELECT `hubstats_pull_requests`.* FROM `hubstats_pull_requests` WHERE `hubstats_pull_requests`.`id` = 1000 LIMIT 1
9193
+  (0.0ms) SAVEPOINT active_record_1
9194
+ SQL (0.2ms) INSERT INTO `hubstats_pull_requests` (`additions`, `body`, `changed_files`, `closed_at`, `comments`, `comments_url`, `commits`, `commits_url`, `created_at`, `deletions`, `diff_url`, `html_url`, `id`, `issue_url`, `merge_commit_sha`, `mergeable`, `merged`, `merged_at`, `number`, `patch_url`, `repo_id`, `review_comment_url`, `review_comments_url`, `state`, `statuses_url`, `title`, `updated_at`, `url`, `user_id`) VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 151, NULL, NULL, NULL, NULL, NULL, '2014-07-02 20:41:59', 'www.pull.com', 10)
9195
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9196
+  (0.0ms) SAVEPOINT active_record_1
9197
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9198
+ Hubstats::User Load (0.1ms) SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
9199
+  (0.0ms) SAVEPOINT active_record_1
9200
+ 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
9201
+  (0.1ms) UPDATE `hubstats_users` SET `role` = NULL, `updated_at` = '2014-07-02 20:41:59' WHERE `hubstats_users`.`id` = 10
9202
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9203
+ Hubstats::Comment Load (0.1ms) SELECT `hubstats_comments`.* FROM `hubstats_comments` WHERE `hubstats_comments`.`id` = 100 LIMIT 1
9204
+  (0.1ms) SAVEPOINT active_record_1
9205
+ SQL (0.2ms) INSERT INTO `hubstats_comments` (`body`, `commit_id`, `created_at`, `diff_hunk`, `html_url`, `id`, `kind`, `line`, `original_commit_id`, `original_position`, `path`, `position`, `pull_request_id`, `pull_request_url`, `repo_id`, `updated_at`, `url`, `user_id`) VALUES (NULL, NULL, '2014-07-02 20:41:59', NULL, NULL, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'www.pull.com', NULL, '2014-07-02 20:41:59', NULL, 10)
9206
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9207
+  (0.1ms) SAVEPOINT active_record_1
9208
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9209
+  (0.7ms) ROLLBACK
9210
+  (0.1ms) BEGIN
9211
+  (0.1ms) ROLLBACK
9212
+  (0.1ms) BEGIN
9213
+  (0.1ms) ROLLBACK
9214
+  (0.1ms) BEGIN
9215
+  (0.1ms) ROLLBACK
9216
+  (0.1ms) BEGIN
9217
+  (0.1ms) ROLLBACK
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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Hursh
@@ -175,10 +175,6 @@ files:
175
175
  - test/dummy/config/octokit.yml
176
176
  - test/dummy/config/routes.rb
177
177
  - test/dummy/db/development.sqlite3
178
- - test/dummy/db/migrate/20140702142614_create_hubstats_pull_requests.hubstats.rb
179
- - test/dummy/db/migrate/20140702142615_create_hubstats_users.hubstats.rb
180
- - test/dummy/db/migrate/20140702142616_create_hubstats_comments.hubstats.rb
181
- - test/dummy/db/migrate/20140702142617_create_hubstats_repos.hubstats.rb
182
178
  - test/dummy/db/schema.rb
183
179
  - test/dummy/db/test.sqlite3
184
180
  - test/dummy/log/development.log
@@ -386,10 +382,6 @@ test_files:
386
382
  - test/dummy/config/routes.rb
387
383
  - test/dummy/config.ru
388
384
  - test/dummy/db/development.sqlite3
389
- - test/dummy/db/migrate/20140702142614_create_hubstats_pull_requests.hubstats.rb
390
- - test/dummy/db/migrate/20140702142615_create_hubstats_users.hubstats.rb
391
- - test/dummy/db/migrate/20140702142616_create_hubstats_comments.hubstats.rb
392
- - test/dummy/db/migrate/20140702142617_create_hubstats_repos.hubstats.rb
393
385
  - test/dummy/db/schema.rb
394
386
  - test/dummy/db/test.sqlite3
395
387
  - test/dummy/log/development.log
@@ -1,40 +0,0 @@
1
- # This migration comes from hubstats (originally 20140604130339)
2
- class CreateHubstatsPullRequests < ActiveRecord::Migration
3
- def change
4
- create_table :hubstats_pull_requests do |t|
5
- t.integer :id
6
- t.string :url
7
- t.string :html_url
8
- t.string :diff_url
9
- t.string :patch_url
10
- t.string :issue_url
11
- t.string :commits_url
12
- t.string :review_comments_url
13
- t.string :review_comment_url
14
- t.string :comments_url
15
- t.string :statuses_url
16
- t.integer :number
17
- t.string :state
18
- t.string :title
19
- t.string :body
20
- t.string :created_at
21
- t.string :updated_at
22
- t.string :closed_at
23
- t.string :merged_at
24
- t.string :merge_commit_sha
25
- t.string :merged
26
- t.string :mergeable
27
- t.integer :comments
28
- t.integer :commits
29
- t.integer :additions
30
- t.integer :deletions
31
- t.integer :changed_files
32
- t.belongs_to :user
33
- t.belongs_to :repo
34
- t.timestamps
35
- end
36
-
37
- add_index :hubstats_pull_requests, :user_id
38
- add_index :hubstats_pull_requests, :repo_id
39
- end
40
- end
@@ -1,25 +0,0 @@
1
- # This migration comes from hubstats (originally 20140604130457)
2
- class CreateHubstatsUsers < ActiveRecord::Migration
3
- def change
4
- create_table :hubstats_users do |t|
5
- t.string :login
6
- t.integer :id
7
- t.string :avatar_url
8
- t.string :gravatar_id
9
- t.string :url
10
- t.string :html_url
11
- t.string :followers_url
12
- t.string :following_url
13
- t.string :gists_url
14
- t.string :starred_url
15
- t.string :subscriptions_url
16
- t.string :organizations_url
17
- t.string :repos_url
18
- t.string :events_url
19
- t.string :received_events_url
20
- t.string :role
21
- t.boolean :site_admin
22
- t.timestamps
23
- end
24
- end
25
- end
@@ -1,27 +0,0 @@
1
- # This migration comes from hubstats (originally 20140604130504)
2
- class CreateHubstatsComments < ActiveRecord::Migration
3
- def change
4
- create_table :hubstats_comments do |t|
5
- t.integer :id
6
- t.string :html_url
7
- t.string :url
8
- t.string :pull_request_url
9
- t.string :diff_hunk
10
- t.integer :path
11
- t.integer :position
12
- t.string :original_position
13
- t.string :line
14
- t.string :commit_id
15
- t.string :original_commit_id
16
- t.string :body
17
- t.string :kind
18
- t.belongs_to :user
19
- t.belongs_to :pull_request
20
- t.belongs_to :repo
21
- t.timestamps
22
- end
23
-
24
- add_index :hubstats_comments, :user_id
25
- add_index :hubstats_comments, :pull_request_id
26
- end
27
- end
@@ -1,48 +0,0 @@
1
- # This migration comes from hubstats (originally 20140604130550)
2
- class CreateHubstatsRepos < ActiveRecord::Migration
3
- def change
4
- create_table :hubstats_repos do |t|
5
- t.integer :id
6
- t.string :name
7
- t.string :full_name
8
- t.string :homepage
9
- t.string :language
10
- t.string :description
11
- t.string :default_branch
12
- t.string :url
13
- t.string :html_url
14
- t.string :clone_url
15
- t.string :git_url
16
- t.string :ssh_url
17
- t.string :svn_url
18
- t.string :mirror_url
19
- t.string :hooks_url
20
- t.string :issue_events_url
21
- t.string :events_url
22
- t.string :contributors_url
23
- t.string :git_commits_url
24
- t.string :issue_comment_url
25
- t.string :merges_url
26
- t.string :issues_url
27
- t.string :pulls_url
28
- t.string :labels_url
29
- t.integer :forks_count
30
- t.integer :stargazers_count
31
- t.integer :watches_count
32
- t.integer :size
33
- t.integer :open_issues_count
34
- t.boolean :has_issues
35
- t.boolean :has_wiki
36
- t.boolean :has_downloads
37
- t.boolean :private
38
- t.boolean :fork
39
- t.datetime :pushed_at
40
- t.datetime :created_at
41
- t.datetime :updated_at
42
- t.belongs_to :owner
43
- t.timestamps
44
- end
45
-
46
- add_index :hubstats_repos, :owner_id
47
- end
48
- end