Module: Octokit::Client::Issues
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/issues.rb
Overview
Methods for the Issues API
Instance Method Summary collapse
-
#add_comment(repo, number, comment, options = {}) ⇒ Sawyer::Resource
Add a comment to an issue.
-
#close_issue(repo, number, options = {}) ⇒ Sawyer::Resource
Close an issue.
-
#create_issue(repo, title, body, options = {}) ⇒ Sawyer::Resource
(also: #open_issue)
Create an issue for a repository.
-
#delete_comment(repo, number, options = {}) ⇒ Boolean
Delete a single comment.
-
#issue(repo, number, options = {}) ⇒ Sawyer::Resource
Get a single issue from a repository.
-
#issue_comment(repo, number, options = {}) ⇒ Sawyer::Resource
Get a single comment attached to an issue.
-
#issue_comments(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
Get all comments attached to an issue.
-
#issues_comments(repo, options = {}) ⇒ Array<Sawyer::Resource>
Get all comments attached to issues for the repository.
-
#list_issues(repository = nil, options = {}) ⇒ Array<Sawyer::Resource>
(also: #issues)
List issues for a the authenticated user or repository.
-
#org_issues(org, options = {}) ⇒ Array<Sawyer::Resource>
List all issues for a given organization for the authenticated user.
-
#reopen_issue(repo, number, options = {}) ⇒ Sawyer::Resource
Reopen an issue.
-
#update_comment(repo, number, comment, options = {}) ⇒ Sawyer::Resource
Update a single comment on an issue.
-
#update_issue(repo, number, title, body, options = {}) ⇒ Sawyer::Resource
Update an issue.
-
#user_issues(options = {}) ⇒ Array<Sawyer::Resource>
List all issues across owned and member repositories for the authenticated user.
Instance Method Details
#add_comment(repo, number, comment, options = {}) ⇒ Sawyer::Resource
Add a comment to an issue
228 229 230 |
# File 'lib/octokit/client/issues.rb', line 228 def add_comment(repo, number, comment, = {}) post "repos/#{Repository.new(repo)}/issues/#{number}/comments", .merge({:body => comment}) end |
#close_issue(repo, number, options = {}) ⇒ Sawyer::Resource
Close an issue
127 128 129 |
# File 'lib/octokit/client/issues.rb', line 127 def close_issue(repo, number, = {}) patch "repos/#{Repository.new(repo)}/issues/#{number}", .merge({:state => "closed"}) end |
#create_issue(repo, title, body, options = {}) ⇒ Sawyer::Resource Also known as: open_issue
Create an issue for a repository
92 93 94 95 96 97 98 99 100 |
# File 'lib/octokit/client/issues.rb', line 92 def create_issue(repo, title, body, = {}) [:labels] = case [:labels] when String [:labels].split(",").map(&:strip) when Array [:labels] end post "repos/#{Repository.new(repo)}/issues", .merge({:title => title, :body => body}) end |
#delete_comment(repo, number, options = {}) ⇒ Boolean
Delete a single comment
253 254 255 |
# File 'lib/octokit/client/issues.rb', line 253 def delete_comment(repo, number, = {}) boolean_from_response :delete, "repos/#{Repository.new(repo)}/issues/comments/#{number}", end |
#issue(repo, number, options = {}) ⇒ Sawyer::Resource
Get a single issue from a repository
111 112 113 |
# File 'lib/octokit/client/issues.rb', line 111 def issue(repo, number, = {}) get "repos/#{Repository.new(repo)}/issues/#{number}", end |
#issue_comment(repo, number, options = {}) ⇒ Sawyer::Resource
Get a single comment attached to an issue
215 216 217 |
# File 'lib/octokit/client/issues.rb', line 215 def issue_comment(repo, number, = {}) paginate "repos/#{Repository.new(repo)}/issues/comments/#{number}", end |
#issue_comments(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
Get all comments attached to an issue
203 204 205 |
# File 'lib/octokit/client/issues.rb', line 203 def issue_comments(repo, number, = {}) paginate "repos/#{Repository.new(repo)}/issues/#{number}/comments", end |
#issues_comments(repo, options = {}) ⇒ Array<Sawyer::Resource>
Get all comments attached to issues for the repository
By default, Issue Comments are ordered by ascending ID.
191 192 193 |
# File 'lib/octokit/client/issues.rb', line 191 def issues_comments(repo, = {}) paginate "repos/#{Repository.new repo}/issues/comments", end |
#list_issues(repository = nil, options = {}) ⇒ Array<Sawyer::Resource> Also known as: issues
List issues for a the authenticated user or repository
29 30 31 32 33 34 35 |
# File 'lib/octokit/client/issues.rb', line 29 def list_issues(repository = nil, = {}) path = '' path = "repos/#{Repository.new(repository)}" if repository path += "/issues" paginate path, end |
#org_issues(org, options = {}) ⇒ Array<Sawyer::Resource>
List all issues for a given organization for the authenticated user
75 76 77 |
# File 'lib/octokit/client/issues.rb', line 75 def org_issues(org, = {}) paginate "orgs/#{org}/issues", end |
#reopen_issue(repo, number, options = {}) ⇒ Sawyer::Resource
Reopen an issue
143 144 145 |
# File 'lib/octokit/client/issues.rb', line 143 def reopen_issue(repo, number, = {}) patch "repos/#{Repository.new(repo)}/issues/#{number}", .merge({:state => "open"}) end |
#update_comment(repo, number, comment, options = {}) ⇒ Sawyer::Resource
Update a single comment on an issue
241 242 243 |
# File 'lib/octokit/client/issues.rb', line 241 def update_comment(repo, number, comment, = {}) patch "repos/#{Repository.new(repo)}/issues/comments/#{number}", .merge({:body => comment}) end |
#update_issue(repo, number, title, body, options = {}) ⇒ Sawyer::Resource
Update an issue
162 163 164 |
# File 'lib/octokit/client/issues.rb', line 162 def update_issue(repo, number, title, body, = {}) patch "repos/#{Repository.new(repo)}/issues/#{number}", .merge({:title => title, :body => body}) end |
#user_issues(options = {}) ⇒ Array<Sawyer::Resource>
List all issues across owned and member repositories for the authenticated user
54 55 56 |
# File 'lib/octokit/client/issues.rb', line 54 def user_issues( = {}) paginate 'user/issues', end |