Module: Octokit::Client::Issues
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/issues.rb
Instance Method Summary collapse
-
#add_comment(repo, number, comment, options = {}) ⇒ Comment
Add a comment to an issue.
-
#add_label(repo, label, color = "ffffff", options = {}) ⇒ Array
Add a label to a repository.
-
#close_issue(repo, number, options = {}) ⇒ Issue
Close an issue.
-
#create_issue(repo, title, body, options = {}) ⇒ Issue
(also: #open_issue)
Create an issue for a repository.
-
#delete_comment(repo, number, options = {}) ⇒ Response
Delete a single comment.
-
#issue(repo, number, options = {}) ⇒ Issue
Get a single issue from a repository.
-
#issue_comment(repo, number, options = {}) ⇒ Array
Get a single comment attached to an issue.
-
#issue_comments(repo, number, options = {}) ⇒ Array
Get all comments attached to an issue.
-
#label(repo, name, options = {}) ⇒ Label
Get single label for a repository.
-
#labels(repo, options = {}) ⇒ Array
List available labels for a repository.
-
#list_issues(repository, options = {}) ⇒ Array
(also: #issues)
List issues for a repository.
-
#remove_label(repo, label, number = nil, options = {}) ⇒ Array
Remove a label from a repository.
-
#reopen_issue(repo, number, options = {}) ⇒ Issue
Reopen an issue.
-
#search_issues(repo, search_term, state = 'open', options = {}) ⇒ Array
Search issues within a repository.
-
#update_comment(repo, number, comment, options = {}) ⇒ Comment
Update a single comment on an issue.
-
#update_issue(repo, number, title, body, options = {}) ⇒ Issue
Update an issue.
Instance Method Details
#add_comment(repo, number, comment, options = {}) ⇒ Comment
Add a comment to an issue
193 194 195 |
# File 'lib/octokit/client/issues.rb', line 193 def add_comment(repo, number, comment, ={}) post("/repos/#{Repository.new(repo)}/issues/#{number}/comments", .merge({:body => comment}), 3) end |
#add_label(repo, label, color = "ffffff", options = {}) ⇒ Array
Add a label to a repository
141 142 143 |
# File 'lib/octokit/client/issues.rb', line 141 def add_label(repo, label, color="ffffff", ={}) post("repos/#{Repository.new(repo)}/labels", .merge({:name => label, :color => color}), 3) end |
#close_issue(repo, number, options = {}) ⇒ Issue
This implementation needs to be adjusted with switch to API v3
Close an issue
75 76 77 |
# File 'lib/octokit/client/issues.rb', line 75 def close_issue(repo, number, ={}) post("/api/v2/json/issues/close/#{Repository.new(repo)}/#{number}", )['issue'] end |
#create_issue(repo, title, body, options = {}) ⇒ Issue Also known as: open_issue
Create an issue for a repository
48 49 50 |
# File 'lib/octokit/client/issues.rb', line 48 def create_issue(repo, title, body, ={}) post("/api/v2/json/issues/open/#{Repository.new(repo)}", .merge({:title => title, :body => body}))['issue'] end |
#delete_comment(repo, number, options = {}) ⇒ Response
Delete a single comment
218 219 220 |
# File 'lib/octokit/client/issues.rb', line 218 def delete_comment(repo, number, ={}) delete("/repos/#{Repository.new(repo)}/issues/comments/#{number}", , 3, true, true) end |
#issue(repo, number, options = {}) ⇒ Issue
Get a single issue from a repository
61 62 63 |
# File 'lib/octokit/client/issues.rb', line 61 def issue(repo, number, ={}) get("/api/v2/json/issues/show/#{Repository.new(repo)}/#{number}", )['issue'] end |
#issue_comment(repo, number, options = {}) ⇒ Array
Get a single comment attached to an issue
180 181 182 |
# File 'lib/octokit/client/issues.rb', line 180 def issue_comment(repo, number, ={}) get("/repos/#{Repository.new(repo)}/issues/comments/#{number}", , 3) end |
#issue_comments(repo, number, options = {}) ⇒ Array
Get all comments attached to an issue
168 169 170 |
# File 'lib/octokit/client/issues.rb', line 168 def issue_comments(repo, number, ={}) get("/repos/#{Repository.new(repo)}/issues/#{number}/comments", , 3) end |
#label(repo, name, options = {}) ⇒ Label
Get single label for a repository
129 130 131 |
# File 'lib/octokit/client/issues.rb', line 129 def label(repo, name, ={}) get("repos/#{Repository.new(repo)}/labels/#{URI.encode(name)}", , 3) end |
#labels(repo, options = {}) ⇒ Array
List available labels for a repository
117 118 119 |
# File 'lib/octokit/client/issues.rb', line 117 def labels(repo, ={}) get("repos/#{Repository.new(repo)}/labels", , 3) end |
#list_issues(repository, options = {}) ⇒ Array Also known as: issues
List issues for a repository
34 35 36 |
# File 'lib/octokit/client/issues.rb', line 34 def list_issues(repository, ={}) get("/repos/#{Repository.new(repository)}/issues", , 3) end |
#remove_label(repo, label, number = nil, options = {}) ⇒ Array
Leaving the number parameter out will remove this label from all issues
Remove a label from a repository
156 157 158 |
# File 'lib/octokit/client/issues.rb', line 156 def remove_label(repo, label, number=nil, ={}) post(["/api/v2/json/issues/label/remove/#{Repository.new(repo)}/#{label}", number].compact.join('/'), )['labels'] end |
#reopen_issue(repo, number, options = {}) ⇒ Issue
This implementation needs to be adjusted with switch to API v3
Reopen an issue
89 90 91 |
# File 'lib/octokit/client/issues.rb', line 89 def reopen_issue(repo, number, ={}) post("/api/v2/json/issues/reopen/#{Repository.new(repo)}/#{number}", )['issue'] end |
#search_issues(repo, search_term, state = 'open', options = {}) ⇒ Array
Search issues within a repository
14 15 16 |
# File 'lib/octokit/client/issues.rb', line 14 def search_issues(repo, search_term, state='open', ={}) get("/api/v2/json/issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", )['issues'] end |
#update_comment(repo, number, comment, options = {}) ⇒ Comment
Update a single comment on an issue
206 207 208 |
# File 'lib/octokit/client/issues.rb', line 206 def update_comment(repo, number, comment, ={}) post("/repos/#{Repository.new(repo)}/issues/comments/#{number}", .merge({:body => comment}), 3) end |
#update_issue(repo, number, title, body, options = {}) ⇒ Issue
This implementation needs to be adjusted with switch to API v3
Update an issue
105 106 107 |
# File 'lib/octokit/client/issues.rb', line 105 def update_issue(repo, number, title, body, ={}) post("/api/v2/json/issues/edit/#{Repository.new(repo)}/#{number}", .merge({:title => title, :body => body}))['issue'] end |