Module: Octokit::Client::PullRequests
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/pull_requests.rb |
Overview
Methods for the Pull Requests API
Instance Method Summary
-
#close_pull_request(repo, number, options = {}) ⇒ Sawyer::Resource
Close a pull request.
-
#create_pull_comment(repo, pull_id, body, commit_id, path, line = nil, options = {})
Alias for #create_pull_request_comment.
-
#create_pull_reply(repo, pull_id, body, comment_id, options = {})
Alias for #create_pull_request_comment_reply.
-
#create_pull_request(repo, base, head, title, body = nil, options = {}) ⇒ Sawyer::Resource
Create a pull request.
-
#create_pull_request_comment(repo, pull_id, body, commit_id, path, line = nil, options = {}) ⇒ Sawyer::Resource
(also: #create_pull_comment, #create_view_comment)
deprecated
Deprecated.
The position will be deprecated in the next major version. Please refer to the details below.
-
#create_pull_request_comment_reply(repo, pull_id, body, comment_id, options = {}) ⇒ Sawyer::Resource
(also: #create_pull_reply, #create_review_reply)
Create reply to a pull request comment.
-
#create_pull_request_for_issue(repo, base, head, issue, options = {}) ⇒ Sawyer::Resource
Create a pull request from existing issue.
-
#create_review_reply(repo, pull_id, body, comment_id, options = {})
Alias for #create_pull_request_comment_reply.
-
#create_view_comment(repo, pull_id, body, commit_id, path, line = nil, options = {})
Alias for #create_pull_request_comment.
-
#delete_pull_comment(repo, comment_id, options = {})
Alias for #delete_pull_request_comment.
-
#delete_pull_request_comment(repo, comment_id, options = {}) ⇒ Boolean
(also: #delete_pull_comment, #delete_review_comment)
Delete pull request comment.
-
#delete_review_comment(repo, comment_id, options = {})
Alias for #delete_pull_request_comment.
-
#merge_pull_request(repo, number, commit_message = '', options = {}) ⇒ Array<Sawyer::Resource>
Merge a pull request.
-
#pull(repo, number, options = {})
Alias for #pull_request.
-
#pull_comment(repo, comment_id, options = {})
Alias for #pull_request_comment.
-
#pull_comments(repo, number, options = {})
Alias for #pull_request_comments.
-
#pull_commits(repo, number, options = {})
Alias for #pull_request_commits.
-
#pull_files(repo, number, options = {})
Alias for #pull_request_files.
-
#pull_merged?(repo, number, options = {}) ⇒ Boolean
(also: #pull_request_merged?)
Check pull request merge status.
-
#pull_request(repo, number, options = {}) ⇒ Sawyer::Resource
(also: #pull)
Get a pull request.
-
#pull_request_comment(repo, comment_id, options = {}) ⇒ Sawyer::Resource
(also: #pull_comment, #review_comment)
Get a pull request comment.
-
#pull_request_comments(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
(also: #pull_comments, #review_comments)
List comments on a pull request.
-
#pull_request_commits(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
(also: #pull_commits)
List commits on a pull request.
-
#pull_request_files(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
(also: #pull_files)
List files on a pull request.
-
#pull_request_merged?(repo, number, options = {})
Alias for #pull_merged?.
-
#pull_requests(repo, options) ⇒ Array<Sawyer::Resource>
(also: #pulls)
List pull requests for a repository.
-
#pull_requests_comments(repo, options = {}) ⇒ Array
(also: #pulls_comments, #reviews_comments)
List pull request comments for a repository.
-
#pulls(repo, options = {})
Alias for #pull_requests.
-
#pulls_comments(repo, options = {})
Alias for #pull_requests_comments.
-
#review_comment(repo, comment_id, options = {})
Alias for #pull_request_comment.
-
#review_comments(repo, number, options = {})
Alias for #pull_request_comments.
-
#reviews_comments(repo, options = {})
Alias for #pull_requests_comments.
-
#update_pull_comment(repo, comment_id, body, options = {})
Alias for #update_pull_request_comment.
-
#update_pull_request(repo, number, title = nil, body = nil, state = nil, options = {}) ⇒ Sawyer::Resource
Update a pull request.
-
#update_pull_request_branch(repo, number, options = {}) ⇒ Boolean
Update a pull request branch.
-
#update_pull_request_comment(repo, comment_id, body, options = {}) ⇒ Sawyer::Resource
(also: #update_pull_comment, #update_review_comment)
Update pull request comment.
-
#update_review_comment(repo, comment_id, body, options = {})
Alias for #update_pull_request_comment.
Instance Method Details
#close_pull_request(repo, number, options = {}) ⇒ Sawyer::Resource
Close a pull request
# File 'lib/octokit/client/pull_requests.rb', line 119
def close_pull_request(repo, number, = {}) .merge! state: 'closed' update_pull_request(repo, number, ) end
#create_pull_comment(repo, pull_id, body, commit_id, path, line = nil, options = {})
Alias for #create_pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 226
alias create_pull_comment create_pull_request_comment
#create_pull_reply(repo, pull_id, body, comment_id, options = {})
Alias for #create_pull_request_comment_reply.
# File 'lib/octokit/client/pull_requests.rb', line 246
alias create_pull_reply create_pull_request_comment_reply
#create_pull_request(repo, base, head, title, body = nil, options = {}) ⇒ Sawyer::Resource
Create a pull request
# File 'lib/octokit/client/pull_requests.rb', line 52
def create_pull_request(repo, base, head, title, body = nil, = {}) pull = { base: base, head: head, title: title } pull[:body] = body unless body.nil? post "#{Repository.path repo}/pulls", .merge(pull) end
#create_pull_request_comment(repo, pull_id, body, commit_id, path, line = nil, options = {}) ⇒ Sawyer::Resource
Also known as: #create_pull_comment, #create_view_comment
The position will be deprecated in the next major version. Please refer to the details below.
Create a pull request comment
# File 'lib/octokit/client/pull_requests.rb', line 210
def create_pull_request_comment(repo, pull_id, body, commit_id, path, line = nil, = {}) comment = { body: body, commit_id: commit_id, path: path } if line.nil? comment[:subject_type] = 'file' else comment[:line] = line end .merge! comment post "#{Repository.path repo}/pulls/#{pull_id}/comments", end
#create_pull_request_comment_reply(repo, pull_id, body, comment_id, options = {}) ⇒ Sawyer::Resource
Also known as: #create_pull_reply, #create_review_reply
Create reply to a pull request comment
# File 'lib/octokit/client/pull_requests.rb', line 239
def create_pull_request_comment_reply(repo, pull_id, body, comment_id, = {}) .merge!({ body: body, in_reply_to: comment_id }) post "#{Repository.path repo}/pulls/#{pull_id}/comments", end
#create_pull_request_for_issue(repo, base, head, issue, options = {}) ⇒ Sawyer::Resource
Create a pull request from existing issue
# File 'lib/octokit/client/pull_requests.rb', line 73
def create_pull_request_for_issue(repo, base, head, issue, = {}) pull = { base: base, head: head, issue: issue } post "#{Repository.path repo}/pulls", .merge(pull) end
#create_review_reply(repo, pull_id, body, comment_id, options = {})
Alias for #create_pull_request_comment_reply.
# File 'lib/octokit/client/pull_requests.rb', line 247
alias create_review_reply create_pull_request_comment_reply
#create_view_comment(repo, pull_id, body, commit_id, path, line = nil, options = {})
Alias for #create_pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 227
alias create_view_comment create_pull_request_comment
#delete_pull_comment(repo, comment_id, options = {})
Alias for #delete_pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 276
alias delete_pull_comment delete_pull_request_comment
#delete_pull_request_comment(repo, comment_id, options = {}) ⇒ Boolean
Also known as: #delete_pull_comment, #delete_review_comment
Delete pull request comment
# File 'lib/octokit/client/pull_requests.rb', line 273
def delete_pull_request_comment(repo, comment_id, = {}) boolean_from_response(:delete, "#{Repository.path repo}/pulls/comments/#{comment_id}", ) end
#delete_review_comment(repo, comment_id, options = {})
Alias for #delete_pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 277
alias delete_review_comment delete_pull_request_comment
#merge_pull_request(repo, number, commit_message = '', options = {}) ⇒ Array
<Sawyer::Resource
>
Merge a pull request
# File 'lib/octokit/client/pull_requests.rb', line 308
def merge_pull_request(repo, number, = '', = {}) put "#{Repository.path repo}/pulls/#{number}/merge", .merge({ commit_message: }) end
#pull(repo, number, options = {})
Alias for #pull_request.
# File 'lib/octokit/client/pull_requests.rb', line 35
alias pull pull_request
#pull_comment(repo, comment_id, options = {})
Alias for #pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 190
alias pull_comment pull_request_comment
#pull_comments(repo, number, options = {})
Alias for #pull_request_comments.
# File 'lib/octokit/client/pull_requests.rb', line 176
alias pull_comments pull_request_comments
#pull_commits(repo, number, options = {})
Alias for #pull_request_commits.
# File 'lib/octokit/client/pull_requests.rb', line 133
alias pull_commits pull_request_commits
#pull_files(repo, number, options = {})
Alias for #pull_request_files.
# File 'lib/octokit/client/pull_requests.rb', line 288
alias pull_files pull_request_files
#pull_merged?(repo, number, options = {}) ⇒ Boolean
Also known as: #pull_request_merged?
Check pull request merge status
# File 'lib/octokit/client/pull_requests.rb', line 318
def pull_merged?(repo, number, = {}) boolean_from_response :get, "#{Repository.path repo}/pulls/#{number}/merge", end
#pull_request(repo, number, options = {}) ⇒ Sawyer::Resource
Also known as: #pull
Get a pull request
# File 'lib/octokit/client/pull_requests.rb', line 32
def pull_request(repo, number, = {}) get "#{Repository.path repo}/pulls/#{number}", end
#pull_request_comment(repo, comment_id, options = {}) ⇒ Sawyer::Resource
Also known as: #pull_comment, #review_comment
Get a pull request comment
# File 'lib/octokit/client/pull_requests.rb', line 187
def pull_request_comment(repo, comment_id, = {}) get "#{Repository.path repo}/pulls/comments/#{comment_id}", end
#pull_request_comments(repo, number, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #pull_comments, #review_comments
List comments on a pull request
# File 'lib/octokit/client/pull_requests.rb', line 172
def pull_request_comments(repo, number, = {}) # return the comments for a pull request paginate("#{Repository.path repo}/pulls/#{number}/comments", ) end
#pull_request_commits(repo, number, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #pull_commits
List commits on a pull request
# File 'lib/octokit/client/pull_requests.rb', line 130
def pull_request_commits(repo, number, = {}) paginate "#{Repository.path repo}/pulls/#{number}/commits", end
#pull_request_files(repo, number, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #pull_files
List files on a pull request
# File 'lib/octokit/client/pull_requests.rb', line 285
def pull_request_files(repo, number, = {}) paginate "#{Repository.path repo}/pulls/#{number}/files", end
#pull_request_merged?(repo, number, options = {})
Alias for #pull_merged?.
# File 'lib/octokit/client/pull_requests.rb', line 321
alias pull_request_merged? pull_merged?
#pull_requests(repo, options) ⇒ Array
<Sawyer::Resource
> Also known as: #pulls
List pull requests for a repository
# File 'lib/octokit/client/pull_requests.rb', line 19
def pull_requests(repo, = {}) paginate "#{Repository.path repo}/pulls", end
#pull_requests_comments(repo, options = {}) ⇒ Array
Also known as: #pulls_comments, #reviews_comments
List pull request comments for a repository
By default, Review Comments are ordered by ascending ID.
# File 'lib/octokit/client/pull_requests.rb', line 160
def pull_requests_comments(repo, = {}) paginate("#{Repository.path repo}/pulls/comments", ) end
#pulls(repo, options = {})
Alias for #pull_requests.
# File 'lib/octokit/client/pull_requests.rb', line 22
alias pulls pull_requests
#pulls_comments(repo, options = {})
Alias for #pull_requests_comments.
# File 'lib/octokit/client/pull_requests.rb', line 163
alias pulls_comments pull_requests_comments
#review_comment(repo, comment_id, options = {})
Alias for #pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 191
alias review_comment pull_request_comment
#review_comments(repo, number, options = {})
Alias for #pull_request_comments.
# File 'lib/octokit/client/pull_requests.rb', line 177
alias review_comments pull_request_comments
#reviews_comments(repo, options = {})
Alias for #pull_requests_comments.
# File 'lib/octokit/client/pull_requests.rb', line 164
alias reviews_comments pull_requests_comments
#update_pull_comment(repo, comment_id, body, options = {})
Alias for #update_pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 262
alias update_pull_comment update_pull_request_comment
#update_pull_request(repo, number, title = nil, body = nil, state = nil, options = {}) ⇒ Sawyer::Resource
#update_pull_request(repo, number, options = {}) ⇒ Sawyer::Resource
Sawyer::Resource
#update_pull_request(repo, number, options = {}) ⇒ Sawyer::Resource
Update a pull request
# File 'lib/octokit/client/pull_requests.rb', line 104
def update_pull_request(*args) arguments = Octokit::Arguments.new(args) repo = arguments.shift number = arguments.shift patch "#{Repository.path repo}/pulls/#{number}", arguments. end
#update_pull_request_branch(repo, number, options = {}) ⇒ Boolean
Update a pull request branch
# File 'lib/octokit/client/pull_requests.rb', line 297
def update_pull_request_branch(repo, number, = {}) boolean_from_response(:put, "#{Repository.path repo}/pulls/#{number}/update-branch", ) end
#update_pull_request_comment(repo, comment_id, body, options = {}) ⇒ Sawyer::Resource
Also known as: #update_pull_comment, #update_review_comment
Update pull request comment
# File 'lib/octokit/client/pull_requests.rb', line 258
def update_pull_request_comment(repo, comment_id, body, = {}) .merge! body: body patch("#{Repository.path repo}/pulls/comments/#{comment_id}", ) end
#update_review_comment(repo, comment_id, body, options = {})
Alias for #update_pull_request_comment.
# File 'lib/octokit/client/pull_requests.rb', line 263
alias update_review_comment update_pull_request_comment