octokit 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/octokit/authentication.rb +4 -4
- data/lib/octokit/client.rb +70 -5
- data/lib/octokit/client/authorizations.rb +123 -29
- data/lib/octokit/client/commit_comments.rb +7 -7
- data/lib/octokit/client/commits.rb +11 -11
- data/lib/octokit/client/contents.rb +7 -7
- data/lib/octokit/client/deployments.rb +5 -5
- data/lib/octokit/client/downloads.rb +5 -5
- data/lib/octokit/client/emojis.rb +1 -1
- data/lib/octokit/client/events.rb +15 -15
- data/lib/octokit/client/feeds.rb +2 -2
- data/lib/octokit/client/gists.rb +17 -17
- data/lib/octokit/client/gitignore.rb +3 -3
- data/lib/octokit/client/hooks.rb +1 -1
- data/lib/octokit/client/issues.rb +16 -16
- data/lib/octokit/client/labels.rb +14 -14
- data/lib/octokit/client/legacy_search.rb +3 -3
- data/lib/octokit/client/markdown.rb +2 -2
- data/lib/octokit/client/meta.rb +2 -2
- data/lib/octokit/client/milestones.rb +6 -6
- data/lib/octokit/client/notifications.rb +10 -10
- data/lib/octokit/client/objects.rb +8 -8
- data/lib/octokit/client/organizations.rb +30 -30
- data/lib/octokit/client/pages.rb +4 -4
- data/lib/octokit/client/pub_sub_hubbub.rb +5 -5
- data/lib/octokit/client/pull_requests.rb +20 -20
- data/lib/octokit/client/rate_limit.rb +5 -5
- data/lib/octokit/client/refs.rb +9 -9
- data/lib/octokit/client/releases.rb +11 -11
- data/lib/octokit/client/repositories.rb +44 -44
- data/lib/octokit/client/search.rb +5 -5
- data/lib/octokit/client/stats.rb +6 -6
- data/lib/octokit/client/statuses.rb +3 -3
- data/lib/octokit/client/users.rb +36 -36
- data/lib/octokit/configurable.rb +4 -4
- data/lib/octokit/error.rb +4 -0
- data/lib/octokit/rate_limit.rb +1 -1
- data/lib/octokit/version.rb +1 -1
- metadata +9 -9
@@ -3,14 +3,14 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Organizations API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/orgs/
|
7
7
|
module Organizations
|
8
8
|
|
9
9
|
# Get an organization
|
10
10
|
#
|
11
11
|
# @param org [String] Organization GitHub username.
|
12
12
|
# @return [Sawyer::Resource] Hash representing GitHub organization.
|
13
|
-
# @see
|
13
|
+
# @see https://developer.github.com/v3/orgs/#get-an-organization
|
14
14
|
# @example
|
15
15
|
# Octokit.organization('github')
|
16
16
|
# @example
|
@@ -32,7 +32,7 @@ module Octokit
|
|
32
32
|
# @option values [String] :location Location of organization.
|
33
33
|
# @option values [String] :name GitHub username for organization.
|
34
34
|
# @return [Sawyer::Resource] Hash representing GitHub organization.
|
35
|
-
# @see
|
35
|
+
# @see https://developer.github.com/v3/orgs/#edit-an-organization
|
36
36
|
# @example
|
37
37
|
# @client.update_organization('github', {
|
38
38
|
# :billing_email => 'support@github.com',
|
@@ -61,7 +61,7 @@ module Octokit
|
|
61
61
|
#
|
62
62
|
# @param user [String] Username of the user to get list of organizations.
|
63
63
|
# @return [Array<Sawyer::Resource>] Array of hashes representing organizations.
|
64
|
-
# @see
|
64
|
+
# @see https://developer.github.com/v3/orgs/#list-user-organizations
|
65
65
|
# @example
|
66
66
|
# Octokit.organizations('pengwynn')
|
67
67
|
# @example
|
@@ -95,7 +95,7 @@ module Octokit
|
|
95
95
|
# `all`, `public`, `member`, `sources`, `forks`, or `private`.
|
96
96
|
#
|
97
97
|
# @return [Array<Sawyer::Resource>] List of repositories
|
98
|
-
# @see
|
98
|
+
# @see https://developer.github.com/v3/repos/#list-organization-repositories
|
99
99
|
# @example
|
100
100
|
# Octokit.organization_repositories('github')
|
101
101
|
# @example
|
@@ -118,7 +118,7 @@ module Octokit
|
|
118
118
|
#
|
119
119
|
# @param org [String] Organization GitHub username.
|
120
120
|
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
121
|
-
# @see
|
121
|
+
# @see https://developer.github.com/v3/orgs/members/#members-list
|
122
122
|
# @example
|
123
123
|
# Octokit.organization_members('github')
|
124
124
|
# @example
|
@@ -135,7 +135,7 @@ module Octokit
|
|
135
135
|
#
|
136
136
|
# @param org [String] Organization GitHub username.
|
137
137
|
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
138
|
-
# @see
|
138
|
+
# @see https://developer.github.com/v3/orgs/members/#public-members-list
|
139
139
|
# @example
|
140
140
|
# Octokit.organization_public_members('github')
|
141
141
|
# @example
|
@@ -156,7 +156,7 @@ module Octokit
|
|
156
156
|
#
|
157
157
|
# @return [Boolean] Is a member?
|
158
158
|
#
|
159
|
-
# @see
|
159
|
+
# @see https://developer.github.com/v3/orgs/members/#check-membership
|
160
160
|
#
|
161
161
|
# @example Check if a user is in your organization
|
162
162
|
# @client.organization_member?('your_organization', 'pengwynn')
|
@@ -181,7 +181,7 @@ module Octokit
|
|
181
181
|
#
|
182
182
|
# @return [Boolean] Is a public member?
|
183
183
|
#
|
184
|
-
# @see
|
184
|
+
# @see https://developer.github.com/v3/orgs/members/#check-public-membership
|
185
185
|
#
|
186
186
|
# @example Check if a user is a hubbernaut
|
187
187
|
# @client.organization_public_member?('github', 'pengwynn')
|
@@ -197,13 +197,13 @@ module Octokit
|
|
197
197
|
#
|
198
198
|
# @param org [String] Organization GitHub username.
|
199
199
|
# @return [Array<Sawyer::Resource>] Array of hashes representing teams.
|
200
|
-
# @see
|
200
|
+
# @see https://developer.github.com/v3/orgs/teams/#list-teams
|
201
201
|
# @example
|
202
202
|
# @client.organization_teams('github')
|
203
203
|
# @example
|
204
204
|
# @client.org_teams('github')
|
205
205
|
def organization_teams(org, options = {})
|
206
|
-
|
206
|
+
paginate "orgs/#{org}/teams", options
|
207
207
|
end
|
208
208
|
alias :org_teams :organization_teams
|
209
209
|
|
@@ -221,11 +221,11 @@ module Octokit
|
|
221
221
|
# `push` - team members can pull and push, but not administer these repositories.
|
222
222
|
# `admin` - team members can pull, push and administer these repositories.
|
223
223
|
# @return [Sawyer::Resource] Hash representing new team.
|
224
|
-
# @see
|
224
|
+
# @see https://developer.github.com/v3/orgs/teams/#create-team
|
225
225
|
# @example
|
226
226
|
# @client.create_team('github', {
|
227
227
|
# :name => 'Designers',
|
228
|
-
# :repo_names => ['
|
228
|
+
# :repo_names => ['github/dotfiles'],
|
229
229
|
# :permission => 'push'
|
230
230
|
# })
|
231
231
|
def create_team(org, options = {})
|
@@ -238,7 +238,7 @@ module Octokit
|
|
238
238
|
#
|
239
239
|
# @param team_id [Integer] Team id.
|
240
240
|
# @return [Sawyer::Resource] Hash representing team.
|
241
|
-
# @see
|
241
|
+
# @see https://developer.github.com/v3/orgs/teams/#get-team
|
242
242
|
# @example
|
243
243
|
# @client.team(100000)
|
244
244
|
def team(team_id, options = {})
|
@@ -257,7 +257,7 @@ module Octokit
|
|
257
257
|
# `push` - team members can pull and push, but not administer these repositories.
|
258
258
|
# `admin` - team members can pull, push and administer these repositories.
|
259
259
|
# @return [Sawyer::Resource] Hash representing updated team.
|
260
|
-
# @see
|
260
|
+
# @see https://developer.github.com/v3/orgs/teams/#edit-team
|
261
261
|
# @example
|
262
262
|
# @client.update_team(100000, {
|
263
263
|
# :name => 'Front-end Designers',
|
@@ -273,7 +273,7 @@ module Octokit
|
|
273
273
|
#
|
274
274
|
# @param team_id [Integer] Team id.
|
275
275
|
# @return [Boolean] True if deletion successful, false otherwise.
|
276
|
-
# @see
|
276
|
+
# @see https://developer.github.com/v3/orgs/teams/#delete-team
|
277
277
|
# @example
|
278
278
|
# @client.delete_team(100000)
|
279
279
|
def delete_team(team_id, options = {})
|
@@ -286,11 +286,11 @@ module Octokit
|
|
286
286
|
#
|
287
287
|
# @param team_id [Integer] Team id.
|
288
288
|
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
289
|
-
# @see
|
289
|
+
# @see https://developer.github.com/v3/orgs/teams/#list-team-members
|
290
290
|
# @example
|
291
291
|
# @client.team_members(100000)
|
292
292
|
def team_members(team_id, options = {})
|
293
|
-
|
293
|
+
paginate "teams/#{team_id}/members", options
|
294
294
|
end
|
295
295
|
|
296
296
|
# Add team member
|
@@ -301,7 +301,7 @@ module Octokit
|
|
301
301
|
# @param team_id [Integer] Team id.
|
302
302
|
# @param user [String] GitHub username of new team member.
|
303
303
|
# @return [Boolean] True on successful addition, false otherwise.
|
304
|
-
# @see
|
304
|
+
# @see https://developer.github.com/v3/orgs/teams/#add-team-member
|
305
305
|
# @example
|
306
306
|
# @client.add_team_member(100000, 'pengwynn')
|
307
307
|
def add_team_member(team_id, user, options = {})
|
@@ -319,7 +319,7 @@ module Octokit
|
|
319
319
|
# @param team_id [Integer] Team id.
|
320
320
|
# @param user [String] GitHub username of the user to boot.
|
321
321
|
# @return [Boolean] True if user removed, false otherwise.
|
322
|
-
# @see
|
322
|
+
# @see https://developer.github.com/v3/orgs/teams/#remove-team-member
|
323
323
|
# @example
|
324
324
|
# @client.remove_team_member(100000, 'pengwynn')
|
325
325
|
def remove_team_member(team_id, user, options = {})
|
@@ -336,7 +336,7 @@ module Octokit
|
|
336
336
|
#
|
337
337
|
# @return [Boolean] Is a member?
|
338
338
|
#
|
339
|
-
# @see
|
339
|
+
# @see https://developer.github.com/v3/orgs/teams/#get-team-member
|
340
340
|
#
|
341
341
|
# @example Check if a user is in your team
|
342
342
|
# @client.team_member?('your_team', 'pengwynn')
|
@@ -351,13 +351,13 @@ module Octokit
|
|
351
351
|
#
|
352
352
|
# @param team_id [Integer] Team id.
|
353
353
|
# @return [Array<Sawyer::Resource>] Array of hashes representing repositories.
|
354
|
-
# @see
|
354
|
+
# @see https://developer.github.com/v3/orgs/teams/#list-team-repos
|
355
355
|
# @example
|
356
356
|
# @client.team_repositories(100000)
|
357
357
|
# @example
|
358
358
|
# @client.team_repos(100000)
|
359
359
|
def team_repositories(team_id, options = {})
|
360
|
-
|
360
|
+
paginate "teams/#{team_id}/repos", options
|
361
361
|
end
|
362
362
|
alias :team_repos :team_repositories
|
363
363
|
|
@@ -368,7 +368,7 @@ module Octokit
|
|
368
368
|
# @return [Boolean] True if managed by a team. False if not managed by
|
369
369
|
# the team OR the requesting user does not have authorization to access
|
370
370
|
# the team information.
|
371
|
-
# @see
|
371
|
+
# @see https://developer.github.com/v3/orgs/teams/#get-team-repo
|
372
372
|
# @example
|
373
373
|
# @client.team_repository?(8675309, 'octokit/octokit.rb')
|
374
374
|
# @example
|
@@ -388,7 +388,7 @@ module Octokit
|
|
388
388
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
389
389
|
# @return [Boolean] True if successful, false otherwise.
|
390
390
|
# @see Octokit::Repository
|
391
|
-
# @see
|
391
|
+
# @see https://developer.github.com/v3/orgs/teams/#add-team-repo
|
392
392
|
# @example
|
393
393
|
# @client.add_team_repository(100000, 'github/developer.github.com')
|
394
394
|
# @example
|
@@ -408,7 +408,7 @@ module Octokit
|
|
408
408
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
409
409
|
# @return [Boolean] Return true if repo removed from team, false otherwise.
|
410
410
|
# @see Octokit::Repository
|
411
|
-
# @see
|
411
|
+
# @see https://developer.github.com/v3/orgs/teams/#remove-team-repo
|
412
412
|
# @example
|
413
413
|
# @client.remove_team_repository(100000, 'github/developer.github.com')
|
414
414
|
# @example
|
@@ -425,7 +425,7 @@ module Octokit
|
|
425
425
|
# @param org [String] Organization GitHub username.
|
426
426
|
# @param user [String] GitHub username of user to remove.
|
427
427
|
# @return [Boolean] True if removal is successful, false otherwise.
|
428
|
-
# @see
|
428
|
+
# @see https://developer.github.com/v3/orgs/members/#remove-a-member
|
429
429
|
# @example
|
430
430
|
# @client.remove_organization_member('github', 'pengwynn')
|
431
431
|
# @example
|
@@ -444,7 +444,7 @@ module Octokit
|
|
444
444
|
# @param org [String] Organization GitHub username.
|
445
445
|
# @param user [String] GitHub username of user to publicize.
|
446
446
|
# @return [Boolean] True if publicization successful, false otherwise.
|
447
|
-
# @see
|
447
|
+
# @see https://developer.github.com/v3/orgs/members/#publicize-a-users-membership
|
448
448
|
# @example
|
449
449
|
# @client.publicize_membership('github', 'pengwynn')
|
450
450
|
def publicize_membership(org, user, options = {})
|
@@ -458,7 +458,7 @@ module Octokit
|
|
458
458
|
# @param org [String] Organization GitHub username.
|
459
459
|
# @param user [String] GitHub username of user to unpublicize.
|
460
460
|
# @return [Boolean] True of unpublicization successful, false otherwise.
|
461
|
-
# @see
|
461
|
+
# @see https://developer.github.com/v3/orgs/members/#conceal-a-users-membership
|
462
462
|
# @example
|
463
463
|
# @client.unpublicize_membership('github', 'pengwynn')
|
464
464
|
# @example
|
@@ -471,7 +471,7 @@ module Octokit
|
|
471
471
|
# List all teams for the authenticated user across all their orgs
|
472
472
|
#
|
473
473
|
# @return [Array<Sawyer::Resource>] Array of team resources.
|
474
|
-
# @see
|
474
|
+
# @see https://developer.github.com/v3/orgs/teams/#list-user-teams
|
475
475
|
def user_teams(options = {})
|
476
476
|
paginate "/user/teams", options
|
477
477
|
end
|
data/lib/octokit/client/pages.rb
CHANGED
@@ -3,14 +3,14 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Pages API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/repos/pages/
|
7
7
|
module Pages
|
8
8
|
|
9
9
|
# List Pages information for a repository
|
10
10
|
#
|
11
11
|
# @param repo [String, Repository, Hash] A GitHub repository
|
12
12
|
# @return Sawyer::Resource A GitHub Pages resource
|
13
|
-
# @see
|
13
|
+
# @see https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site
|
14
14
|
def pages(repo, options = {})
|
15
15
|
get "repos/#{Repository.new(repo)}/pages", options
|
16
16
|
end
|
@@ -19,7 +19,7 @@ module Octokit
|
|
19
19
|
#
|
20
20
|
# @param repo [String, Repository, Hash] A GitHub repository
|
21
21
|
# @return [Array<Sawyer::Resource>] A list of build history for a repository.
|
22
|
-
# @see
|
22
|
+
# @see https://developer.github.com/v3/repos/pages/#list-pages-builds
|
23
23
|
def pages_builds(repo, options = {})
|
24
24
|
get "repos/#{Repository.new(repo)}/pages/builds", options
|
25
25
|
end
|
@@ -29,7 +29,7 @@ module Octokit
|
|
29
29
|
#
|
30
30
|
# @param repo [String, Repository, Hash] A GitHub repository
|
31
31
|
# @return Sawyer::Resource A GitHub Pages resource about a build
|
32
|
-
# @see
|
32
|
+
# @see https://developer.github.com/v3/repos/pages/#list-latest-pages-build
|
33
33
|
def latest_pages_build(repo, options = {})
|
34
34
|
get "repos/#{Repository.new(repo)}/pages/builds/latest", options
|
35
35
|
end
|
@@ -10,7 +10,7 @@ module Octokit
|
|
10
10
|
|
11
11
|
# Methods for the PubSubHubbub API
|
12
12
|
#
|
13
|
-
# @see
|
13
|
+
# @see https://developer.github.com/v3/repos/hooks/#pubsubhubbub
|
14
14
|
module PubSubHubbub
|
15
15
|
|
16
16
|
# Subscribe to a pubsub topic
|
@@ -19,7 +19,7 @@ module Octokit
|
|
19
19
|
# @param callback [String] A callback url to be posted to when the topic event is fired
|
20
20
|
# @param secret [String] An optional shared secret used to generate a SHA1 HMAC of the outgoing body content
|
21
21
|
# @return [Boolean] true if the subscribe was successful, otherwise an error is raised
|
22
|
-
# @see
|
22
|
+
# @see https://developer.github.com/v3/repos/hooks/#subscribing
|
23
23
|
# @example Subscribe to push events from one of your repositories, having an email sent when fired
|
24
24
|
# client = Octokit::Client.new(:oauth_token = "token")
|
25
25
|
# client.subscribe("https://github.com/joshk/devise_imapable/events/push", "github://Email?address=josh.kalderimis@gmail.com")
|
@@ -41,7 +41,7 @@ module Octokit
|
|
41
41
|
# @param topic [String] A recoginized pubsub topic
|
42
42
|
# @param callback [String] A callback url to be unsubscribed from
|
43
43
|
# @return [Boolean] true if the unsubscribe was successful, otherwise an error is raised
|
44
|
-
# @see
|
44
|
+
# @see https://developer.github.com/v3/repos/hooks/#subscribing
|
45
45
|
# @example Unsubscribe to push events from one of your repositories, no longer having an email sent when fired
|
46
46
|
# client = Octokit::Client.new(:oauth_token = "token")
|
47
47
|
# client.unsubscribe("https://github.com/joshk/devise_imapable/events/push", "github://Email?address=josh.kalderimis@gmail.com")
|
@@ -65,7 +65,7 @@ module Octokit
|
|
65
65
|
# Please refer Data node for complete list of arguments.
|
66
66
|
# @param secret [String] An optional shared secret used to generate a SHA1 HMAC of the outgoing body content
|
67
67
|
# @return [Boolean] True if subscription successful, false otherwise
|
68
|
-
# @see
|
68
|
+
# @see https://developer.github.com/v3/repos/hooks/#subscribing
|
69
69
|
# @example Subscribe to push events to one of your repositories to Travis-CI
|
70
70
|
# client = Octokit::Client.new(:oauth_token = "token")
|
71
71
|
# client.subscribe_service_hook('joshk/device_imapable', 'Travis', { :token => "test", :domain => "domain", :user => "user" })
|
@@ -80,7 +80,7 @@ module Octokit
|
|
80
80
|
# @param repo [String, Repository, Hash] A GitHub repository
|
81
81
|
# @param service_name [String] service name owner
|
82
82
|
# List of services is available @ https://github.com/github/github-services/tree/master/docs.
|
83
|
-
# @see
|
83
|
+
# @see https://developer.github.com/v3/repos/hooks/#subscribing
|
84
84
|
# @example Subscribe to push events to one of your repositories to Travis-CI
|
85
85
|
# client = Octokit::Client.new(:oauth_token = "token")
|
86
86
|
# client.unsubscribe_service_hook('joshk/device_imapable', 'Travis')
|
@@ -3,7 +3,7 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Pull Requests API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/pulls/
|
7
7
|
module PullRequests
|
8
8
|
|
9
9
|
# List pull requests for a repository
|
@@ -18,7 +18,7 @@ module Octokit
|
|
18
18
|
# @param state [String] `open` or `closed`.
|
19
19
|
# @param options [Hash] Method options
|
20
20
|
# @return [Array<Sawyer::Resource>] Array of pulls
|
21
|
-
# @see
|
21
|
+
# @see https://developer.github.com/v3/pulls/#list-pull-requests
|
22
22
|
# @example
|
23
23
|
# Octokit.pull_requests('rails/rails', :state => 'closed')
|
24
24
|
def pull_requests(*args)
|
@@ -35,7 +35,7 @@ module Octokit
|
|
35
35
|
|
36
36
|
# Get a pull request
|
37
37
|
#
|
38
|
-
# @see
|
38
|
+
# @see https://developer.github.com/v3/pulls/#get-a-single-pull-request
|
39
39
|
# @param repo [String, Hash, Repository] A GitHub repository
|
40
40
|
# @param number [Integer] Number of the pull request to fetch
|
41
41
|
# @return [Sawyer::Resource] Pull request info
|
@@ -46,7 +46,7 @@ module Octokit
|
|
46
46
|
|
47
47
|
# Create a pull request
|
48
48
|
#
|
49
|
-
# @see
|
49
|
+
# @see https://developer.github.com/v3/pulls/#create-a-pull-request
|
50
50
|
# @param repo [String, Hash, Repository] A GitHub repository
|
51
51
|
# @param base [String] The branch (or git ref) you want your changes
|
52
52
|
# pulled into. This should be an existing branch on the current
|
@@ -68,7 +68,7 @@ module Octokit
|
|
68
68
|
|
69
69
|
# Create a pull request from existing issue
|
70
70
|
#
|
71
|
-
# @see
|
71
|
+
# @see https://developer.github.com/v3/pulls/#alternative-input
|
72
72
|
# @param repo [String, Hash, Repository] A GitHub repository
|
73
73
|
# @param base [String] The branch (or git ref) you want your changes
|
74
74
|
# pulled into. This should be an existing branch on the current
|
@@ -101,7 +101,7 @@ module Octokit
|
|
101
101
|
# @option options [String] :body Body for the pull request.
|
102
102
|
# @option options [String] :state State for the pull request.
|
103
103
|
# @return [Sawyer::Resource] Hash representing updated pull request.
|
104
|
-
# @see
|
104
|
+
# @see https://developer.github.com/v3/pulls/#update-a-pull-request
|
105
105
|
# @example
|
106
106
|
# @client.update_pull_request('octokit/octokit.rb', 67, 'new title', 'updated body', 'closed')
|
107
107
|
# @example Passing nil for optional attributes to update specific attributes.
|
@@ -120,7 +120,7 @@ module Octokit
|
|
120
120
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
121
121
|
# @param number [Integer] Number of pull request to update.
|
122
122
|
# @return [Sawyer::Resource] Hash representing updated pull request.
|
123
|
-
# @see
|
123
|
+
# @see https://developer.github.com/v3/pulls/#update-a-pull-request
|
124
124
|
# @example
|
125
125
|
# @client.close_pull_request('octokit/octokit.rb', 67)
|
126
126
|
def close_pull_request(repo, number, options = {})
|
@@ -130,12 +130,12 @@ module Octokit
|
|
130
130
|
|
131
131
|
# List commits on a pull request
|
132
132
|
#
|
133
|
-
# @see
|
133
|
+
# @see https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
|
134
134
|
# @param repo [String, Hash, Repository] A GitHub repository
|
135
135
|
# @param number [Integer] Number of pull request
|
136
136
|
# @return [Array<Sawyer::Resource>] List of commits
|
137
137
|
def pull_request_commits(repo, number, options = {})
|
138
|
-
|
138
|
+
paginate "repos/#{Repository.new(repo)}/pulls/#{number}/commits", options
|
139
139
|
end
|
140
140
|
alias :pull_commits :pull_request_commits
|
141
141
|
|
@@ -153,7 +153,7 @@ module Octokit
|
|
153
153
|
#
|
154
154
|
# @return [Array] List of pull request review comments.
|
155
155
|
#
|
156
|
-
# @see
|
156
|
+
# @see https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository
|
157
157
|
#
|
158
158
|
# @example Get the pull request review comments in the octokit repository
|
159
159
|
# @client.issues_comments("octokit/octokit.rb")
|
@@ -172,7 +172,7 @@ module Octokit
|
|
172
172
|
|
173
173
|
# List comments on a pull request
|
174
174
|
#
|
175
|
-
# @see
|
175
|
+
# @see https://developer.github.com/v3/pulls/#list-comments-on-a-pull-request
|
176
176
|
# @param repo [String, Hash, Repository] A GitHub repository
|
177
177
|
# @param number [Integer] Number of pull request
|
178
178
|
# @return [Array<Sawyer::Resource>] List of comments
|
@@ -188,7 +188,7 @@ module Octokit
|
|
188
188
|
# @param repo [String, Hash, Repository] A GitHub repository
|
189
189
|
# @param comment_id [Integer] Id of comment to get
|
190
190
|
# @return [Sawyer::Resource] Hash representing the comment
|
191
|
-
# @see
|
191
|
+
# @see https://developer.github.com/v3/pulls/comments/#get-a-single-comment
|
192
192
|
# @example
|
193
193
|
# @client.pull_request_comment("pengwynn/octkit", 1903950)
|
194
194
|
def pull_request_comment(repo, comment_id, options = {})
|
@@ -206,7 +206,7 @@ module Octokit
|
|
206
206
|
# @param path [String] Relative path of the file to comment on.
|
207
207
|
# @param position [Integer] Line index in the diff to comment on.
|
208
208
|
# @return [Sawyer::Resource] Hash representing the new comment
|
209
|
-
# @see
|
209
|
+
# @see https://developer.github.com/v3/pulls/comments/#create-a-comment
|
210
210
|
# @example
|
211
211
|
# @client.create_pull_request_comment("octokit/octokit.rb", 163, ":shipit:",
|
212
212
|
# "2d3201e4440903d8b04a5487842053ca4883e5f0", "lib/octokit/request.rb", 47)
|
@@ -229,7 +229,7 @@ module Octokit
|
|
229
229
|
# @param body [String] Comment contents
|
230
230
|
# @param comment_id [Integer] Comment id to reply to
|
231
231
|
# @return [Sawyer::Resource] Hash representing new comment
|
232
|
-
# @see
|
232
|
+
# @see https://developer.github.com/v3/pulls/comments/#create-a-comment
|
233
233
|
# @example
|
234
234
|
# @client.create_pull_request_comment_reply("octokit/octokit.rb", 1903950, "done.")
|
235
235
|
def create_pull_request_comment_reply(repo, pull_id, body, comment_id, options = {})
|
@@ -248,7 +248,7 @@ module Octokit
|
|
248
248
|
# @param comment_id [Integer] Id of the comment to update
|
249
249
|
# @param body [String] Updated comment content
|
250
250
|
# @return [Sawyer::Resource] Hash representing the updated comment
|
251
|
-
# @see
|
251
|
+
# @see https://developer.github.com/v3/pulls/comments/#edit-a-comment
|
252
252
|
# @example
|
253
253
|
# @client.update_pull_request_comment("octokit/octokit.rb", 1903950, ":shipit:")
|
254
254
|
def update_pull_request_comment(repo, comment_id, body, options = {})
|
@@ -263,7 +263,7 @@ module Octokit
|
|
263
263
|
# @param repo [String, Hash, Repository] A GitHub repository
|
264
264
|
# @param comment_id [Integer] Id of the comment to delete
|
265
265
|
# @return [Boolean] True if deleted, false otherwise
|
266
|
-
# @see
|
266
|
+
# @see https://developer.github.com/v3/pulls/comments/#delete-a-comment
|
267
267
|
# @example
|
268
268
|
# @client.delete_pull_request_comment("octokit/octokit.rb", 1902707)
|
269
269
|
def delete_pull_request_comment(repo, comment_id, options = {})
|
@@ -274,18 +274,18 @@ module Octokit
|
|
274
274
|
|
275
275
|
# List files on a pull request
|
276
276
|
#
|
277
|
-
# @see
|
277
|
+
# @see https://developer.github.com/v3/pulls/#list-pull-requests-files
|
278
278
|
# @param repo [String, Hash, Repository] A GitHub repository
|
279
279
|
# @param number [Integer] Number of pull request
|
280
280
|
# @return [Array<Sawyer::Resource>] List of files
|
281
281
|
def pull_request_files(repo, number, options = {})
|
282
|
-
|
282
|
+
paginate "repos/#{Repository.new(repo)}/pulls/#{number}/files", options
|
283
283
|
end
|
284
284
|
alias :pull_files :pull_request_files
|
285
285
|
|
286
286
|
# Merge a pull request
|
287
287
|
#
|
288
|
-
# @see
|
288
|
+
# @see https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-buttontrade
|
289
289
|
# @param repo [String, Hash, Repository] A GitHub repository
|
290
290
|
# @param number [Integer] Number of pull request
|
291
291
|
# @param commit_message [String] Optional commit message for the merge commit
|
@@ -296,7 +296,7 @@ module Octokit
|
|
296
296
|
|
297
297
|
# Check pull request merge status
|
298
298
|
#
|
299
|
-
# @see
|
299
|
+
# @see https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged
|
300
300
|
# @param repo [String, Hash, Repository] A GitHub repository
|
301
301
|
# @param number [Integer] Number of pull request
|
302
302
|
# @return [Boolean] True if the pull request has been merged
|