lita-github_pr_list 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +24 -0
  3. data/.hound.yml +8 -0
  4. data/.rspec +4 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +21 -0
  7. data/README.md +51 -0
  8. data/Rakefile +6 -0
  9. data/bin/rake +16 -0
  10. data/bin/rspec +16 -0
  11. data/lib/lita/github_pr_list/alias_user.rb +19 -0
  12. data/lib/lita/github_pr_list/comment_hook.rb +42 -0
  13. data/lib/lita/github_pr_list/pull_request.rb +62 -0
  14. data/lib/lita/github_pr_list/status.rb +44 -0
  15. data/lib/lita/github_pr_list/version.rb +5 -0
  16. data/lib/lita/github_pr_list/web_hook.rb +39 -0
  17. data/lib/lita/github_pr_list.rb +7 -0
  18. data/lib/lita/handlers/github_pr_list.rb +91 -0
  19. data/lita-github_pr_list.gemspec +30 -0
  20. data/spec/fixtures/issue_comment_event_failed.json +180 -0
  21. data/spec/fixtures/issue_comment_event_fixed.json +180 -0
  22. data/spec/fixtures/issue_comment_event_in_review.json +180 -0
  23. data/spec/fixtures/issue_comment_event_passed.json +180 -0
  24. data/spec/fixtures/issue_comments_failed.json +83 -0
  25. data/spec/fixtures/issue_comments_fixed.json +111 -0
  26. data/spec/fixtures/issue_comments_in_review.json +83 -0
  27. data/spec/fixtures/issue_comments_new.json +56 -0
  28. data/spec/fixtures/issue_comments_passed.json +83 -0
  29. data/spec/fixtures/one_org_issue_list.json +182 -0
  30. data/spec/fixtures/repository_hooks.json +34 -0
  31. data/spec/fixtures/repository_list.json +108 -0
  32. data/spec/fixtures/two_org_issue_list.json +362 -0
  33. data/spec/lita/handlers/alias_spec.rb +13 -0
  34. data/spec/lita/handlers/comment_hook_spec.rb +57 -0
  35. data/spec/lita/handlers/pull_request_spec.rb +72 -0
  36. data/spec/lita/handlers/web_hook_spec.rb +50 -0
  37. data/spec/spec_helper.rb +8 -0
  38. metadata +222 -0
