octokit 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
+ # 1.21.0
4
+
5
+ [@joeyw](https://github.com/joeyw) added:
6
+
7
+ * 9df8662f3dddceba88a179029d9811ca8f201784 `.repository network events`
8
+ * 005723269f56fc59fc58c2d7f4eb2b6da1ee0b4a `.organization_public_events`
9
+ * f952ab54207f3d0bc5dc50bb822768444a777a70 `.received_public_events`
10
+ * c2e42b70d4f5fc219bd399bc2e645cce2cc168e9 `.user_public_events`
11
+ * ae9aaea3a25bee4cc17176419ebc5142aba2f729 `.organization_events`
12
+
13
+ View [the full changelog][1.21.0].
14
+ [1.21.0]: https://github.com/pengwynn/octokit/compare/v1.20.0...v1.21.0
15
+
3
16
  # 1.20.0
4
17
 
5
18
  * [@joeyw](https://github.com/joeyw) added `.all_users` and `.all_repositories`
data/Gemfile CHANGED
@@ -1,7 +1,5 @@
1
- source 'https://rubygems.org'
1
+ source :rubygems
2
2
 
3
- platforms :jruby do
4
- gem "jruby-openssl", "~> 0.7"
5
- end
3
+ gem 'jruby-openssl', :platforms => :jruby
6
4
 
7
5
  gemspec
data/README.md CHANGED
@@ -81,7 +81,7 @@ You can make authenticated calls by telling Octokit to use credentials from
81
81
  this file:
82
82
 
83
83
  ```ruby
84
- Octokit.netrc => true # or /path/to/file
84
+ Octokit.netrc = true # or /path/to/file
85
85
  Octokit.user # authenticates as 'pengwynn' user
86
86
  ```
87
87
 
@@ -21,6 +21,17 @@ module Octokit
21
21
  get("users/#{user}/events", options)
22
22
  end
23
23
 
24
+ # List public user events
25
+ #
26
+ # @param user [String] GitHub username
27
+ # @return [Array] A list of public user events
28
+ # @see http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user
29
+ # @example List public user events
30
+ # Octokit.user_events("sferik")
31
+ def user_public_events(user, options={})
32
+ get("users/#{user}/events/public", options)
33
+ end
34
+
24
35
  # List events that a user has received
25
36
  #
26
37
  # @return [Array] A list of all user received events
@@ -31,6 +42,16 @@ module Octokit
31
42
  get("users/#{user}/received_events", options)
32
43
  end
33
44
 
45
+ # List public events a user has received
46
+ #
47
+ # @return [Array] A list of public user received events
48
+ # @see http://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received
49
+ # @example List public user received events
50
+ # Octokit.received_public_events("sferik")
51
+ def received_public_events(user, options={})
52
+ get("users/#{user}/received_events/public", options)
53
+ end
54
+
34
55
  # List events for a repository
35
56
  #
36
57
  # @param repo [String, Repository, Hash] A GitHub repository
@@ -41,6 +62,42 @@ module Octokit
41
62
  def repository_events(repo, options={})
42
63
  get("repos/#{Repository.new(repo)}/events", options)
43
64
  end
65
+
66
+ # List public events for a repository's network
67
+ #
68
+ # @param repo [String, Repository, Hash] A GitHub repository
69
+ # @return [Array] A list of events for a repository's network
70
+ # @see http://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories
71
+ # @example List events for a repository's network
72
+ # Octokit.repository_network_events("sferik/rails_admin")
73
+ def repository_network_events(repo, options={})
74
+ get("networks/#{Repository.new repo}/events", options)
75
+ end
76
+
77
+ # List all events for an organization
78
+ #
79
+ # Requires authenticated client.
80
+ #
81
+ # @param org [String] Organization GitHub handle
82
+ # @return [Array] List of all events from a GitHub organization
83
+ # @see http://developer.github.com/v3/activity/events/#list-events-for-an-organization
84
+ # @example List events for the lostisland organization
85
+ # @client.organization_events("lostisland")
86
+ def organization_events(org, options={})
87
+ get("users/#{login}/events/orgs/#{org}", options)
88
+ end
89
+
90
+ # List an organization's public events
91
+ #
92
+ # @param org [String] Organization GitHub username
93
+ # @return [Array] List of public events from a GitHub organization
94
+ # @see http://developer.github.com/v3/activity/events/#list-public-events-for-an-organization
95
+ # @example List public events for GitHub
96
+ # Octokit.organization_public_events("GitHub")
97
+ def organization_public_events(org, options={})
98
+ get("orgs/#{org}/events", options)
99
+ end
100
+
44
101
  end
45
102
  end
46
103
  end
@@ -11,7 +11,6 @@ module Octokit
11
11
  :authenticate => true,
12
12
  :force_urlencoded => false,
13
13
  :raw => false,
14
- :ssl => { :verify => false },
15
14
  :url => api_endpoint
16
15
  }.merge(options)
17
16
 
@@ -1,3 +1,3 @@
1
1
  module Octokit
2
- VERSION = "1.20.0" unless defined?(Octokit::VERSION)
2
+ VERSION = "1.21.0" unless defined?(Octokit::VERSION)
3
3
  end
@@ -0,0 +1,61 @@
1
+ [
2
+ {
3
+ "type": "CreateEvent",
4
+ "created_at": "2013-01-10T01:53:08Z",
5
+ "actor": {
6
+ "avatar_url": "https://secure.gravatar.com/avatar/befd819b3fced8c6bd3dba7e633dd068?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
7
+ "id": 64050,
8
+ "login": "gjtorikian",
9
+ "url": "https://api.github.com/users/gjtorikian",
10
+ "gravatar_id": "befd819b3fced8c6bd3dba7e633dd068"
11
+ },
12
+ "repo": {
13
+ "id": 1666784,
14
+ "url": "https://api.github.com/repos/github/developer.github.com",
15
+ "name": "github/developer.github.com"
16
+ },
17
+ "public": true,
18
+ "org": {
19
+ "avatar_url": "https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
20
+ "id": 9919,
21
+ "login": "github",
22
+ "url": "https://api.github.com/orgs/github",
23
+ "gravatar_id": "61024896f291303615bcd4f7a0dcfb74"
24
+ },
25
+ "payload": {
26
+ "master_branch": "master",
27
+ "ref_type": "branch",
28
+ "ref": "task/api-test",
29
+ "description": "GitHub API documentation"
30
+ },
31
+ "id": "1652750175"
32
+ },
33
+ {
34
+ "type": "WatchEvent",
35
+ "created_at": "2013-01-10T01:43:33Z",
36
+ "actor": {
37
+ "avatar_url": "https://secure.gravatar.com/avatar/d6e6ca7407972f5d081cd9a867a13ee6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
38
+ "login": "winni3",
39
+ "id": 12026,
40
+ "url": "https://api.github.com/users/winni3",
41
+ "gravatar_id": "d6e6ca7407972f5d081cd9a867a13ee6"
42
+ },
43
+ "repo": {
44
+ "id": 667163,
45
+ "url": "https://api.github.com/repos/github/github-services",
46
+ "name": "github/github-services"
47
+ },
48
+ "public": true,
49
+ "org": {
50
+ "avatar_url": "https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
51
+ "login": "github",
52
+ "id": 9919,
53
+ "url": "https://api.github.com/orgs/github",
54
+ "gravatar_id": "61024896f291303615bcd4f7a0dcfb74"
55
+ },
56
+ "payload": {
57
+ "action": "started"
58
+ },
59
+ "id": "1652746673"
60
+ }
61
+ ]
@@ -0,0 +1,61 @@
1
+ [
2
+ {
3
+ "type": "CreateEvent",
4
+ "created_at": "2013-01-10T01:53:08Z",
5
+ "actor": {
6
+ "avatar_url": "https://secure.gravatar.com/avatar/befd819b3fced8c6bd3dba7e633dd068?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
7
+ "id": 64050,
8
+ "login": "gjtorikian",
9
+ "url": "https://api.github.com/users/gjtorikian",
10
+ "gravatar_id": "befd819b3fced8c6bd3dba7e633dd068"
11
+ },
12
+ "repo": {
13
+ "id": 1666784,
14
+ "url": "https://api.github.com/repos/github/developer.github.com",
15
+ "name": "github/developer.github.com"
16
+ },
17
+ "public": true,
18
+ "org": {
19
+ "avatar_url": "https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
20
+ "id": 9919,
21
+ "login": "github",
22
+ "url": "https://api.github.com/orgs/github",
23
+ "gravatar_id": "61024896f291303615bcd4f7a0dcfb74"
24
+ },
25
+ "payload": {
26
+ "master_branch": "master",
27
+ "ref_type": "branch",
28
+ "ref": "task/api-test",
29
+ "description": "GitHub API documentation"
30
+ },
31
+ "id": "1652750175"
32
+ },
33
+ {
34
+ "type": "WatchEvent",
35
+ "created_at": "2013-01-10T01:43:33Z",
36
+ "actor": {
37
+ "avatar_url": "https://secure.gravatar.com/avatar/d6e6ca7407972f5d081cd9a867a13ee6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
38
+ "login": "winni3",
39
+ "id": 12026,
40
+ "url": "https://api.github.com/users/winni3",
41
+ "gravatar_id": "d6e6ca7407972f5d081cd9a867a13ee6"
42
+ },
43
+ "repo": {
44
+ "id": 667163,
45
+ "url": "https://api.github.com/repos/github/github-services",
46
+ "name": "github/github-services"
47
+ },
48
+ "public": true,
49
+ "org": {
50
+ "avatar_url": "https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
51
+ "login": "github",
52
+ "id": 9919,
53
+ "url": "https://api.github.com/orgs/github",
54
+ "gravatar_id": "61024896f291303615bcd4f7a0dcfb74"
55
+ },
56
+ "payload": {
57
+ "action": "started"
58
+ },
59
+ "id": "1652746673"
60
+ }
61
+ ]
@@ -0,0 +1,155 @@
1
+ [
2
+ {
3
+ "type": "IssuesEvent",
4
+ "created_at": "2013-01-08T23:38:31Z",
5
+ "actor": {
6
+ "url": "https://api.github.com/users/sferik",
7
+ "id": 10308,
8
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
9
+ "avatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
10
+ "login": "sferik"
11
+ },
12
+ "repo": {
13
+ "url": "https://api.github.com/repos/sferik/rails_admin",
14
+ "id": 810796,
15
+ "name": "sferik/rails_admin"
16
+ },
17
+ "public": true,
18
+ "payload": {
19
+ "issue": {
20
+ "milestone": null,
21
+ "comments": 1,
22
+ "html_url": "https://github.com/sferik/rails_admin/issues/1464",
23
+ "url": "https://api.github.com/repos/sferik/rails_admin/issues/1464",
24
+ "number": 1464,
25
+ "comments_url": "https://api.github.com/repos/sferik/rails_admin/issues/1464/comments",
26
+ "labels_url": "https://api.github.com/repos/sferik/rails_admin/issues/1464/labels{/name}",
27
+ "updated_at": "2013-01-08T23:38:31Z",
28
+ "title": "Core dump in ruby 1.9.3p362",
29
+ "events_url": "https://api.github.com/repos/sferik/rails_admin/issues/1464/events",
30
+ "assignee": null,
31
+ "created_at": "2013-01-08T23:34:39Z",
32
+ "labels": [
33
+
34
+ ],
35
+ "closed_at": "2013-01-08T23:38:31Z",
36
+ "body": "Just browsing the side menus on rails admin gives me a core dump on ruby 1.9.3-p362. The issue does not occur on 1.9.3-p327. Here's the core dump:\r\n\r\nhttp://pastebin.com/qMp6GQZN\r\n\r\nI also found this thread that describes what may be the same issue:\r\nhttp://comments.gmane.org/gmane.comp.lang.ruby.core/50509",
37
+ "id": 9787839,
38
+ "user": {
39
+ "url": "https://api.github.com/users/tbenst",
40
+ "following_url": "https://api.github.com/users/tbenst/following",
41
+ "events_url": "https://api.github.com/users/tbenst/events{/privacy}",
42
+ "organizations_url": "https://api.github.com/users/tbenst/orgs",
43
+ "followers_url": "https://api.github.com/users/tbenst/followers",
44
+ "received_events_url": "https://api.github.com/users/tbenst/received_events",
45
+ "starred_url": "https://api.github.com/users/tbenst/starred{/owner}{/repo}",
46
+ "id": 863327,
47
+ "subscriptions_url": "https://api.github.com/users/tbenst/subscriptions",
48
+ "avatar_url": "https://secure.gravatar.com/avatar/5823d4e3d3ecc1a4d8ec58392c9e3f43?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
49
+ "gravatar_id": "5823d4e3d3ecc1a4d8ec58392c9e3f43",
50
+ "gists_url": "https://api.github.com/users/tbenst/gists{/gist_id}",
51
+ "type": "User",
52
+ "login": "tbenst",
53
+ "repos_url": "https://api.github.com/users/tbenst/repos"
54
+ },
55
+ "pull_request": {
56
+ "html_url": null,
57
+ "patch_url": null,
58
+ "diff_url": null
59
+ },
60
+ "state": "closed"
61
+ },
62
+ "action": "closed"
63
+ },
64
+ "id": "1651989733"
65
+ },
66
+ {
67
+ "type": "IssueCommentEvent",
68
+ "created_at": "2013-01-08T23:38:31Z",
69
+ "actor": {
70
+ "url": "https://api.github.com/users/sferik",
71
+ "id": 10308,
72
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
73
+ "avatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
74
+ "login": "sferik"
75
+ },
76
+ "repo": {
77
+ "url": "https://api.github.com/repos/sferik/rails_admin",
78
+ "id": 810796,
79
+ "name": "sferik/rails_admin"
80
+ },
81
+ "public": true,
82
+ "payload": {
83
+ "issue": {
84
+ "milestone": null,
85
+ "comments": 1,
86
+ "number": 1464,
87
+ "url": "https://api.github.com/repos/sferik/rails_admin/issues/1464",
88
+ "html_url": "https://github.com/sferik/rails_admin/issues/1464",
89
+ "comments_url": "https://api.github.com/repos/sferik/rails_admin/issues/1464/comments",
90
+ "labels_url": "https://api.github.com/repos/sferik/rails_admin/issues/1464/labels{/name}",
91
+ "updated_at": "2013-01-08T23:38:31Z",
92
+ "events_url": "https://api.github.com/repos/sferik/rails_admin/issues/1464/events",
93
+ "title": "Core dump in ruby 1.9.3p362",
94
+ "assignee": null,
95
+ "created_at": "2013-01-08T23:34:39Z",
96
+ "labels": [
97
+
98
+ ],
99
+ "closed_at": "2013-01-08T23:38:31Z",
100
+ "body": "Just browsing the side menus on rails admin gives me a core dump on ruby 1.9.3-p362. The issue does not occur on 1.9.3-p327. Here's the core dump:\r\n\r\nhttp://pastebin.com/qMp6GQZN\r\n\r\nI also found this thread that describes what may be the same issue:\r\nhttp://comments.gmane.org/gmane.comp.lang.ruby.core/50509",
101
+ "id": 9787839,
102
+ "user": {
103
+ "url": "https://api.github.com/users/tbenst",
104
+ "following_url": "https://api.github.com/users/tbenst/following",
105
+ "events_url": "https://api.github.com/users/tbenst/events{/privacy}",
106
+ "followers_url": "https://api.github.com/users/tbenst/followers",
107
+ "organizations_url": "https://api.github.com/users/tbenst/orgs",
108
+ "received_events_url": "https://api.github.com/users/tbenst/received_events",
109
+ "starred_url": "https://api.github.com/users/tbenst/starred{/owner}{/repo}",
110
+ "id": 863327,
111
+ "subscriptions_url": "https://api.github.com/users/tbenst/subscriptions",
112
+ "gravatar_id": "5823d4e3d3ecc1a4d8ec58392c9e3f43",
113
+ "avatar_url": "https://secure.gravatar.com/avatar/5823d4e3d3ecc1a4d8ec58392c9e3f43?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
114
+ "gists_url": "https://api.github.com/users/tbenst/gists{/gist_id}",
115
+ "type": "User",
116
+ "repos_url": "https://api.github.com/users/tbenst/repos",
117
+ "login": "tbenst"
118
+ },
119
+ "pull_request": {
120
+ "html_url": null,
121
+ "patch_url": null,
122
+ "diff_url": null
123
+ },
124
+ "state": "closed"
125
+ },
126
+ "comment": {
127
+ "url": "https://api.github.com/repos/sferik/rails_admin/issues/comments/12023687",
128
+ "updated_at": "2013-01-08T23:38:31Z",
129
+ "issue_url": "https://api.github.com/repos/sferik/rails_admin/issues/9787839",
130
+ "created_at": "2013-01-08T23:38:31Z",
131
+ "body": "Yeah, it's a Ruby bug. I'd stick with patchlevel 327 until that bug is fixed.",
132
+ "id": 12023687,
133
+ "user": {
134
+ "url": "https://api.github.com/users/sferik",
135
+ "following_url": "https://api.github.com/users/sferik/following",
136
+ "events_url": "https://api.github.com/users/sferik/events{/privacy}",
137
+ "followers_url": "https://api.github.com/users/sferik/followers",
138
+ "organizations_url": "https://api.github.com/users/sferik/orgs",
139
+ "received_events_url": "https://api.github.com/users/sferik/received_events",
140
+ "starred_url": "https://api.github.com/users/sferik/starred{/owner}{/repo}",
141
+ "id": 10308,
142
+ "subscriptions_url": "https://api.github.com/users/sferik/subscriptions",
143
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
144
+ "avatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
145
+ "gists_url": "https://api.github.com/users/sferik/gists{/gist_id}",
146
+ "type": "User",
147
+ "repos_url": "https://api.github.com/users/sferik/repos",
148
+ "login": "sferik"
149
+ }
150
+ },
151
+ "action": "created"
152
+ },
153
+ "id": "1651989731"
154
+ }
155
+ ]
@@ -0,0 +1,78 @@
1
+ [
2
+ {
3
+ "type": "PushEvent",
4
+ "public": true,
5
+ "actor": {
6
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
7
+ "id": 10308,
8
+ "avatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
9
+ "login": "sferik",
10
+ "url": "https://api.github.com/users/sferik"
11
+ },
12
+ "repo": {
13
+ "id": 507,
14
+ "url": "https://api.github.com/repos/sferik/twitter",
15
+ "name": "sferik/twitter"
16
+ },
17
+ "created_at": "2013-01-10T00:27:21Z",
18
+ "payload": {
19
+ "commits": [
20
+ {
21
+ "distinct": true,
22
+ "sha": "887f72586c323a9d9750072697edf78b9d4c29ab",
23
+ "url": "https://api.github.com/repos/sferik/twitter/commits/887f72586c323a9d9750072697edf78b9d4c29ab",
24
+ "author": {
25
+ "email": "sferik@gmail.com",
26
+ "name": "Erik Michaels-Ober"
27
+ },
28
+ "message": "Rename YARD tag \"Authentication Required?\" to \"Authentication\""
29
+ }
30
+ ],
31
+ "head": "887f72586c323a9d9750072697edf78b9d4c29ab",
32
+ "distinct_size": 1,
33
+ "size": 1,
34
+ "push_id": 134034131,
35
+ "ref": "refs/heads/master",
36
+ "before": "b4484cbc74ba598cbeeaebaf25e4534ff5a69950"
37
+ },
38
+ "id": "1652715007"
39
+ },
40
+ {
41
+ "type": "PushEvent",
42
+ "public": true,
43
+ "actor": {
44
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
45
+ "id": 10308,
46
+ "avatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
47
+ "login": "sferik",
48
+ "url": "https://api.github.com/users/sferik"
49
+ },
50
+ "repo": {
51
+ "id": 1716295,
52
+ "url": "https://api.github.com/repos/sferik/sign-in-with-twitter",
53
+ "name": "sferik/sign-in-with-twitter"
54
+ },
55
+ "created_at": "2013-01-10T00:20:14Z",
56
+ "payload": {
57
+ "commits": [
58
+ {
59
+ "distinct": true,
60
+ "sha": "131783a5ff0714b34e06b8c1a76d2821b968a349",
61
+ "url": "https://api.github.com/repos/sferik/sign-in-with-twitter/commits/131783a5ff0714b34e06b8c1a76d2821b968a349",
62
+ "message": "Update twitter dependency to version 4.4.4",
63
+ "author": {
64
+ "email": "sferik@gmail.com",
65
+ "name": "Erik Michaels-Ober"
66
+ }
67
+ }
68
+ ],
69
+ "head": "131783a5ff0714b34e06b8c1a76d2821b968a349",
70
+ "distinct_size": 1,
71
+ "size": 1,
72
+ "ref": "refs/heads/master",
73
+ "push_id": 134032306,
74
+ "before": "b4b2114eea201569406cf0c1c0306cbeab2ac8fa"
75
+ },
76
+ "id": "1652711641"
77
+ }
78
+ ]
@@ -0,0 +1,78 @@
1
+ [
2
+ {
3
+ "type": "CreateEvent",
4
+ "created_at": "2013-01-10T02:09:19Z",
5
+ "actor": {
6
+ "avatar_url": "https://secure.gravatar.com/avatar/efb7c66871043330ce1310a9bdd0aaf6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
7
+ "gravatar_id": "efb7c66871043330ce1310a9bdd0aaf6",
8
+ "url": "https://api.github.com/users/hone",
9
+ "login": "hone",
10
+ "id": 16457
11
+ },
12
+ "repo": {
13
+ "url": "https://api.github.com/repos/carlhuda/bundler",
14
+ "name": "carlhuda/bundler",
15
+ "id": 488514
16
+ },
17
+ "public": true,
18
+ "org": {
19
+ "avatar_url": "https://secure.gravatar.com/avatar/2cb8fc28095b45feaadb133a7a96e560?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
20
+ "gravatar_id": "2cb8fc28095b45feaadb133a7a96e560",
21
+ "url": "https://api.github.com/orgs/carlhuda",
22
+ "login": "carlhuda",
23
+ "id": 76794
24
+ },
25
+ "payload": {
26
+ "master_branch": "master",
27
+ "description": "Manage your application's gem dependencies with less pain",
28
+ "ref": "v1.3.0.pre.5",
29
+ "ref_type": "tag"
30
+ },
31
+ "id": "1652756065"
32
+ },
33
+ {
34
+ "type": "PushEvent",
35
+ "created_at": "2013-01-10T02:09:13Z",
36
+ "actor": {
37
+ "avatar_url": "https://secure.gravatar.com/avatar/efb7c66871043330ce1310a9bdd0aaf6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
38
+ "gravatar_id": "efb7c66871043330ce1310a9bdd0aaf6",
39
+ "url": "https://api.github.com/users/hone",
40
+ "login": "hone",
41
+ "id": 16457
42
+ },
43
+ "repo": {
44
+ "url": "https://api.github.com/repos/carlhuda/bundler",
45
+ "name": "carlhuda/bundler",
46
+ "id": 488514
47
+ },
48
+ "public": true,
49
+ "org": {
50
+ "avatar_url": "https://secure.gravatar.com/avatar/2cb8fc28095b45feaadb133a7a96e560?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
51
+ "gravatar_id": "2cb8fc28095b45feaadb133a7a96e560",
52
+ "url": "https://api.github.com/orgs/carlhuda",
53
+ "login": "carlhuda",
54
+ "id": 76794
55
+ },
56
+ "payload": {
57
+ "head": "b5a7e2e2abe0e7f4fb71cc23fae86e3e84a8a580",
58
+ "size": 1,
59
+ "before": "8745b98251ebb424a7e25676e4ab5979137c1c88",
60
+ "commits": [
61
+ {
62
+ "distinct": true,
63
+ "sha": "b5a7e2e2abe0e7f4fb71cc23fae86e3e84a8a580",
64
+ "author": {
65
+ "email": "hone02@gmail.com",
66
+ "name": "Terence Lee"
67
+ },
68
+ "url": "https://api.github.com/repos/carlhuda/bundler/commits/b5a7e2e2abe0e7f4fb71cc23fae86e3e84a8a580",
69
+ "message": "bump 1.3.0.pre.5"
70
+ }
71
+ ],
72
+ "ref": "refs/heads/master",
73
+ "distinct_size": 1,
74
+ "push_id": 134055263
75
+ },
76
+ "id": "1652756032"
77
+ }
78
+ ]
@@ -24,6 +24,15 @@ describe Octokit::Client::Events do
24
24
  end
25
25
  end
26
26
 
27
+ describe ".user_public_events" do
28
+ it "returns public events performed by a GitHubber" do
29
+ stub_get("/users/sferik/events/public").
30
+ to_return json_response("user_performed_public_events.json")
31
+ user_public_events = @client.user_public_events("sferik")
32
+ expect(user_public_events.first.id).to eq("1652715007")
33
+ end
34
+ end
35
+
27
36
  describe ".received_events" do
28
37
  it "returns all user received events" do
29
38
  stub_get("/users/sferik/received_events").
@@ -33,6 +42,15 @@ describe Octokit::Client::Events do
33
42
  end
34
43
  end
35
44
 
45
+ describe ".received_public_events" do
46
+ it "returns public user received events" do
47
+ stub_get("/users/sferik/received_events/public").
48
+ to_return json_response("user_public_events.json")
49
+ received_public_events = @client.received_public_events("sferik")
50
+ expect(received_public_events.first.id).to eq("1652756065")
51
+ end
52
+ end
53
+
36
54
  describe ".repository_events" do
37
55
  it "returns events for a repository" do
38
56
  stub_get("/repos/sferik/rails_admin/events").
@@ -40,6 +58,33 @@ describe Octokit::Client::Events do
40
58
  repo_events = @client.repository_events("sferik/rails_admin")
41
59
  expect(repo_events.first.type).to eq("IssuesEvent")
42
60
  end
61
+ end
43
62
 
63
+ describe ".repository_network_events" do
64
+ it "returns events for a repository's network" do
65
+ stub_get("/networks/sferik/rails_admin/events").
66
+ to_return json_response("repository_network_events.json")
67
+ repo_network_events = @client.repository_network_events("sferik/rails_admin")
68
+ expect(repo_network_events.first.id).to eq("1651989733")
69
+ end
44
70
  end
71
+
72
+ describe ".organization_events" do
73
+ it "returns all events for an organization" do
74
+ stub_get("/users/sferik/events/orgs/lostisland").
75
+ to_return json_response("organization_events.json")
76
+ org_events = @client.organization_events("lostisland")
77
+ expect(org_events.first.id).to eq("1652750175")
78
+ end
79
+ end
80
+
81
+ describe ".organization_public_events" do
82
+ it "returns an organization's public events" do
83
+ stub_get("/orgs/github/events").
84
+ to_return json_response("organization_public_events.json")
85
+ org_public_events = @client.organization_public_events("github")
86
+ expect(org_public_events.first.id).to eq("1652750175")
87
+ end
88
+ end
89
+
45
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-12-22 00:00:00.000000000 Z
14
+ date: 2013-01-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
@@ -339,7 +339,9 @@ files:
339
339
  - spec/fixtures/organization-repositories.json
340
340
  - spec/fixtures/organization-repository.json
341
341
  - spec/fixtures/organization.json
342
+ - spec/fixtures/organization_events.json
342
343
  - spec/fixtures/organization_members.json
344
+ - spec/fixtures/organization_public_events.json
343
345
  - spec/fixtures/organization_team_members.json
344
346
  - spec/fixtures/organization_team_repos.json
345
347
  - spec/fixtures/organizations.json
@@ -373,6 +375,7 @@ files:
373
375
  - spec/fixtures/repositories.json
374
376
  - spec/fixtures/repository.json
375
377
  - spec/fixtures/repository_issues_comments.json
378
+ - spec/fixtures/repository_network_events.json
376
379
  - spec/fixtures/repository_notifications.json
377
380
  - spec/fixtures/say.txt
378
381
  - spec/fixtures/say_custom.txt
@@ -396,6 +399,8 @@ files:
396
399
  - spec/fixtures/tree_create.json
397
400
  - spec/fixtures/user.json
398
401
  - spec/fixtures/user_events.json
402
+ - spec/fixtures/user_performed_public_events.json
403
+ - spec/fixtures/user_public_events.json
399
404
  - spec/fixtures/validation_failed.json
400
405
  - spec/fixtures/watched.json
401
406
  - spec/fixtures/watchers.json
@@ -517,7 +522,9 @@ test_files:
517
522
  - spec/fixtures/organization-repositories.json
518
523
  - spec/fixtures/organization-repository.json
519
524
  - spec/fixtures/organization.json
525
+ - spec/fixtures/organization_events.json
520
526
  - spec/fixtures/organization_members.json
527
+ - spec/fixtures/organization_public_events.json
521
528
  - spec/fixtures/organization_team_members.json
522
529
  - spec/fixtures/organization_team_repos.json
523
530
  - spec/fixtures/organizations.json
@@ -551,6 +558,7 @@ test_files:
551
558
  - spec/fixtures/repositories.json
552
559
  - spec/fixtures/repository.json
553
560
  - spec/fixtures/repository_issues_comments.json
561
+ - spec/fixtures/repository_network_events.json
554
562
  - spec/fixtures/repository_notifications.json
555
563
  - spec/fixtures/say.txt
556
564
  - spec/fixtures/say_custom.txt
@@ -574,6 +582,8 @@ test_files:
574
582
  - spec/fixtures/tree_create.json
575
583
  - spec/fixtures/user.json
576
584
  - spec/fixtures/user_events.json
585
+ - spec/fixtures/user_performed_public_events.json
586
+ - spec/fixtures/user_public_events.json
577
587
  - spec/fixtures/validation_failed.json
578
588
  - spec/fixtures/watched.json
579
589
  - spec/fixtures/watchers.json