github_api 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/github_api/client/activity.rb +4 -0
- data/lib/github_api/client/activity/events.rb +43 -28
- data/lib/github_api/client/activity/feeds.rb +49 -0
- data/lib/github_api/client/activity/notifications.rb +19 -23
- data/lib/github_api/client/activity/starring.rb +4 -4
- data/lib/github_api/client/activity/watching.rb +3 -3
- data/lib/github_api/client/repos/releases/assets.rb +1 -1
- data/lib/github_api/configuration.rb +3 -0
- data/lib/github_api/middleware.rb +2 -0
- data/lib/github_api/response.rb +23 -3
- data/lib/github_api/response/atom_parser.rb +22 -0
- data/lib/github_api/response/xmlize.rb +2 -1
- data/lib/github_api/version.rb +1 -1
- metadata +20 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6826e6aa63062a779729043a6e29bf543e53eb13
|
4
|
+
data.tar.gz: cd5c5dafd529f688fc8ec51693bad0a6fff24912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bfd3e4f3a4dbbb82090b52d20ff2606609fe0b3dda8d838e7dff3258518c88955308ae9a87ffa46f613b5a5d32bda58e020b83089f9483dddf601f340addfbf
|
7
|
+
data.tar.gz: 46e9bc11f2d8021f9640c37720b0022134c766f4313ddbcd103efa441b895773a8720733c0bf39ac4dd102987aefb4a41375f2b4b34d78ad10a6d570027b2712
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
[![Code Climate](https://codeclimate.com/github/peter-murach/github/badges/gpa.svg)][codeclimate]
|
8
8
|
[![Coverage Status](https://coveralls.io/repos/peter-murach/github/badge.svg?branch=master)][coverage]
|
9
9
|
[![Inline docs](http://inch-ci.org/github/peter-murach/github.svg)][inchpages]
|
10
|
-
[![Dependency Status](https://gemnasium.com/peter-murach/github.
|
10
|
+
[![Dependency Status](https://gemnasium.com/peter-murach/github.svg?travis)][gemnasium]
|
11
11
|
|
12
12
|
[gem]: http://badge.fury.io/rb/github_api
|
13
13
|
[travis]: http://travis-ci.org/peter-murach/github
|
@@ -293,6 +293,7 @@ Alternatively, you can configure the settings by passing a block to an instance
|
|
293
293
|
Github.new do |c|
|
294
294
|
c.endpoint = 'https://github.company.com/api/v3'
|
295
295
|
c.site = 'https://github.company.com'
|
296
|
+
c.upload_endpoint = 'https://github.company.com/api/uploads'
|
296
297
|
end
|
297
298
|
```
|
298
299
|
|
@@ -563,13 +564,13 @@ github = Github.new auto_pagination: true
|
|
563
564
|
Depending at what stage you pass the `auto_pagination` it will affect all or only a single request. For example, in order to auto paginate all Repository API methods do:
|
564
565
|
|
565
566
|
```ruby
|
566
|
-
Github::Repos.new auto_pagination: true
|
567
|
+
Github::Сlient::Repos.new auto_pagination: true
|
567
568
|
```
|
568
569
|
|
569
570
|
However, to only auto paginate results for a single request do:
|
570
571
|
|
571
572
|
```ruby
|
572
|
-
Github::Repos.new.list user: '...', auto_pagination: true
|
573
|
+
Github::Client::Repos.new.list user: '...', auto_pagination: true
|
573
574
|
```
|
574
575
|
|
575
576
|
## 5 Error Handling
|
@@ -609,9 +610,9 @@ class GithubController < ApplicationController
|
|
609
610
|
access_token = github.get_token authorization_code
|
610
611
|
access_token.token # => returns token value
|
611
612
|
end
|
612
|
-
|
613
|
+
|
613
614
|
private
|
614
|
-
|
615
|
+
|
615
616
|
def github
|
616
617
|
@github ||= Github.new client_id: '...', client_secret: '...'
|
617
618
|
end
|
@@ -6,6 +6,7 @@ module Github
|
|
6
6
|
require_all 'github_api/client/activity',
|
7
7
|
'events',
|
8
8
|
'notifications',
|
9
|
+
'feeds',
|
9
10
|
'starring',
|
10
11
|
'watching'
|
11
12
|
|
@@ -15,6 +16,9 @@ module Github
|
|
15
16
|
# Access to Activity::Notifications API
|
16
17
|
namespace :notifications
|
17
18
|
|
19
|
+
# Access to Activity::Feeds API
|
20
|
+
namespace :feeds
|
21
|
+
|
18
22
|
# Access to Activity::Starring API
|
19
23
|
namespace :starring
|
20
24
|
|
@@ -2,9 +2,10 @@
|
|
2
2
|
|
3
3
|
module Github
|
4
4
|
class Client::Activity::Events < API
|
5
|
-
|
6
5
|
# List all public events
|
7
6
|
#
|
7
|
+
# @see https://developer.github.com/v3/activity/events/#list-public-events
|
8
|
+
#
|
8
9
|
# @example
|
9
10
|
# github = Github.new
|
10
11
|
# github.activity.events.public
|
@@ -18,9 +19,9 @@ module Github
|
|
18
19
|
return response unless block_given?
|
19
20
|
response.each { |el| yield el }
|
20
21
|
end
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
alias_method :public_events, :public
|
23
|
+
alias_method :list_public, :public
|
24
|
+
alias_method :list_public_events, :public
|
24
25
|
|
25
26
|
# List all repository events for a given user
|
26
27
|
#
|
@@ -41,10 +42,10 @@ module Github
|
|
41
42
|
return response unless block_given?
|
42
43
|
response.each { |el| yield el }
|
43
44
|
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
alias_method :repos, :repository
|
46
|
+
alias_method :repo_events, :repository
|
47
|
+
alias_method :repository_events, :repository
|
48
|
+
alias_method :list_repository_events, :repository
|
48
49
|
|
49
50
|
# List all issue events for a given repository
|
50
51
|
#
|
@@ -65,12 +66,14 @@ module Github
|
|
65
66
|
return response unless block_given?
|
66
67
|
response.each { |el| yield el }
|
67
68
|
end
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
alias_method :issues, :issue
|
70
|
+
alias_method :issue_events, :issue
|
71
|
+
alias_method :list_issue_events, :issue
|
71
72
|
|
72
73
|
# List all public events for a network of repositories
|
73
74
|
#
|
75
|
+
# @see https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories
|
76
|
+
#
|
74
77
|
# @example
|
75
78
|
# github = Github.new
|
76
79
|
# github.activity.events.network 'user-name', 'repo-name'
|
@@ -88,13 +91,15 @@ module Github
|
|
88
91
|
return response unless block_given?
|
89
92
|
response.each { |el| yield el }
|
90
93
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
alias_method :repo_network, :network
|
95
|
+
alias_method :repository_network, :network
|
96
|
+
alias_method :list_repo_network_events, :network
|
97
|
+
alias_method :list_repository_network_events, :network
|
95
98
|
|
96
99
|
# List all public events for an organization
|
97
100
|
#
|
101
|
+
# @see https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization
|
102
|
+
#
|
98
103
|
# @example
|
99
104
|
# github = Github.new
|
100
105
|
# github.activity.events.org 'org-name'
|
@@ -112,13 +117,15 @@ module Github
|
|
112
117
|
return response unless block_given?
|
113
118
|
response.each { |el| yield el }
|
114
119
|
end
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
120
|
+
alias_method :organization, :org
|
121
|
+
alias_method :list_orgs, :org
|
122
|
+
alias_method :list_org_events, :org
|
123
|
+
alias_method :list_organization_events, :org
|
119
124
|
|
120
125
|
# List all events that a user has received
|
121
126
|
#
|
127
|
+
# @see https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received
|
128
|
+
#
|
122
129
|
# These are events that you’ve received by watching repos
|
123
130
|
# and following users. If you are authenticated as the given user,
|
124
131
|
# you will see private events. Otherwise, you’ll only see public events.
|
@@ -130,6 +137,8 @@ module Github
|
|
130
137
|
#
|
131
138
|
# List all public events that a user has received
|
132
139
|
#
|
140
|
+
# @see https://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received
|
141
|
+
#
|
133
142
|
# @example
|
134
143
|
# github = Github.new
|
135
144
|
# github.activity.events.received 'user-name', public: true
|
@@ -149,11 +158,13 @@ module Github
|
|
149
158
|
return response unless block_given?
|
150
159
|
response.each { |el| yield el }
|
151
160
|
end
|
152
|
-
|
153
|
-
|
161
|
+
alias_method :user_received, :received
|
162
|
+
alias_method :list_user_received, :received
|
154
163
|
|
155
164
|
# List all events that a user has performed
|
156
165
|
#
|
166
|
+
# @see https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user
|
167
|
+
#
|
157
168
|
# If you are authenticated as the given user, you will see your private
|
158
169
|
# events. Otherwise, you’ll only see public events.
|
159
170
|
#
|
@@ -164,6 +175,8 @@ module Github
|
|
164
175
|
#
|
165
176
|
# List all public events that a user has performed
|
166
177
|
#
|
178
|
+
# @see https://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user
|
179
|
+
#
|
167
180
|
# @example
|
168
181
|
# github = Github.new
|
169
182
|
# github.activity.events.performed 'user-name', public: true
|
@@ -183,12 +196,14 @@ module Github
|
|
183
196
|
return response unless block_given?
|
184
197
|
response.each { |el| yield el }
|
185
198
|
end
|
186
|
-
|
187
|
-
|
199
|
+
alias_method :user_performed, :performed
|
200
|
+
alias_method :list_user_performed, :performed
|
188
201
|
|
189
202
|
# List all events for an organization
|
190
203
|
#
|
191
|
-
#
|
204
|
+
# @see https://developer.github.com/v3/activity/events/#list-events-for-an-organization
|
205
|
+
#
|
206
|
+
# This is the user's organization dashboard. You must be authenticated
|
192
207
|
# as the user to view this.
|
193
208
|
#
|
194
209
|
# @example
|
@@ -208,9 +223,9 @@ module Github
|
|
208
223
|
return response unless block_given?
|
209
224
|
response.each { |el| yield el }
|
210
225
|
end
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
226
|
+
alias_method :user_organization, :user_org
|
227
|
+
alias_method :list_user_org, :user_org
|
228
|
+
alias_method :list_user_org_events, :user_org
|
229
|
+
alias_method :list_user_organization_events, :user_org
|
215
230
|
end # Client::Activity::Events
|
216
231
|
end # Github
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Github
|
4
|
+
class Client::Activity::Feeds < API
|
5
|
+
|
6
|
+
# List all the feeds available to the authenticated user.
|
7
|
+
#
|
8
|
+
# @see https://developer.github.com/v3/activity/feeds/#list-feeds
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# github = Github.new
|
12
|
+
# github.activity.feeds.list
|
13
|
+
#
|
14
|
+
# @api public
|
15
|
+
def list(*args)
|
16
|
+
arguments(args)
|
17
|
+
|
18
|
+
response = get_request("/feeds", arguments.params)
|
19
|
+
return response unless block_given?
|
20
|
+
response.each { |el| yield el }
|
21
|
+
end
|
22
|
+
alias_method :all, :list
|
23
|
+
|
24
|
+
# Get all the items for a named timeline
|
25
|
+
#
|
26
|
+
# @see https://developer.github.com/v3/activity/feeds/#list-feeds
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# github = Github.new
|
30
|
+
# github.activity.feeds.get "timeline"
|
31
|
+
#
|
32
|
+
# @param [String] name
|
33
|
+
# the name of the timeline resource
|
34
|
+
#
|
35
|
+
# @api public
|
36
|
+
def get(*args)
|
37
|
+
arguments(args, required: [:name])
|
38
|
+
|
39
|
+
name = arguments.name
|
40
|
+
response = list.body._links[name]
|
41
|
+
if response
|
42
|
+
params = arguments.params
|
43
|
+
params['accept'] = response.type
|
44
|
+
get_request(response.href, params)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
alias_method :find, :get
|
48
|
+
end
|
49
|
+
end # Github
|
@@ -35,21 +35,19 @@ module Github
|
|
35
35
|
#
|
36
36
|
# @api public
|
37
37
|
def list(*args)
|
38
|
-
arguments(args)
|
39
|
-
permit %w[ all participating since user repo]
|
40
|
-
end
|
38
|
+
arguments(args)
|
41
39
|
params = arguments.params
|
42
40
|
|
43
|
-
response = if ( (user_name = params.delete(
|
44
|
-
(repo_name = params.delete(
|
41
|
+
response = if ( (user_name = params.delete('user')) &&
|
42
|
+
(repo_name = params.delete('repo')) )
|
45
43
|
get_request("/repos/#{user_name}/#{repo_name}/notifications", params)
|
46
44
|
else
|
47
|
-
get_request(
|
45
|
+
get_request('/notifications', params)
|
48
46
|
end
|
49
47
|
return response unless block_given?
|
50
48
|
response.each { |el| yield el }
|
51
49
|
end
|
52
|
-
|
50
|
+
alias_method :all, :list
|
53
51
|
|
54
52
|
# View a single thread
|
55
53
|
#
|
@@ -62,13 +60,13 @@ module Github
|
|
62
60
|
#
|
63
61
|
# @api public
|
64
62
|
def get(*args)
|
65
|
-
arguments(args, required: [:
|
63
|
+
arguments(args, required: [:thread_id])
|
66
64
|
|
67
|
-
response = get_request("/notifications/threads/#{arguments.
|
65
|
+
response = get_request("/notifications/threads/#{arguments.thread_id}", arguments.params)
|
68
66
|
return response unless block_given?
|
69
67
|
response.each { |el| yield el }
|
70
68
|
end
|
71
|
-
|
69
|
+
alias_method :find, :get
|
72
70
|
|
73
71
|
# Mark as read
|
74
72
|
#
|
@@ -103,19 +101,17 @@ module Github
|
|
103
101
|
#
|
104
102
|
# @api public
|
105
103
|
def mark(*args)
|
106
|
-
arguments(args)
|
107
|
-
permit %w[ unread read last_read_at user repo id]
|
108
|
-
end
|
104
|
+
arguments(args)
|
109
105
|
params = arguments.params
|
110
106
|
|
111
|
-
if ( (user_name = params.delete(
|
112
|
-
(repo_name = params.delete(
|
107
|
+
if ( (user_name = params.delete('user')) &&
|
108
|
+
(repo_name = params.delete('repo')) )
|
113
109
|
|
114
110
|
put_request("/repos/#{user_name}/#{repo_name}/notifications", params)
|
115
111
|
elsif (thread_id = params.delete("id"))
|
116
112
|
patch_request("/notifications/threads/#{thread_id}", params)
|
117
113
|
else
|
118
|
-
put_request(
|
114
|
+
put_request('/notifications', params)
|
119
115
|
end
|
120
116
|
end
|
121
117
|
|
@@ -132,9 +128,9 @@ module Github
|
|
132
128
|
#
|
133
129
|
# @api public
|
134
130
|
def subscribed?(*args)
|
135
|
-
arguments(args, required: [:
|
131
|
+
arguments(args, required: [:thread_id])
|
136
132
|
|
137
|
-
get_request("/notifications/threads/#{arguments.
|
133
|
+
get_request("/notifications/threads/#{arguments.thread_id}/subscription", arguments.params)
|
138
134
|
end
|
139
135
|
|
140
136
|
# Create a thread subscription
|
@@ -160,9 +156,9 @@ module Github
|
|
160
156
|
#
|
161
157
|
# @api public
|
162
158
|
def create(*args)
|
163
|
-
arguments(args, required: [:
|
159
|
+
arguments(args, required: [:thread_id])
|
164
160
|
|
165
|
-
put_request("/notifications/threads/#{arguments.
|
161
|
+
put_request("/notifications/threads/#{arguments.thread_id}/subscription", arguments.params)
|
166
162
|
end
|
167
163
|
|
168
164
|
# Delete a thread subscription
|
@@ -175,10 +171,10 @@ module Github
|
|
175
171
|
#
|
176
172
|
# @api public
|
177
173
|
def delete(*args)
|
178
|
-
arguments(args, required: [:
|
174
|
+
arguments(args, required: [:thread_id])
|
179
175
|
|
180
|
-
delete_request("/notifications/threads/#{arguments.
|
176
|
+
delete_request("/notifications/threads/#{arguments.thread_id}/subscription", arguments.params)
|
181
177
|
end
|
182
|
-
|
178
|
+
alias_method :remove, :delete
|
183
179
|
end # Client::Activity::Notifications
|
184
180
|
end # Github
|
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
module Github
|
4
4
|
# Repository Starring is a feature that lets users bookmark repositories.
|
5
|
-
# Stars are shown next to repositories to show an approximate level of interest.
|
5
|
+
# Stars are shown next to repositories to show an approximate level of interest.
|
6
|
+
# Stars have no effect on notifications or the activity feed.
|
6
7
|
class Client::Activity::Starring < API
|
7
8
|
# List stargazers
|
8
9
|
#
|
@@ -21,7 +22,7 @@ module Github
|
|
21
22
|
return response unless block_given?
|
22
23
|
response.each { |el| yield el }
|
23
24
|
end
|
24
|
-
|
25
|
+
alias_method :all, :list
|
25
26
|
|
26
27
|
# List repos being starred by a user
|
27
28
|
#
|
@@ -54,7 +55,7 @@ module Github
|
|
54
55
|
response = if (user_name = params.delete('user'))
|
55
56
|
get_request("/users/#{user_name}/starred", params)
|
56
57
|
else
|
57
|
-
get_request(
|
58
|
+
get_request('/user/starred', params)
|
58
59
|
end
|
59
60
|
return response unless block_given?
|
60
61
|
response.each { |el| yield el }
|
@@ -62,7 +63,6 @@ module Github
|
|
62
63
|
|
63
64
|
# Check if you are starring a repository
|
64
65
|
#
|
65
|
-
#
|
66
66
|
# @see https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository
|
67
67
|
#
|
68
68
|
# @example
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Github
|
4
4
|
# Watching a Repository registers the user to receive notificactions on new
|
5
|
-
# discussions, as well as events in the user
|
5
|
+
# discussions, as well as events in the user's activity feed.
|
6
6
|
class Client::Activity::Watching < API
|
7
7
|
# List repository watchers
|
8
8
|
#
|
@@ -21,7 +21,7 @@ module Github
|
|
21
21
|
return response unless block_given?
|
22
22
|
response.each { |el| yield el }
|
23
23
|
end
|
24
|
-
|
24
|
+
alias_method :all, :list
|
25
25
|
|
26
26
|
# List repos being watched by a user
|
27
27
|
#
|
@@ -45,7 +45,7 @@ module Github
|
|
45
45
|
response = if (user_name = params.delete('user'))
|
46
46
|
get_request("/users/#{user_name}/subscriptions", params)
|
47
47
|
else
|
48
|
-
get_request(
|
48
|
+
get_request('/user/subscriptions', params)
|
49
49
|
end
|
50
50
|
return response unless block_given?
|
51
51
|
response.each { |el| yield el }
|
@@ -70,7 +70,7 @@ module Github
|
|
70
70
|
file = Faraday::UploadIO.new(arguments.filepath, type)
|
71
71
|
options = {
|
72
72
|
headers: { content_type: type },
|
73
|
-
endpoint:
|
73
|
+
endpoint: upload_endpoint,
|
74
74
|
query: {'name' => params['name']}
|
75
75
|
}
|
76
76
|
params['data'] = file.read
|
@@ -30,6 +30,9 @@ module Github
|
|
30
30
|
# The web endpoint used to connect to GitHub if none is set
|
31
31
|
property :site, default: 'https://github.com'.freeze
|
32
32
|
|
33
|
+
# The web endpoint used to upload release assets to GitHub if none is set
|
34
|
+
property :upload_endpoint, default: 'https://uploads.github.com'.freeze
|
35
|
+
|
33
36
|
# The default SSL configuration
|
34
37
|
property :ssl, default: {
|
35
38
|
:ca_file => File.expand_path('../ssl_certs/cacerts.pem', __FILE__)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'github_api/response'
|
4
4
|
require 'github_api/response/mashify'
|
5
5
|
require 'github_api/response/jsonize'
|
6
|
+
require 'github_api/response/atom_parser'
|
6
7
|
require 'github_api/response/raise_error'
|
7
8
|
require 'github_api/response/header'
|
8
9
|
|
@@ -21,6 +22,7 @@ module Github
|
|
21
22
|
unless options[:raw]
|
22
23
|
builder.use Github::Response::Mashify
|
23
24
|
builder.use Github::Response::Jsonize
|
25
|
+
builder.use Github::Response::AtomParser
|
24
26
|
end
|
25
27
|
builder.use Github::Response::RaiseError
|
26
28
|
builder.adapter options[:adapter]
|
data/lib/github_api/response.rb
CHANGED
@@ -16,13 +16,33 @@ module Github
|
|
16
16
|
@parser = block
|
17
17
|
end
|
18
18
|
|
19
|
+
def initialize(app, options = {})
|
20
|
+
super(app)
|
21
|
+
@content_types = Array(options[:content_type])
|
22
|
+
end
|
23
|
+
|
24
|
+
def process_body(env)
|
25
|
+
env[:body] = parse(env[:body])
|
26
|
+
end
|
27
|
+
|
28
|
+
def parse_body?(env)
|
29
|
+
parse_response_type?(response_type(env)) and parse_response?(env)
|
30
|
+
end
|
31
|
+
|
19
32
|
def response_type(env)
|
20
|
-
env[:response_headers][CONTENT_TYPE].to_s
|
33
|
+
type = env[:response_headers][CONTENT_TYPE].to_s
|
34
|
+
type = type.split(';', 2).first if type.index(';')
|
35
|
+
type
|
21
36
|
end
|
22
37
|
|
23
|
-
def
|
24
|
-
|
38
|
+
def parse_response_type?(type)
|
39
|
+
@content_types.empty? || @content_types.any? { |pattern|
|
40
|
+
pattern.is_a?(Regexp) ? type =~ pattern : type == pattern
|
41
|
+
}
|
25
42
|
end
|
26
43
|
|
44
|
+
def parse_response?(env)
|
45
|
+
env[:body].respond_to?(:to_str)
|
46
|
+
end
|
27
47
|
end # Response
|
28
48
|
end # Github
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'faraday'
|
4
|
+
|
5
|
+
module Github
|
6
|
+
class Response::AtomParser < Response
|
7
|
+
define_parser do |body|
|
8
|
+
require 'rss'
|
9
|
+
RSS::Parser.parse(body)
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(app, options = {})
|
13
|
+
super(app, options.merge(content_type: /(\batom|\brss)/))
|
14
|
+
end
|
15
|
+
|
16
|
+
def on_complete(env)
|
17
|
+
if parse_body?(env)
|
18
|
+
process_body(env)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -4,6 +4,7 @@ require 'faraday'
|
|
4
4
|
|
5
5
|
module Github
|
6
6
|
class Response::Xmlize < Response
|
7
|
+
|
7
8
|
dependency 'nokogiri'
|
8
9
|
|
9
10
|
define_parser do |body|
|
@@ -19,7 +20,7 @@ module Github
|
|
19
20
|
when 'false'
|
20
21
|
false
|
21
22
|
else
|
22
|
-
self.class.parser.call
|
23
|
+
self.class.parser.call(body)
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end # Response::Xmlize
|
data/lib/github_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hashie
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,47 +93,47 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
96
|
+
name: descendants_tracker
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 0.0.4
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - ~>
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: 0.0.4
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
|
-
name:
|
110
|
+
name: bundler
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- -
|
113
|
+
- - '>='
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: 0
|
116
|
-
type: :
|
115
|
+
version: '0'
|
116
|
+
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- -
|
120
|
+
- - '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0
|
122
|
+
version: '0'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
124
|
+
name: rake
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- -
|
127
|
+
- - '>='
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
129
|
+
version: '0'
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
|
-
- -
|
134
|
+
- - '>='
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
136
|
+
version: '0'
|
137
137
|
description: ' Ruby client that supports all of the GitHub API methods. It''s build
|
138
138
|
in a modular way, that is, you can either instantiate the whole api wrapper Github.new
|
139
139
|
or use parts of it e.i. Github::Client::Repos.new if working solely with repositories
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- lib/github_api/api.rb
|
155
155
|
- lib/github_api/authorization.rb
|
156
156
|
- lib/github_api/client/activity/events.rb
|
157
|
+
- lib/github_api/client/activity/feeds.rb
|
157
158
|
- lib/github_api/client/activity/notifications.rb
|
158
159
|
- lib/github_api/client/activity/starring.rb
|
159
160
|
- lib/github_api/client/activity/watching.rb
|
@@ -254,6 +255,7 @@ files:
|
|
254
255
|
- lib/github_api/request.rb
|
255
256
|
- lib/github_api/requestable.rb
|
256
257
|
- lib/github_api/resource.rb
|
258
|
+
- lib/github_api/response/atom_parser.rb
|
257
259
|
- lib/github_api/response/header.rb
|
258
260
|
- lib/github_api/response/jsonize.rb
|
259
261
|
- lib/github_api/response/mashify.rb
|