vx-service_connector 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +8 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +10 -0
  9. data/lib/vx/service_connector.rb +37 -0
  10. data/lib/vx/service_connector/base.rb +27 -0
  11. data/lib/vx/service_connector/github.rb +49 -0
  12. data/lib/vx/service_connector/github/commits.rb +33 -0
  13. data/lib/vx/service_connector/github/deploy_keys.rb +29 -0
  14. data/lib/vx/service_connector/github/files.rb +21 -0
  15. data/lib/vx/service_connector/github/hooks.rb +33 -0
  16. data/lib/vx/service_connector/github/notices.rb +40 -0
  17. data/lib/vx/service_connector/github/payload.rb +124 -0
  18. data/lib/vx/service_connector/github/repos.rb +52 -0
  19. data/lib/vx/service_connector/gitlab_v3.rb +29 -0
  20. data/lib/vx/service_connector/gitlab_v3/deploy_keys.rb +20 -0
  21. data/lib/vx/service_connector/gitlab_v3/repos.rb +28 -0
  22. data/lib/vx/service_connector/model.rb +82 -0
  23. data/lib/vx/service_connector/version.rb +5 -0
  24. data/spec/fixtures/github/add_deploy_key.json +6 -0
  25. data/spec/fixtures/github/commit.json +83 -0
  26. data/spec/fixtures/github/create_hook.json +12 -0
  27. data/spec/fixtures/github/create_status.json +5 -0
  28. data/spec/fixtures/github/deploy_keys.json +8 -0
  29. data/spec/fixtures/github/hooks.json +18 -0
  30. data/spec/fixtures/github/org_repos.json +51 -0
  31. data/spec/fixtures/github/orgs.json +8 -0
  32. data/spec/fixtures/github/payload/closed_pull_request.json +392 -0
  33. data/spec/fixtures/github/payload/foreign_pull_request.json +1 -0
  34. data/spec/fixtures/github/payload/pull_request.json +392 -0
  35. data/spec/fixtures/github/payload/push.json +92 -0
  36. data/spec/fixtures/github/payload/push_tag.json +135 -0
  37. data/spec/fixtures/github/user_repos.json +48 -0
  38. data/spec/fixtures/gitlab_v3/deploy_keys.json +14 -0
  39. data/spec/fixtures/gitlab_v3/projects.json +72 -0
  40. data/spec/lib/github_payload_spec.rb +136 -0
  41. data/spec/lib/github_spec.rb +159 -0
  42. data/spec/lib/gitlab_v3_spec.rb +44 -0
  43. data/spec/lib/model_spec.rb +37 -0
  44. data/spec/lib/service_connector_spec.rb +30 -0
  45. data/spec/spec_helper.rb +14 -0
  46. data/spec/support/create.rb +6 -0
  47. data/spec/support/github_web_mocks.rb +101 -0
  48. data/spec/support/gitlab_v3_mocks.rb +29 -0
  49. data/spec/support/read_fixture.rb +12 -0
  50. data/vx-service_connector.gemspec +28 -0
  51. metadata +203 -0
