Skip to content

Commit

Permalink
Add support for pull request comments bitbucket-rest-api#44
Browse files Browse the repository at this point in the history
  • Loading branch information
iconnor committed Mar 25, 2016
1 parent 8373f38 commit 987f553
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/bitbucket_rest_api/repos/pull_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def list(user_name, repo_name, params={})
#
# = Examples
# bitbucket = BitBucket.new
# bitbucket.repos.pull_request.list 'user-name', 'repo-name'
# bitbucket.repos.pull_request.list 'user-name', 'repo-name' { |status| ... }
# bitbucket.repos.pull_request.participants 'user-name', 'repo-name', 'number'
#
def participants(user_name, repo_name, pull_request_id, params={})
_update_user_repo_params(user_name, repo_name)
Expand All @@ -38,5 +37,21 @@ def participants(user_name, repo_name, pull_request_id, params={})
response.each { |el| yield el }
end

# List pull request commits
#
# = Examples
# bitbucket = BitBucket.new
# bitbucket.repos.pull_request.commits 'user-name', 'repo-name', 'number'
#
def commits(user_name, repo_name, pull_request_id, params={})
_update_user_repo_params(user_name, repo_name)
_validate_user_repo_params(user, repo) unless user? && repo?
normalize! params

response = get_request("/2.0/repositories/#{user}/#{repo.downcase}/pullrequests/#{pull_request_id}/commits", params)
return response unless block_given?
response.each { |el| yield el }
end

end # Repos::Keys
end # BitBucket

0 comments on commit 987f553

Please sign in to comment.