@@ -0,0 +1,182 @@
1
+ [
2
+ {
3
+ "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
4
+ "html_url": "https://github.com/octocat/Hello-World/issues/1347",
5
+ "number": 1347,
6
+ "state": "open",
7
+ "title": "Found a bug",
8
+ "body": "I'm having a problem with this.",
9
+ "user": {
10
+ "login": "octocat",
11
+ "id": 1,
12
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
13
+ "gravatar_id": "somehexcode",
14
+ "url": "https://api.github.com/users/octocat",
15
+ "html_url": "https://github.com/octocat",
16
+ "followers_url": "https://api.github.com/users/octocat/followers",
17
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
18
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
19
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
20
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
21
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
22
+ "repos_url": "https://api.github.com/users/octocat/repos",
23
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
24
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
25
+ "type": "User",
26
+ "site_admin": false
27
+ },
28
+ "labels": [
29
+ {
30
+ "url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
31
+ "name": "bug",
32
+ "color": "f29513"
33
+ }
34
+ ],
35
+ "assignee": {
36
+ "login": "octocat",
37
+ "id": 1,
38
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
39
+ "gravatar_id": "somehexcode",
40
+ "url": "https://api.github.com/users/octocat",
41
+ "html_url": "https://github.com/octocat",
42
+ "followers_url": "https://api.github.com/users/octocat/followers",
43
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
44
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
45
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
46
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
47
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
48
+ "repos_url": "https://api.github.com/users/octocat/repos",
49
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
50
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
51
+ "type": "User",
52
+ "site_admin": false
53
+ },
54
+ "milestone": {
55
+ "url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
56
+ "number": 1,
57
+ "state": "open",
58
+ "title": "v1.0",
59
+ "description": "",
60
+ "creator": {
61
+ "login": "octocat",
62
+ "id": 1,
63
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
64
+ "gravatar_id": "somehexcode",
65
+ "url": "https://api.github.com/users/octocat",
66
+ "html_url": "https://github.com/octocat",
67
+ "followers_url": "https://api.github.com/users/octocat/followers",
68
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
69
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
70
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
71
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
72
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
73
+ "repos_url": "https://api.github.com/users/octocat/repos",
74
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
75
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
76
+ "type": "User",
77
+ "site_admin": false
78
+ },
79
+ "open_issues": 4,
80
+ "closed_issues": 8,
81
+ "created_at": "2011-04-10T20:09:31Z",
82
+ "updated_at": "2014-03-03T18:58:10Z",
83
+ "due_on": null
84
+ },
85
+ "comments": 0,
86
+ "pull_request": {
87
+ "url": "https://api.github.com/repos/octocat/Hello-World/pulls/1347",
88
+ "html_url": "https://github.com/octocat/Hello-World/pull/1347",
89
+ "diff_url": "https://github.com/octocat/Hello-World/pull/1347.diff",
90
+ "patch_url": "https://github.com/octocat/Hello-World/pull/1347.patch"
91
+ },
92
+ "closed_at": null,
93
+ "created_at": "2011-04-22T13:33:48Z",
94
+ "updated_at": "2011-04-22T13:33:48Z",
95
+ "repository": {
96
+ "id": 123456789,
97
+ "name": "waffles",
98
+ "full_name": "wafflesausages111111/batman_robin",
99
+ "owner": {
100
+ "login": "wafflesausages111111",
101
+ "id": 111111,
102
+ "avatar_url": "https://avatars.githubusercontent.com/u/123456?",
103
+ "gravatar_id": "2222222222222222222222222222222222222222222",
104
+ "url": "https://api.github.com/users/wafflesausages111111",
105
+ "html_url": "https://github.com/wafflesausages111111",
106
+ "followers_url": "https://api.github.com/users/wafflesausages111111/followers",
107
+ "following_url": "https://api.github.com/users/wafflesausages111111/following{/other_user}",
108
+ "gists_url": "https://api.github.com/users/wafflesausages111111/gists{/gist_id}",
109
+ "starred_url": "https://api.github.com/users/wafflesausages111111/starred{/owner}{/repo}",
110
+ "subscriptions_url": "https://api.github.com/users/wafflesausages111111/subscriptions",
111
+ "organizations_url": "https://api.github.com/users/wafflesausages111111/orgs",
112
+ "repos_url": "https://api.github.com/users/wafflesausages111111/repos",
113
+ "events_url": "https://api.github.com/users/wafflesausages111111/events{/privacy}",
114
+ "received_events_url": "https://api.github.com/users/wafflesausages111111/received_events",
115
+ "type": "Organization",
116
+ "site_admin": false
117
+ },
118
+ "private": true,
119
+ "html_url": "https://github.com/wafflesausages111111/batman_robin",
120
+ "description": "",
121
+ "fork": false,
122
+ "url": "https://api.github.com/repos/wafflesausages111111/batman_robin",
123
+ "forks_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/forks",
124
+ "keys_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/keys{/key_id}",
125
+ "collaborators_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/collaborators{/collaborator}",
126
+ "teams_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/teams",
127
+ "hooks_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/hooks",
128
+ "issue_events_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/issues/events{/number}",
129
+ "events_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/events",
130
+ "assignees_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/assignees{/user}",
131
+ "branches_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/branches{/branch}",
132
+ "tags_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/tags",
133
+ "blobs_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/git/blobs{/sha}",
134
+ "git_tags_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/git/tags{/sha}",
135
+ "git_refs_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/git/refs{/sha}",
136
+ "trees_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/git/trees{/sha}",
137
+ "statuses_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/statuses/{sha}",
138
+ "languages_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/languages",
139
+ "stargazers_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/stargazers",
140
+ "contributors_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/contributors",
141
+ "subscribers_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/subscribers",
142
+ "subscription_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/subscription",
143
+ "commits_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/commits{/sha}",
144
+ "git_commits_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/git/commits{/sha}",
145
+ "comments_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/comments{/number}",
146
+ "issue_comment_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/issues/comments/{number}",
147
+ "contents_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/contents/{+path}",
148
+ "compare_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/compare/{base}...{head}",
149
+ "merges_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/merges",
150
+ "archive_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/{archive_format}{/ref}",
151
+ "downloads_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/downloads",
152
+ "issues_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/issues{/number}",
153
+ "pulls_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/pulls{/number}",
154
+ "milestones_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/milestones{/number}",
155
+ "notifications_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/notifications{?since,all,participating}",
156
+ "labels_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/labels{/name}",
157
+ "releases_url": "https://api.github.com/repos/wafflesausages111111/batman_robin/releases{/id}",
158
+ "created_at": "2014-06-23T20:26:50Z",
159
+ "updated_at": "2014-06-24T22:22:38Z",
160
+ "pushed_at": "2014-06-25T17:14:43Z",
161
+ "git_url": "git://github.com/wafflesausages111111/batman_robin.git",
162
+ "ssh_url": "git@github.com:wafflesausages111111/batman_robin.git",
163
+ "clone_url": "https://github.com/wafflesausages111111/batman_robin.git",
164
+ "svn_url": "https://github.com/wafflesausages111111/batman_robin",
165
+ "homepage": null,
166
+ "size": 0,
167
+ "stargazers_count": 0,
168
+ "watchers_count": 0,
169
+ "language": "Ruby",
170
+ "has_issues": true,
171
+ "has_downloads": true,
172
+ "has_wiki": true,
173
+ "forks_count": 0,
174
+ "mirror_url": null,
175
+ "open_issues_count": 1,
176
+ "forks": 0,
177
+ "open_issues": 1,
178
+ "watchers": 0,
179
+ "default_branch": "master"
180
+ }
181
+ }
182
+ ]
@@ -0,0 +1,34 @@
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
+ {
19
+ "url": "https://api.github.com/repos/octocat/Hello-World/hooks/5",
20
+ "updated_at": "2011-09-06T20:39:23Z",
21
+ "created_at": "2011-09-06T17:26:27Z",
22
+ "name": "web",
23
+ "events": [
24
+ "push",
25
+ "pull_request"
26
+ ],
27
+ "active": true,
28
+ "config": {
29
+ "url": "https://example.com/hook",
30
+ "content_type": "json"
31
+ },
32
+ "id": 5
33
+ }
34
+ ]
@@ -0,0 +1,108 @@
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/Hello-World",
25
+ "description": "This your first repo!",
26
+ "private": false,
27
+ "fork": false,
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
+ "open_issues_count": 0,
43
+ "has_issues": true,
44
+ "has_wiki": true,
45
+ "has_downloads": true,
46
+ "pushed_at": "2011-01-26T19:06:43Z",
47
+ "created_at": "2011-01-26T19:01:12Z",
48
+ "updated_at": "2011-01-26T19:14:43Z",
49
+ "permissions": {
50
+ "admin": false,
51
+ "push": false,
52
+ "pull": true
53
+ }
54
+ },
55
+ {
56
+ "id": 1296269,
57
+ "owner": {
58
+ "login": "octocat",
59
+ "id": 1,
60
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
61
+ "gravatar_id": "somehexcode",
62
+ "url": "https://api.github.com/users/octocat",
63
+ "html_url": "https://github.com/octocat",
64
+ "followers_url": "https://api.github.com/users/octocat/followers",
65
+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
66
+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
67
+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
68
+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
69
+ "organizations_url": "https://api.github.com/users/octocat/orgs",
70
+ "repos_url": "https://api.github.com/users/octocat/repos",
71
+ "events_url": "https://api.github.com/users/octocat/events{/privacy}",
72
+ "received_events_url": "https://api.github.com/users/octocat/received_events",
73
+ "type": "User",
74
+ "site_admin": false
75
+ },
76
+ "name": "Hello-World",
77
+ "full_name": "octocat/Hello-World",
78
+ "description": "This your first repo!",
79
+ "private": false,
80
+ "fork": false,
81
+ "url": "https://api.github.com/repos/octocat/Hello-World",
82
+ "html_url": "https://github.com/octocat/Hello-World",
83
+ "clone_url": "https://github.com/octocat/Hello-World.git",
84
+ "git_url": "git://github.com/octocat/Hello-World.git",
85
+ "ssh_url": "git@github.com:octocat/Hello-World.git",
86
+ "svn_url": "https://svn.github.com/octocat/Hello-World",
87
+ "mirror_url": "git://git.example.com/octocat/Hello-World",
88
+ "homepage": "https://github.com",
89
+ "language": null,
90
+ "forks_count": 9,
91
+ "stargazers_count": 80,
92
+ "watchers_count": 80,
93
+ "size": 108,
94
+ "default_branch": "master",
95
+ "open_issues_count": 0,
96
+ "has_issues": true,
97
+ "has_wiki": true,
98
+ "has_downloads": true,
99
+ "pushed_at": "2011-01-26T19:06:43Z",
100
+ "created_at": "2011-01-26T19:01:12Z",
101
+ "updated_at": "2011-01-26T19:14:43Z",
102
+ "permissions": {
103
+ "admin": false,
104
+ "push": false,
105
+ "pull": true
106
+ }
107
+ }
108
+ ]