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.
-
#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 = {}) ⇒ Boolean
Delete a single comment.
-
#issue(repo, number, options = {}) ⇒ Issue
Get a single issue from a repository.
-
#issue_comment(repo, number, options = {}) ⇒ Comment
Get a single comment attached to an issue.
-
#issue_comments(repo, number, options = {}) ⇒ Array
Get all comments attached to an issue.
-
#issue_event(repo, number, options = {}) ⇒ Event
Get information on a single Issue Event.
-
#issue_events(repo, number, options = {}) ⇒ Array
List events for an Issue.
-
#issues_comments(repo, options = {}) ⇒ Array
Get all comments attached to issues for the repository.
-
#list_issues(repository = nil, options = {}) ⇒ Array
(also: #issues)
List issues for a the authenticated user or 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
178 179 180 |
# File 'lib/octokit/client/issues.rb', line 178 def add_comment(repo, number, comment, ={}) post("repos/#{Repository.new(repo)}/issues/#{number}/comments", .merge({:body => comment})) end |
#close_issue(repo, number, options = {}) ⇒ Issue
This implementation needs to be adjusted with switch to API v3
Close an issue
82 83 84 |
# File 'lib/octokit/client/issues.rb', line 82 def close_issue(repo, number, ={}) post("repos/#{Repository.new(repo)}/issues/#{number}", .merge({:state => "closed"})) end |
#create_issue(repo, title, body, options = {}) ⇒ Issue Also known as: open_issue
Create an issue for a repository
55 56 57 |
# File 'lib/octokit/client/issues.rb', line 55 def create_issue(repo, title, body, ={}) post("repos/#{Repository.new(repo)}/issues", .merge({:title => title, :body => body})) end |
#delete_comment(repo, number, options = {}) ⇒ Boolean
Delete a single comment
203 204 205 |
# File 'lib/octokit/client/issues.rb', line 203 def delete_comment(repo, number, ={}) boolean_from_response(:delete, "repos/#{Repository.new(repo)}/issues/comments/#{number}", ) end |
#issue(repo, number, options = {}) ⇒ Issue
Get a single issue from a repository
68 69 70 |
# File 'lib/octokit/client/issues.rb', line 68 def issue(repo, number, ={}) get("repos/#{Repository.new(repo)}/issues/#{number}", ) end |
#issue_comment(repo, number, options = {}) ⇒ Comment
Get a single comment attached to an issue
165 166 167 |
# File 'lib/octokit/client/issues.rb', line 165 def issue_comment(repo, number, ={}) get("repos/#{Repository.new(repo)}/issues/comments/#{number}", ) end |
#issue_comments(repo, number, options = {}) ⇒ Array
Get all comments attached to an issue
153 154 155 |
# File 'lib/octokit/client/issues.rb', line 153 def issue_comments(repo, number, ={}) get("repos/#{Repository.new(repo)}/issues/#{number}/comments", ) end |
#issue_event(repo, number, options = {}) ⇒ Event
Get information on a single Issue Event
230 231 232 |
# File 'lib/octokit/client/issues.rb', line 230 def issue_event(repo, number, ={}) get("repos/#{Repository.new(repo)}/issues/events/#{number}", ) end |
#issue_events(repo, number, options = {}) ⇒ Array
List events for an Issue
217 218 219 |
# File 'lib/octokit/client/issues.rb', line 217 def issue_events(repo, number, ={}) get("repos/#{Repository.new(repo)}/issues/#{number}/events", ) end |
#issues_comments(repo, options = {}) ⇒ Array
Get all comments attached to issues for the repository
By default, Issue Comments are ordered by ascending ID.
141 142 143 |
# File 'lib/octokit/client/issues.rb', line 141 def issues_comments(repo, ={}) get "/repos/#{Repository.new repo}/issues/comments", end |
#list_issues(repository = nil, options = {}) ⇒ Array Also known as: issues
List issues for a the authenticated user or repository
38 39 40 41 42 43 |
# File 'lib/octokit/client/issues.rb', line 38 def list_issues(repository = nil, ={}) path = '' path = "repos/#{Repository.new(repository)}" if repository path += "/issues" get(path, ) end |
#reopen_issue(repo, number, options = {}) ⇒ Issue
This implementation needs to be adjusted with switch to API v3
Reopen an issue
96 97 98 |
# File 'lib/octokit/client/issues.rb', line 96 def reopen_issue(repo, number, ={}) post("repos/#{Repository.new(repo)}/issues/#{number}", .merge({:state => "open"})) 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("legacy/issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", )['issues'] end |
#update_comment(repo, number, comment, options = {}) ⇒ Comment
Update a single comment on an issue
191 192 193 |
# File 'lib/octokit/client/issues.rb', line 191 def update_comment(repo, number, comment, ={}) post("repos/#{Repository.new(repo)}/issues/comments/#{number}", .merge({:body => comment})) end |
#update_issue(repo, number, title, body, options = {}) ⇒ Issue
This implementation needs to be adjusted with switch to API v3
Update an issue
112 113 114 |
# File 'lib/octokit/client/issues.rb', line 112 def update_issue(repo, number, title, body, ={}) post("repos/#{Repository.new(repo)}/issues/#{number}", .merge({:title => title, :body => body})) end |