@@ -0,0 +1,52 @@
1
+ module Vx
2
+ module ServiceConnector
3
+ class Github
4
+ class Repos
5
+ attr_reader :session
6
+
7
+ def initialize(session)
8
+ @session = session
9
+ end
10
+
11
+ def to_a
12
+ @repos ||= (user_repositories + organization_repositories)
13
+ end
14
+
15
+ def organizations
16
+ session.organizations.map(&:login) || []
17
+ end
18
+
19
+ def organization_repositories
20
+ organizations.map do |org|
21
+ Thread.new do
22
+ session
23
+ .organization_repositories(org)
24
+ .select { |repo| repo.permissions && repo.permissions.admin }
25
+ .map { |repo| repo_to_model repo }
26
+ end.tap do |th|
27
+ th.abort_on_exception = true
28
+ end
29
+ end.map(&:value).flatten
30
+ end
31
+
32
+ def user_repositories
33
+ session.repositories.map do |repo|
34
+ repo_to_model repo
35
+ end
36
+ end
37
+
38
+ def repo_to_model(repo)
39
+ Model::Repo.new(
40
+ repo.id,
41
+ repo.full_name,
42
+ repo.private,
43
+ repo.rels[:ssh].href,
44
+ repo.rels[:html].href,
45
+ repo.description
46
+ )
47
+ end
48
+
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,29 @@
1
+ require 'gitlab'
2
+
3
+ module Vx
4
+ module ServiceConnector
5
+ GitlabV3 = Struct.new(:endpoint, :private_token) do
6
+
7
+ include ServiceConnector::Base
8
+
9
+ def repos
10
+ @repos ||= GitlabV3::Repos.new(session).to_a
11
+ end
12
+
13
+ def deploy_keys(repo)
14
+ GitlabV3::DeployKeys.new(session, repo)
15
+ end
16
+
17
+ private
18
+
19
+ def create_session
20
+ ::Gitlab.client(:endpoint => "#{endpoint}/api/v3", private_token: private_token)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+
27
+ %w{ repos deploy_keys }.each do |f|
28
+ require File.expand_path("../gitlab_v3/#{f}", __FILE__)
29
+ end
@@ -0,0 +1,20 @@
1
+ module Vx
2
+ module ServiceConnector
3
+ class GitlabV3
4
+ DeployKeys = Struct.new(:session, :repo) do
5
+
6
+ def all
7
+ session.deploy_keys(repo.id)
8
+ end
9
+
10
+ def add(key_name, public_key)
11
+ session.create_deploy_key(repo.id, key_name, public_key)
12
+ end
13
+
14
+ def remove(key_name)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
@@ -0,0 +1,28 @@
1
+ module Vx
2
+ module ServiceConnector
3
+ class GitlabV3
4
+ Repos = Struct.new(:session) do
5
+
6
+ def to_a
7
+ session.projects.map do |proj|
8
+ proj_to_model proj
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def proj_to_model(repo)
15
+ Model::Repo.new(
16
+ repo.id,
17
+ repo.path_with_namespace,
18
+ true,
19
+ repo.ssh_url_to_repo,
20
+ repo.web_url,
21
+ repo.description
22
+ )
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,82 @@
1
+ module Vx
2
+ module ServiceConnector
3
+ module Model
4
+
5
+ Repo = Struct.new(
6
+ :id,
7
+ :full_name,
8
+ :is_private,
9
+ :ssh_url,
10
+ :html_url,
11
+ :description
12
+ )
13
+
14
+ Payload = Struct.new(
15
+ :pull_request?,
16
+ :pull_request_number,
17
+ :head,
18
+ :base,
19
+ :branch,
20
+ :branch_label,
21
+ :url,
22
+ :ignore?
23
+ ) do
24
+ def to_hash ; to_h end
25
+
26
+ class << self
27
+ def from_hash(params)
28
+ payload = Payload.new
29
+ payload.members.each do |m|
30
+ payload[m] = params.key?(m) ? params[m] : params[m.to_s]
31
+ end
32
+ payload
33
+ end
34
+ end
35
+ end
36
+
37
+ Commit = Struct.new(
38
+ :sha,
39
+ :message,
40
+ :author,
41
+ :author_email,
42
+ :http_url
43
+ )
44
+
45
+ extend self
46
+
47
+ def test_payload_attributes(params = {})
48
+ {
49
+ pull_request?: false,
50
+ pull_request_number: nil,
51
+ head: "HEAD",
52
+ base: '0000',
53
+ branch: 'master',
54
+ branch_label: 'master:label',
55
+ url: 'http://example.com',
56
+ ignore?: false
57
+ }.merge(params)
58
+ end
59
+
60
+ def test_payload(params = {})
61
+ Payload.from_hash(test_payload_attributes params)
62
+ end
63
+
64
+ def test_commit
65
+ Commit.new('sha', 'message', 'author', 'author_email', 'http_url')
66
+ end
67
+
68
+ def test_repo
69
+ Repo.new(
70
+ 1,
71
+ 'full/name',
72
+ false,
73
+ 'git@example.com',
74
+ 'http://example.com',
75
+ 'description'
76
+ )
77
+ end
78
+
79
+ end
80
+
81
+ end
82
+ end
@@ -0,0 +1,5 @@
1
+ module Vx
2
+ module ServiceConnector
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ {
2
+ "id": 1,
3
+ "key": "ssh-rsa AAA...",
4
+ "url": "https://api.github.com/user/keys/1",
5
+ "title": "octocat@octomac"
6
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
3
+ "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
4
+ "commit": {
5
+ "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
6
+ "author": {
7
+ "name": "Monalisa Octocat",
8
+ "email": "support@github.com",
9
+ "date": "2011-04-14T16:00:49Z"
10
+ },
11
+ "committer": {
12
+ "name": "Monalisa Octocat",
13
+ "email": "support@github.com",
14
+ "date": "2011-04-14T16:00:49Z"
15
+ },
16
+ "message": "Fix all the bugs",
17
+ "tree": {
18
+ "url": "https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e",
19
+ "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
20
+ }
21
+ },
22
+ "author": {
23
+ "login": "octocat",
24
+ "id": 1,
25
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
26
+ "gravatar_id": "somehexcode",
27
+ "url": "https://api.github.com/users/octocat",
28
+ "html_url": "https://github.com/octocat",
29
+ "followers_url": "https://api.github.com/users/octocat/followers",
30
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
31
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
32
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
33
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
34
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
35
+ "repos_url": "https://api.github.com/users/octocat/repos",
36
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
37
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
38
+ "type": "User",
39
+ "site_admin": false
40
+ },
41
+ "committer": {
42
+ "login": "octocat",
43
+ "id": 1,
44
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
45
+ "gravatar_id": "somehexcode",
46
+ "url": "https://api.github.com/users/octocat",
47
+ "html_url": "https://github.com/octocat",
48
+ "followers_url": "https://api.github.com/users/octocat/followers",
49
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
50
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
51
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
52
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
53
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
54
+ "repos_url": "https://api.github.com/users/octocat/repos",
55
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
56
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
57
+ "type": "User",
58
+ "site_admin": false
59
+ },
60
+ "parents": [
61
+ {
62
+ "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
63
+ "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
64
+ }
65
+ ],
66
+ "stats": {
67
+ "additions": 104,
68
+ "deletions": 4,
69
+ "total": 108
70
+ },
71
+ "files": [
72
+ {
73
+ "filename": "file1.txt",
74
+ "additions": 10,
75
+ "deletions": 2,
76
+ "changes": 12,
77
+ "status": "modified",
78
+ "raw_url": "https://github.com/octocat/Hello-World/raw/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt",
79
+ "blob_url": "https://github.com/octocat/Hello-World/blob/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt",
80
+ "patch": "@@ -29,7 +29,7 @@\n....."
81
+ }
82
+ ]
83
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "web",
3
+ "active": true,
4
+ "events": [
5
+ "push",
6
+ "pull_request"
7
+ ],
8
+ "config": {
9
+ "url": "http://example.com/webhook",
10
+ "content_type": "json"
11
+ }
12
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "state": "success",
3
+ "target_url": "https://example.com/build/status",
4
+ "description": "The build succeeded!"
5
+ }
@@ -0,0 +1,8 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "key": "ssh-rsa AAA...",
5
+ "url": "https://api.github.com/user/keys/1",
6
+ "title": "octocat@octomac"
7
+ }
8
+ ]
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "url": "https://api.github.com/repos/octocat/Hello-World/hooks/1",
4
+ "updated_at": "2011-09-06T20:39:23Z",
5
+ "created_at": "2011-09-06T17:26:27Z",
6
+ "name": "web",
7
+ "events": [
8
+ "push",
9
+ "pull_request"
10
+ ],
11
+ "active": true,
12
+ "config": {
13
+ "url": "http://example.com",
14
+ "content_type": "json"
15
+ },
16
+ "id": 1
17
+ }
18
+ ]
@@ -0,0 +1,51 @@
1
+ [
2
+ {
3
+ "id": 1296269,
4
+ "owner": {
5
+ "login": "octocat",
6
+ "id": 1,
7
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
8
+ "gravatar_id": "somehexcode",
9
+ "url": "https://api.github.com/users/octocat",
10
+ "html_url": "https://github.com/octocat",
11
+ "followers_url": "https://api.github.com/users/octocat/followers",
12
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
13
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
14
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
15
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
16
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
17
+ "repos_url": "https://api.github.com/users/octocat/repos",
18
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
19
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
20
+ "type": "User",
21
+ "site_admin": false
22
+ },
23
+ "name": "Hello-World",
24
+ "full_name": "octocat/org",
25
+ "description": "This your first repo!",
26
+ "private": false,
27
+ "fork": true,
28
+ "url": "https://api.github.com/repos/octocat/Hello-World",
29
+ "html_url": "https://github.com/octocat/Hello-World",
30
+ "clone_url": "https://github.com/octocat/Hello-World.git",
31
+ "git_url": "git://github.com/octocat/Hello-World.git",
32
+ "ssh_url": "git@github.com:octocat/Hello-World.git",
33
+ "svn_url": "https://svn.github.com/octocat/Hello-World",
34
+ "mirror_url": "git://git.example.com/octocat/Hello-World",
35
+ "homepage": "https://github.com",
36
+ "language": null,
37
+ "forks_count": 9,
38
+ "stargazers_count": 80,
39
+ "watchers_count": 80,
40
+ "size": 108,
41
+ "default_branch": "master",
42
+ "master_branch": "master",
43
+ "open_issues_count": 0,
44
+ "pushed_at": "2011-01-26T19:06:43Z",
45
+ "created_at": "2011-01-26T19:01:12Z",
46
+ "updated_at": "2011-01-26T19:14:43Z",
47
+ "permissions": {
48
+ "admin": true
49
+ }
50
+ }
51
+ ]
@@ -0,0 +1,8 @@
1
+ [
2
+ {
3
+ "login": "github",
4
+ "id": 1,
5
+ "url": "https://api.github.com/orgs/github",
6
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif"
7
+ }
8
+ ]
@@ -0,0 +1,392 @@
1
+ {
2
+ "number":177,
3
+ "pull_request":{
4
+ "url":"https://api.github.com/repos/evrone/cybergifts/pulls/177",
5
+ "id":7502923,
6
+ "html_url":"https://github.com/evrone/cybergifts/pull/177",
7
+ "diff_url":"https://github.com/evrone/cybergifts/pull/177.diff",
8
+ "patch_url":"https://github.com/evrone/cybergifts/pull/177.patch",
9
+ "issue_url":"https://github.com/evrone/cybergifts/issues/177",
10
+ "number":4,
11
+ "state":"closed",
12
+ "title":"fix test for feedback",
13
+ "user":{
14
+ "login":"FreddySerg",
15
+ "id":1982559,
16
+ "avatar_url":"https://secure.gravatar.com/avatar/2aa5411c41901cd87d47a67f42b82ff7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
17
+ "gravatar_id":"2aa5411c41901cd87d47a67f42b82ff7",
18
+ "url":"https://api.github.com/users/FreddySerg",
19
+ "html_url":"https://github.com/FreddySerg",
20
+ "followers_url":"https://api.github.com/users/FreddySerg/followers",
21
+ "following_url":"https://api.github.com/users/FreddySerg/following{/other_user}",
22
+ "gists_url":"https://api.github.com/users/FreddySerg/gists{/gist_id}",
23
+ "starred_url":"https://api.github.com/users/FreddySerg/starred{/owner}{/repo}",
24
+ "subscriptions_url":"https://api.github.com/users/FreddySerg/subscriptions",
25
+ "organizations_url":"https://api.github.com/users/FreddySerg/orgs",
26
+ "repos_url":"https://api.github.com/users/FreddySerg/repos",
27
+ "events_url":"https://api.github.com/users/FreddySerg/events{/privacy}",
28
+ "received_events_url":"https://api.github.com/users/FreddySerg/received_events",
29
+ "type":"User"
30
+ },
31
+ "body":"",
32
+ "created_at":"2013-08-09T12:11:42Z",
33
+ "updated_at":"2013-08-09T12:11:42Z",
34
+ "closed_at":null,
35
+ "merged_at":null,
36
+ "merge_commit_sha":null,
37
+ "assignee":null,
38
+ "milestone":null,
39
+ "commits_url":"https://github.com/evrone/cybergifts/pull/177/commits",
40
+ "review_comments_url":"https://github.com/evrone/cybergifts/pull/177/comments",
41
+ "review_comment_url":"/repos/evrone/cybergifts/pulls/comments/{number}",
42
+ "comments_url":"https://api.github.com/repos/evrone/cybergifts/issues/177/comments",
43
+ "head":{
44
+ "label":"dima-exe:test",
45
+ "ref":"test",
46
+ "sha":"84158c732ff1af3db9775a37a74ddc39f5c4078f",
47
+ "user":{
48
+ "login":"evrone",
49
+ "id":431569,
50
+ "avatar_url":"https://secure.gravatar.com/avatar/6d3ebcae28dc666b58c511090d2dbf3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
51
+ "gravatar_id":"6d3ebcae28dc666b58c511090d2dbf3c",
52
+ "url":"https://api.github.com/users/evrone",
53
+ "html_url":"https://github.com/evrone",
54
+ "followers_url":"https://api.github.com/users/evrone/followers",
55
+ "following_url":"https://api.github.com/users/evrone/following{/other_user}",
56
+ "gists_url":"https://api.github.com/users/evrone/gists{/gist_id}",
57
+ "starred_url":"https://api.github.com/users/evrone/starred{/owner}{/repo}",
58
+ "subscriptions_url":"https://api.github.com/users/evrone/subscriptions",
59
+ "organizations_url":"https://api.github.com/users/evrone/orgs",
60
+ "repos_url":"https://api.github.com/users/evrone/repos",
61
+ "events_url":"https://api.github.com/users/evrone/events{/privacy}",
62
+ "received_events_url":"https://api.github.com/users/evrone/received_events",
63
+ "type":"Organization"
64
+ },
65
+ "repo":{
66
+ "id":7155123,
67
+ "name":"cybergifts",
68
+ "full_name":"evrone/cybergifts",
69
+ "owner":{
70
+ "login":"evrone",
71
+ "id":431569,
72
+ "avatar_url":"https://secure.gravatar.com/avatar/6d3ebcae28dc666b58c511090d2dbf3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
73
+ "gravatar_id":"6d3ebcae28dc666b58c511090d2dbf3c",
74
+ "url":"https://api.github.com/users/evrone",
75
+ "html_url":"https://github.com/evrone",
76
+ "followers_url":"https://api.github.com/users/evrone/followers",
77
+ "following_url":"https://api.github.com/users/evrone/following{/other_user}",
78
+ "gists_url":"https://api.github.com/users/evrone/gists{/gist_id}",
79
+ "starred_url":"https://api.github.com/users/evrone/starred{/owner}{/repo}",
80
+ "subscriptions_url":"https://api.github.com/users/evrone/subscriptions",
81
+ "organizations_url":"https://api.github.com/users/evrone/orgs",
82
+ "repos_url":"https://api.github.com/users/evrone/repos",
83
+ "events_url":"https://api.github.com/users/evrone/events{/privacy}",
84
+ "received_events_url":"https://api.github.com/users/evrone/received_events",
85
+ "type":"Organization"
86
+ },
87
+ "private":true,
88
+ "html_url":"https://github.com/evrone/cybergifts",
89
+ "description":"Give a gift to your friend",
90
+ "fork":false,
91
+ "url":"https://api.github.com/repos/evrone/cybergifts",
92
+ "forks_url":"https://api.github.com/repos/evrone/cybergifts/forks",
93
+ "keys_url":"https://api.github.com/repos/evrone/cybergifts/keys{/key_id}",
94
+ "collaborators_url":"https://api.github.com/repos/evrone/cybergifts/collaborators{/collaborator}",
95
+ "teams_url":"https://api.github.com/repos/evrone/cybergifts/teams",
96
+ "hooks_url":"https://api.github.com/repos/evrone/cybergifts/hooks",
97
+ "issue_events_url":"https://api.github.com/repos/evrone/cybergifts/issues/events{/number}",
98
+ "events_url":"https://api.github.com/repos/evrone/cybergifts/events",
99
+ "assignees_url":"https://api.github.com/repos/evrone/cybergifts/assignees{/user}",
100
+ "branches_url":"https://api.github.com/repos/evrone/cybergifts/branches{/branch}",
101
+ "tags_url":"https://api.github.com/repos/evrone/cybergifts/tags",
102
+ "blobs_url":"https://api.github.com/repos/evrone/cybergifts/git/blobs{/sha}",
103
+ "git_tags_url":"https://api.github.com/repos/evrone/cybergifts/git/tags{/sha}",
104
+ "git_refs_url":"https://api.github.com/repos/evrone/cybergifts/git/refs{/sha}",
105
+ "trees_url":"https://api.github.com/repos/evrone/cybergifts/git/trees{/sha}",
106
+ "statuses_url":"https://api.github.com/repos/evrone/cybergifts/statuses/{sha}",
107
+ "languages_url":"https://api.github.com/repos/evrone/cybergifts/languages",
108
+ "stargazers_url":"https://api.github.com/repos/evrone/cybergifts/stargazers",
109
+ "contributors_url":"https://api.github.com/repos/evrone/cybergifts/contributors",
110
+ "subscribers_url":"https://api.github.com/repos/evrone/cybergifts/subscribers",
111
+ "subscription_url":"https://api.github.com/repos/evrone/cybergifts/subscription",
112
+ "commits_url":"https://api.github.com/repos/evrone/cybergifts/commits{/sha}",
113
+ "git_commits_url":"https://api.github.com/repos/evrone/cybergifts/git/commits{/sha}",
114
+ "comments_url":"https://api.github.com/repos/evrone/cybergifts/comments{/number}",
115
+ "issue_comment_url":"https://api.github.com/repos/evrone/cybergifts/issues/comments/{number}",
116
+ "contents_url":"https://api.github.com/repos/evrone/cybergifts/contents/{+path}",
117
+ "compare_url":"https://api.github.com/repos/evrone/cybergifts/compare/{base}...{head}",
118
+ "merges_url":"https://api.github.com/repos/evrone/cybergifts/merges",
119
+ "archive_url":"https://api.github.com/repos/evrone/cybergifts/{archive_format}{/ref}",
120
+ "downloads_url":"https://api.github.com/repos/evrone/cybergifts/downloads",
121
+ "issues_url":"https://api.github.com/repos/evrone/cybergifts/issues{/number}",
122
+ "pulls_url":"https://api.github.com/repos/evrone/cybergifts/pulls{/number}",
123
+ "milestones_url":"https://api.github.com/repos/evrone/cybergifts/milestones{/number}",
124
+ "notifications_url":"https://api.github.com/repos/evrone/cybergifts/notifications{?since,all,participating}",
125
+ "labels_url":"https://api.github.com/repos/evrone/cybergifts/labels{/name}",
126
+ "created_at":"2012-12-13T20:45:44Z",
127
+ "updated_at":"2013-08-09T12:11:42Z",
128
+ "pushed_at":"2013-08-09T12:11:24Z",
129
+ "git_url":"git://github.com/evrone/cybergifts.git",
130
+ "ssh_url":"git@github.com:evrone/cybergifts.git",
131
+ "clone_url":"https://github.com/evrone/cybergifts.git",
132
+ "svn_url":"https://github.com/evrone/cybergifts",
133
+ "homepage":"http://cyber-gifts.net/",
134
+ "size":14624,
135
+ "watchers_count":1,
136
+ "language":"JavaScript",
137
+ "has_issues":false,
138
+ "has_downloads":true,
139
+ "has_wiki":false,
140
+ "forks_count":0,
141
+ "mirror_url":null,
142
+ "open_issues_count":2,
143
+ "forks":0,
144
+ "open_issues":2,
145
+ "watchers":1,
146
+ "master_branch":"master",
147
+ "default_branch":"master"
148
+ }
149
+ },
150
+ "base":{
151
+ "label":"evrone:master",
152
+ "ref":"master",
153
+ "sha":"a1ea1a6807ab8de87e0d685b7d5dcad0c081254e",
154
+ "user":{
155
+ "login":"evrone",
156
+ "id":431569,
157
+ "avatar_url":"https://secure.gravatar.com/avatar/6d3ebcae28dc666b58c511090d2dbf3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
158
+ "gravatar_id":"6d3ebcae28dc666b58c511090d2dbf3c",
159
+ "url":"https://api.github.com/users/evrone",
160
+ "html_url":"https://github.com/evrone",
161
+ "followers_url":"https://api.github.com/users/evrone/followers",
162
+ "following_url":"https://api.github.com/users/evrone/following{/other_user}",
163
+ "gists_url":"https://api.github.com/users/evrone/gists{/gist_id}",
164
+ "starred_url":"https://api.github.com/users/evrone/starred{/owner}{/repo}",
165
+ "subscriptions_url":"https://api.github.com/users/evrone/subscriptions",
166
+ "organizations_url":"https://api.github.com/users/evrone/orgs",
167
+ "repos_url":"https://api.github.com/users/evrone/repos",
168
+ "events_url":"https://api.github.com/users/evrone/events{/privacy}",
169
+ "received_events_url":"https://api.github.com/users/evrone/received_events",
170
+ "type":"Organization"
171
+ },
172
+ "repo":{
173
+ "id":7155123,
174
+ "name":"cybergifts",
175
+ "full_name":"evrone/cybergifts",
176
+ "owner":{
177
+ "login":"evrone",
178
+ "id":431569,
179
+ "avatar_url":"https://secure.gravatar.com/avatar/6d3ebcae28dc666b58c511090d2dbf3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
180
+ "gravatar_id":"6d3ebcae28dc666b58c511090d2dbf3c",
181
+ "url":"https://api.github.com/users/evrone",
182
+ "html_url":"https://github.com/evrone",
183
+ "followers_url":"https://api.github.com/users/evrone/followers",
184
+ "following_url":"https://api.github.com/users/evrone/following{/other_user}",
185
+ "gists_url":"https://api.github.com/users/evrone/gists{/gist_id}",
186
+ "starred_url":"https://api.github.com/users/evrone/starred{/owner}{/repo}",
187
+ "subscriptions_url":"https://api.github.com/users/evrone/subscriptions",
188
+ "organizations_url":"https://api.github.com/users/evrone/orgs",
189
+ "repos_url":"https://api.github.com/users/evrone/repos",
190
+ "events_url":"https://api.github.com/users/evrone/events{/privacy}",
191
+ "received_events_url":"https://api.github.com/users/evrone/received_events",
192
+ "type":"Organization"
193
+ },
194
+ "private":true,
195
+ "html_url":"https://github.com/evrone/cybergifts",
196
+ "description":"Give a gift to your friend",
197
+ "fork":false,
198
+ "url":"https://api.github.com/repos/evrone/cybergifts",
199
+ "forks_url":"https://api.github.com/repos/evrone/cybergifts/forks",
200
+ "keys_url":"https://api.github.com/repos/evrone/cybergifts/keys{/key_id}",
201
+ "collaborators_url":"https://api.github.com/repos/evrone/cybergifts/collaborators{/collaborator}",
202
+ "teams_url":"https://api.github.com/repos/evrone/cybergifts/teams",
203
+ "hooks_url":"https://api.github.com/repos/evrone/cybergifts/hooks",
204
+ "issue_events_url":"https://api.github.com/repos/evrone/cybergifts/issues/events{/number}",
205
+ "events_url":"https://api.github.com/repos/evrone/cybergifts/events",
206
+ "assignees_url":"https://api.github.com/repos/evrone/cybergifts/assignees{/user}",
207
+ "branches_url":"https://api.github.com/repos/evrone/cybergifts/branches{/branch}",
208
+ "tags_url":"https://api.github.com/repos/evrone/cybergifts/tags",
209
+ "blobs_url":"https://api.github.com/repos/evrone/cybergifts/git/blobs{/sha}",
210
+ "git_tags_url":"https://api.github.com/repos/evrone/cybergifts/git/tags{/sha}",
211
+ "git_refs_url":"https://api.github.com/repos/evrone/cybergifts/git/refs{/sha}",
212
+ "trees_url":"https://api.github.com/repos/evrone/cybergifts/git/trees{/sha}",
213
+ "statuses_url":"https://api.github.com/repos/evrone/cybergifts/statuses/{sha}",
214
+ "languages_url":"https://api.github.com/repos/evrone/cybergifts/languages",
215
+ "stargazers_url":"https://api.github.com/repos/evrone/cybergifts/stargazers",
216
+ "contributors_url":"https://api.github.com/repos/evrone/cybergifts/contributors",
217
+ "subscribers_url":"https://api.github.com/repos/evrone/cybergifts/subscribers",
218
+ "subscription_url":"https://api.github.com/repos/evrone/cybergifts/subscription",
219
+ "commits_url":"https://api.github.com/repos/evrone/cybergifts/commits{/sha}",
220
+ "git_commits_url":"https://api.github.com/repos/evrone/cybergifts/git/commits{/sha}",
221
+ "comments_url":"https://api.github.com/repos/evrone/cybergifts/comments{/number}",
222
+ "issue_comment_url":"https://api.github.com/repos/evrone/cybergifts/issues/comments/{number}",
223
+ "contents_url":"https://api.github.com/repos/evrone/cybergifts/contents/{+path}",
224
+ "compare_url":"https://api.github.com/repos/evrone/cybergifts/compare/{base}...{head}",
225
+ "merges_url":"https://api.github.com/repos/evrone/cybergifts/merges",
226
+ "archive_url":"https://api.github.com/repos/evrone/cybergifts/{archive_format}{/ref}",
227
+ "downloads_url":"https://api.github.com/repos/evrone/cybergifts/downloads",
228
+ "issues_url":"https://api.github.com/repos/evrone/cybergifts/issues{/number}",
229
+ "pulls_url":"https://api.github.com/repos/evrone/cybergifts/pulls{/number}",
230
+ "milestones_url":"https://api.github.com/repos/evrone/cybergifts/milestones{/number}",
231
+ "notifications_url":"https://api.github.com/repos/evrone/cybergifts/notifications{?since,all,participating}",
232
+ "labels_url":"https://api.github.com/repos/evrone/cybergifts/labels{/name}",
233
+ "created_at":"2012-12-13T20:45:44Z",
234
+ "updated_at":"2013-08-09T12:11:42Z",
235
+ "pushed_at":"2013-08-09T12:11:24Z",
236
+ "git_url":"git://github.com/evrone/cybergifts.git",
237
+ "ssh_url":"git@github.com:evrone/cybergifts.git",
238
+ "clone_url":"https://github.com/evrone/cybergifts.git",
239
+ "svn_url":"https://github.com/evrone/cybergifts",
240
+ "homepage":"http://cyber-gifts.net/",
241
+ "size":14624,
242
+ "watchers_count":1,
243
+ "language":"JavaScript",
244
+ "has_issues":false,
245
+ "has_downloads":true,
246
+ "has_wiki":false,
247
+ "forks_count":0,
248
+ "mirror_url":null,
249
+ "open_issues_count":2,
250
+ "forks":0,
251
+ "open_issues":2,
252
+ "watchers":1,
253
+ "master_branch":"master",
254
+ "default_branch":"master"
255
+ }
256
+ },
257
+ "_links":{
258
+ "self":{
259
+ "href":"https://api.github.com/repos/evrone/cybergifts/pulls/177"
260
+ },
261
+ "html":{
262
+ "href":"https://github.com/evrone/cybergifts/pull/177"
263
+ },
264
+ "issue":{
265
+ "href":"https://api.github.com/repos/evrone/cybergifts/issues/177"
266
+ },
267
+ "comments":{
268
+ "href":"https://api.github.com/repos/evrone/cybergifts/issues/177/comments"
269
+ },
270
+ "review_comments":{
271
+ "href":"https://api.github.com/repos/evrone/cybergifts/pulls/177/comments"
272
+ }
273
+ },
274
+ "merged":false,
275
+ "mergeable":null,
276
+ "mergeable_state":"unknown",
277
+ "merged_by":null,
278
+ "comments":0,
279
+ "review_comments":0,
280
+ "commits":1,
281
+ "additions":1,
282
+ "deletions":1,
283
+ "changed_files":1
284
+ },
285
+ "repository":{
286
+ "id":7155123,
287
+ "name":"cybergifts",
288
+ "full_name":"evrone/cybergifts",
289
+ "owner":{
290
+ "login":"evrone",
291
+ "id":431569,
292
+ "avatar_url":"https://secure.gravatar.com/avatar/6d3ebcae28dc666b58c511090d2dbf3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
293
+ "gravatar_id":"6d3ebcae28dc666b58c511090d2dbf3c",
294
+ "url":"https://api.github.com/users/evrone",
295
+ "html_url":"https://github.com/evrone",
296
+ "followers_url":"https://api.github.com/users/evrone/followers",
297
+ "following_url":"https://api.github.com/users/evrone/following{/other_user}",
298
+ "gists_url":"https://api.github.com/users/evrone/gists{/gist_id}",
299
+ "starred_url":"https://api.github.com/users/evrone/starred{/owner}{/repo}",
300
+ "subscriptions_url":"https://api.github.com/users/evrone/subscriptions",
301
+ "organizations_url":"https://api.github.com/users/evrone/orgs",
302
+ "repos_url":"https://api.github.com/users/evrone/repos",
303
+ "events_url":"https://api.github.com/users/evrone/events{/privacy}",
304
+ "received_events_url":"https://api.github.com/users/evrone/received_events",
305
+ "type":"Organization"
306
+ },
307
+ "private":true,
308
+ "html_url":"https://github.com/evrone/cybergifts",
309
+ "description":"Give a gift to your friend",
310
+ "fork":false,
311
+ "url":"https://api.github.com/repos/evrone/cybergifts",
312
+ "forks_url":"https://api.github.com/repos/evrone/cybergifts/forks",
313
+ "keys_url":"https://api.github.com/repos/evrone/cybergifts/keys{/key_id}",
314
+ "collaborators_url":"https://api.github.com/repos/evrone/cybergifts/collaborators{/collaborator}",
315
+ "teams_url":"https://api.github.com/repos/evrone/cybergifts/teams",
316
+ "hooks_url":"https://api.github.com/repos/evrone/cybergifts/hooks",
317
+ "issue_events_url":"https://api.github.com/repos/evrone/cybergifts/issues/events{/number}",
318
+ "events_url":"https://api.github.com/repos/evrone/cybergifts/events",
319
+ "assignees_url":"https://api.github.com/repos/evrone/cybergifts/assignees{/user}",
320
+ "branches_url":"https://api.github.com/repos/evrone/cybergifts/branches{/branch}",
321
+ "tags_url":"https://api.github.com/repos/evrone/cybergifts/tags",
322
+ "blobs_url":"https://api.github.com/repos/evrone/cybergifts/git/blobs{/sha}",
323
+ "git_tags_url":"https://api.github.com/repos/evrone/cybergifts/git/tags{/sha}",
324
+ "git_refs_url":"https://api.github.com/repos/evrone/cybergifts/git/refs{/sha}",
325
+ "trees_url":"https://api.github.com/repos/evrone/cybergifts/git/trees{/sha}",
326
+ "statuses_url":"https://api.github.com/repos/evrone/cybergifts/statuses/{sha}",
327
+ "languages_url":"https://api.github.com/repos/evrone/cybergifts/languages",
328
+ "stargazers_url":"https://api.github.com/repos/evrone/cybergifts/stargazers",
329
+ "contributors_url":"https://api.github.com/repos/evrone/cybergifts/contributors",
330
+ "subscribers_url":"https://api.github.com/repos/evrone/cybergifts/subscribers",
331
+ "subscription_url":"https://api.github.com/repos/evrone/cybergifts/subscription",
332
+ "commits_url":"https://api.github.com/repos/evrone/cybergifts/commits{/sha}",
333
+ "git_commits_url":"https://api.github.com/repos/evrone/cybergifts/git/commits{/sha}",
334
+ "comments_url":"https://api.github.com/repos/evrone/cybergifts/comments{/number}",
335
+ "issue_comment_url":"https://api.github.com/repos/evrone/cybergifts/issues/comments/{number}",
336
+ "contents_url":"https://api.github.com/repos/evrone/cybergifts/contents/{+path}",
337
+ "compare_url":"https://api.github.com/repos/evrone/cybergifts/compare/{base}...{head}",
338
+ "merges_url":"https://api.github.com/repos/evrone/cybergifts/merges",
339
+ "archive_url":"https://api.github.com/repos/evrone/cybergifts/{archive_format}{/ref}",
340
+ "downloads_url":"https://api.github.com/repos/evrone/cybergifts/downloads",
341
+ "issues_url":"https://api.github.com/repos/evrone/cybergifts/issues{/number}",
342
+ "pulls_url":"https://api.github.com/repos/evrone/cybergifts/pulls{/number}",
343
+ "milestones_url":"https://api.github.com/repos/evrone/cybergifts/milestones{/number}",
344
+ "notifications_url":"https://api.github.com/repos/evrone/cybergifts/notifications{?since,all,participating}",
345
+ "labels_url":"https://api.github.com/repos/evrone/cybergifts/labels{/name}",
346
+ "created_at":"2012-12-13T20:45:44Z",
347
+ "updated_at":"2013-08-09T12:11:42Z",
348
+ "pushed_at":"2013-08-09T12:11:24Z",
349
+ "git_url":"git://github.com/evrone/cybergifts.git",
350
+ "ssh_url":"git@github.com:evrone/cybergifts.git",
351
+ "clone_url":"https://github.com/evrone/cybergifts.git",
352
+ "svn_url":"https://github.com/evrone/cybergifts",
353
+ "homepage":"http://cyber-gifts.net/",
354
+ "size":14624,
355
+ "watchers_count":1,
356
+ "language":"JavaScript",
357
+ "has_issues":false,
358
+ "has_downloads":true,
359
+ "has_wiki":false,
360
+ "forks_count":0,
361
+ "mirror_url":null,
362
+ "open_issues_count":2,
363
+ "forks":0,
364
+ "open_issues":2,
365
+ "watchers":1,
366
+ "master_branch":"master",
367
+ "default_branch":"master"
368
+ },
369
+ "sender":{
370
+ "login":"FreddySerg",
371
+ "id":1982559,
372
+ "avatar_url":"https://secure.gravatar.com/avatar/2aa5411c41901cd87d47a67f42b82ff7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
373
+ "gravatar_id":"2aa5411c41901cd87d47a67f42b82ff7",
374
+ "url":"https://api.github.com/users/FreddySerg",
375
+ "html_url":"https://github.com/FreddySerg",
376
+ "followers_url":"https://api.github.com/users/FreddySerg/followers",
377
+ "following_url":"https://api.github.com/users/FreddySerg/following{/other_user}",
378
+ "gists_url":"https://api.github.com/users/FreddySerg/gists{/gist_id}",
379
+ "starred_url":"https://api.github.com/users/FreddySerg/starred{/owner}{/repo}",
380
+ "subscriptions_url":"https://api.github.com/users/FreddySerg/subscriptions",
381
+ "organizations_url":"https://api.github.com/users/FreddySerg/orgs",
382
+ "repos_url":"https://api.github.com/users/FreddySerg/repos",
383
+ "events_url":"https://api.github.com/users/FreddySerg/events{/privacy}",
384
+ "received_events_url":"https://api.github.com/users/FreddySerg/received_events",
385
+ "type":"User"
386
+ },
387
+ "token":"00fc9c85c40d0e261e77bb0f1d9d0f",
388
+ "id":"9",
389
+ "project":{
390
+
391
+ }
392
+ }