hubstats 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/app/controllers/hubstats/repos_controller.rb +6 -6
- data/lib/hubstats/github_api.rb +59 -23
- data/lib/hubstats/version.rb +1 -1
- data/lib/tasks/populate_task.rake +20 -32
- data/test/dummy/config/octokit.yml +1 -1
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/test.log +139 -0
- metadata +1 -9
- data/test/dummy/db/migrate/20140702142614_create_hubstats_pull_requests.hubstats.rb +0 -40
- data/test/dummy/db/migrate/20140702142615_create_hubstats_users.hubstats.rb +0 -25
- data/test/dummy/db/migrate/20140702142616_create_hubstats_comments.hubstats.rb +0 -27
- data/test/dummy/db/migrate/20140702142617_create_hubstats_repos.hubstats.rb +0 -48
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2JhYzkwN2YzYTZjMWJkZDA3N2JiMjI5MDFhM2VmNDg5ZjdjMjhhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmU5YWU3ZDllNzNjYjE3NDAxZWQ4YjRmZDFkOGM1ZTQ3NmVlNTJiOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmM5NzFkOWFmOTI2NjA3MjE1YmU2NTE3MTI4NGY0NmY0NTI3ZDg4Mjg0OWVk
|
10
|
+
OGRhNWExNGQzYzVhYTRhMjE5YmM0MjdkNTUwYjNiNzUwZDYzNzdlMjIwMTUx
|
11
|
+
YmExOGNmZDdjNjQyN2JjZDgxYTUyNWVlZmJhNzA0NmMzOGIzY2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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).
|
13
|
-
avg_deletions: Hubstats::PullRequest.closed_since(@timespan).average(:deletions).
|
14
|
-
net_additions: Hubstats::PullRequest.closed_since(@timespan).sum(:additions).
|
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).
|
27
|
-
avg_deletions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).average(:deletions).
|
28
|
-
net_additions: Hubstats::PullRequest.closed_since(@timespan).belonging_to_repo(@repo.id).sum(:additions).
|
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
|
data/lib/hubstats/github_api.rb
CHANGED
@@ -22,19 +22,67 @@ module Hubstats
|
|
22
22
|
return ent
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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
|
+
|
data/lib/hubstats/version.rb
CHANGED
@@ -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
|
-
|
7
|
-
|
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(
|
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
|
-
|
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
|
-
|
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
|
-
|
35
|
+
repo = Hubstats::Repo.create_or_update(repo)
|
36
|
+
Hubstats::GithubAPI.create_hook(repo)
|
40
37
|
|
41
|
-
Rake::Task["hubstats:populate:users"].execute({repo:
|
42
|
-
Rake::Task["hubstats:populate:pulls"].execute({repo:
|
43
|
-
Rake::Task["hubstats:populate:comments"].execute({repo:
|
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
|
-
|
52
|
-
|
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
|
-
|
64
|
-
|
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
|
data/test/dummy/db/schema.rb
CHANGED
@@ -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 =>
|
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
|
data/test/dummy/log/test.log
CHANGED
@@ -9076,3 +9076,142 @@ Connecting to database specified by database.yml
|
|
9076
9076
|
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9077
9077
|
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9078
9078
|
[1m[35m (0.5ms)[0m ROLLBACK
|
9079
|
+
Connecting to database specified by database.yml
|
9080
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9081
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9082
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9083
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9084
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9085
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9086
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9087
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9088
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9089
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
|
9090
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9091
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9092
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
|
9093
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9094
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9095
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
|
9096
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9097
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9098
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
|
9099
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9100
|
+
Connecting to database specified by database.yml
|
9101
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9102
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
|
9103
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9104
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9105
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_repos' doesn't exist: SHOW FULL FIELDS FROM `hubstats_repos`
|
9106
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9107
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9108
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9109
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9110
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9111
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9112
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9113
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9114
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9115
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9116
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
|
9117
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9118
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9119
|
+
Mysql2::Error: Table 'hubstats_test.hubstats_users' doesn't exist: SHOW FULL FIELDS FROM `hubstats_users`
|
9120
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9121
|
+
Connecting to database specified by database.yml
|
9122
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9123
|
+
[1m[35mHubstats::User Load (0.2ms)[0m SELECT `hubstats_users`.* FROM `hubstats_users`
|
9124
|
+
[1m[36mHubstats::User Load (0.3ms)[0m [1mSELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1[0m
|
9125
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9126
|
+
[1m[36mHubstats::User Exists (0.2ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1[0m
|
9127
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9129
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9130
|
+
[1m[36mHubstats::User Exists (0.2ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1[0m
|
9131
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9132
|
+
[1m[36mHubstats::User Load (0.2ms)[0m [1mSELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1[0m
|
9133
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9134
|
+
[1m[36mHubstats::User Exists (0.1ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1[0m
|
9135
|
+
[1m[35m (0.2ms)[0m UPDATE `hubstats_users` SET `login` = 'johnappleseed', `updated_at` = '2014-07-02 20:41:59' WHERE `hubstats_users`.`id` = 10
|
9136
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9137
|
+
[1m[35m (0.7ms)[0m ROLLBACK
|
9138
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9139
|
+
[1m[35mHubstats::User Load (0.2ms)[0m SELECT `hubstats_users`.* FROM `hubstats_users`
|
9140
|
+
[1m[36mHubstats::User Load (0.2ms)[0m [1mSELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1[0m
|
9141
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9142
|
+
[1m[36mHubstats::User Exists (0.1ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1[0m
|
9143
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9145
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9146
|
+
[1m[36mHubstats::User Exists (0.1ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1[0m
|
9147
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9148
|
+
[1m[36m (0.4ms)[0m [1mROLLBACK[0m
|
9149
|
+
[1m[35m (0.0ms)[0m BEGIN
|
9150
|
+
[1m[36mHubstats::Repo Load (0.2ms)[0m [1mSELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1[0m
|
9151
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9152
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT 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)[0m
|
9153
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9154
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
9155
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9156
|
+
[1m[36mHubstats::User Load (0.2ms)[0m [1mSELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1[0m
|
9157
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9158
|
+
[1m[36mHubstats::User Exists (0.2ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1[0m
|
9159
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9161
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9162
|
+
[1m[36mHubstats::User Exists (0.2ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1[0m
|
9163
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9164
|
+
[1m[36mHubstats::Repo Load (0.2ms)[0m [1mSELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1[0m
|
9165
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9166
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9167
|
+
[1m[35mHubstats::PullRequest Load (0.2ms)[0m SELECT `hubstats_pull_requests`.* FROM `hubstats_pull_requests` WHERE `hubstats_pull_requests`.`id` = 100 LIMIT 1
|
9168
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
9169
|
+
[1m[35mSQL (24.3ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9171
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9172
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9173
|
+
[1m[35m (0.6ms)[0m ROLLBACK
|
9174
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9175
|
+
[1m[35mHubstats::Repo Load (0.2ms)[0m SELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1
|
9176
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
9177
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9179
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9180
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9181
|
+
[1m[35mHubstats::User Load (0.1ms)[0m SELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1
|
9182
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
9183
|
+
[1m[35mHubstats::User Exists (0.1ms)[0m SELECT 1 AS one FROM `hubstats_users` WHERE `hubstats_users`.`id` = BINARY 10 LIMIT 1
|
9184
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT 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)[0m
|
9185
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9186
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
9187
|
+
[1m[35mHubstats::User Exists (0.2ms)[0m SELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1
|
9188
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9189
|
+
[1m[35mHubstats::Repo Load (0.2ms)[0m SELECT `hubstats_repos`.* FROM `hubstats_repos` WHERE `hubstats_repos`.`id` = 151 LIMIT 1
|
9190
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
9191
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9192
|
+
[1m[36mHubstats::PullRequest Load (0.1ms)[0m [1mSELECT `hubstats_pull_requests`.* FROM `hubstats_pull_requests` WHERE `hubstats_pull_requests`.`id` = 1000 LIMIT 1[0m
|
9193
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
9194
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT 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)[0m
|
9195
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
9196
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
9197
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
9198
|
+
[1m[36mHubstats::User Load (0.1ms)[0m [1mSELECT `hubstats_users`.* FROM `hubstats_users` WHERE `hubstats_users`.`id` = 10 LIMIT 1[0m
|
9199
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
9200
|
+
[1m[36mHubstats::User Exists (0.1ms)[0m [1mSELECT 1 AS one FROM `hubstats_users` WHERE (`hubstats_users`.`id` = BINARY 10 AND `hubstats_users`.`id` != 10) LIMIT 1[0m
|
9201
|
+
[1m[35m (0.1ms)[0m UPDATE `hubstats_users` SET `role` = NULL, `updated_at` = '2014-07-02 20:41:59' WHERE `hubstats_users`.`id` = 10
|
9202
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9203
|
+
[1m[35mHubstats::Comment Load (0.1ms)[0m SELECT `hubstats_comments`.* FROM `hubstats_comments` WHERE `hubstats_comments`.`id` = 100 LIMIT 1
|
9204
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
9205
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9207
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
9208
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
9209
|
+
[1m[35m (0.7ms)[0m ROLLBACK
|
9210
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9211
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9212
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9213
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9214
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9215
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
9216
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
9217
|
+
[1m[35m (0.1ms)[0m 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.
|
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
|