Module: GitHub::Client::PullRequests
- Included in:
- GitHub::Client
- Defined in:
- lib/github_api_v3/client/pull_requests.rb
Overview
Methods for the Pull Requests API.
Instance Method Summary collapse
-
#create_pull_request(owner, repo, options = {}) ⇒ Hash
Create a new pull request.
-
#create_pull_request_comment(owner, repo, number, options = {}) ⇒ Hash
Create a pull request comment.
-
#delete_pull_request_comment(owner, repo, number) ⇒ Object
Delete a pull request comment.
-
#edit_pull_request_comment(owner, repo, number, body) ⇒ Hash
Edit a pull request comment.
-
#merge_pull_request(owner, repo, number) ⇒ Hash
Merge a pull request.
-
#pull_request(owner, repo, number) ⇒ Hash
Get a single pull request.
-
#pull_request_comment(owner, repo, number) ⇒ Hash
Get a single pull request comment.
-
#pull_request_comments(owner, repo, number) ⇒ Array
List comments on a pull request.
-
#pull_request_commits(owner, repo, number) ⇒ Array
List commits on a pull request.
-
#pull_request_files(owner, repo, number) ⇒ Array
List pull requests files.
-
#pull_request_merged?(owner, repo, number) ⇒ Boolean
Check if a pull request has been merged.
-
#pull_requests(owner, repo) ⇒ Array
List pull requests for a repository.
-
#repo_pull_request_comments(owner, repo) ⇒ Array
List comments in a repository.
-
#update_pull_request(owner, repo, number, options = {}) ⇒ Hash
Update a pull request.
Instance Method Details
#create_pull_request(owner, repo, options = {}) ⇒ Hash
Create a new pull request.
Requires authentication.
want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. your changes are implemented.
58 59 60 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 58 def create_pull_request(owner, repo, ={}) post "/repos/#{owner}/#{repo}/pulls", body: end |
#create_pull_request_comment(owner, repo, number, options = {}) ⇒ Hash
Create a pull request comment.
Requires authentication.
183 184 185 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 183 def create_pull_request_comment(owner, repo, number, ={}) post "/repos/#{owner}/#{repo}/pulls/#{number}/comments", body: end |
#delete_pull_request_comment(owner, repo, number) ⇒ Object
Delete a pull request comment.
Requires authentication.
214 215 216 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 214 def delete_pull_request_comment(owner, repo, number) boolean_request :delete, "/repos/#{owner}/#{repo}/pulls/comments/#{number}" end |
#edit_pull_request_comment(owner, repo, number, body) ⇒ Hash
Edit a pull request comment.
Requires authentication.
199 200 201 202 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 199 def edit_pull_request_comment(owner, repo, number, body) = { body: body } patch "/repos/#{owner}/#{repo}/pulls/comments/#{number}", body: end |
#merge_pull_request(owner, repo, number) ⇒ Hash
Merge a pull request.
Requires authentication.
121 122 123 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 121 def merge_pull_request(owner, repo, number) put "/repos/#{owner}/#{repo}/pulls/#{number}/merge" end |
#pull_request(owner, repo, number) ⇒ Hash
Get a single pull request.
29 30 31 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 29 def pull_request(owner, repo, number) get "/repos/#{owner}/#{repo}/pulls/#{number}" end |
#pull_request_comment(owner, repo, number) ⇒ Hash
Get a single pull request comment.
155 156 157 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 155 def pull_request_comment(owner, repo, number) get "/repos/#{owner}/#{repo}/pulls/comments/#{number}" end |
#pull_request_comments(owner, repo, number) ⇒ Array
List comments on a pull request.
132 133 134 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 132 def pull_request_comments(owner, repo, number) get "/repos/#{owner}/#{repo}/pulls/#{number}/comments" end |
#pull_request_commits(owner, repo, number) ⇒ Array
List commits on a pull request.
86 87 88 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 86 def pull_request_commits(owner, repo, number) get "/repos/#{owner}/#{repo}/pulls/#{number}/commits" end |
#pull_request_files(owner, repo, number) ⇒ Array
List pull requests files.
97 98 99 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 97 def pull_request_files(owner, repo, number) get "/repos/#{owner}/#{repo}/pulls/#{number}/files" end |
#pull_request_merged?(owner, repo, number) ⇒ Boolean
Check if a pull request has been merged.
108 109 110 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 108 def pull_request_merged?(owner, repo, number) boolean_request :get, "/repos/#{owner}/#{repo}/pulls/#{number}/merge" end |
#pull_requests(owner, repo) ⇒ Array
List pull requests for a repository.
16 17 18 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 16 def pull_requests(owner, repo) get "/repos/#{owner}/#{repo}/pulls" end |
#repo_pull_request_comments(owner, repo) ⇒ Array
List comments in a repository.
142 143 144 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 142 def repo_pull_request_comments(owner, repo) get "/repos/#{owner}/#{repo}/pulls/comments" end |
#update_pull_request(owner, repo, number, options = {}) ⇒ Hash
Update a pull request.
Requires authentication.
75 76 77 |
# File 'lib/github_api_v3/client/pull_requests.rb', line 75 def update_pull_request(owner, repo, number, ={}) patch "/repos/#{owner}/#{repo}/pulls/#{number}", body: end |