Module: Octokit::Client::Issues

Included in:
Octokit::Client
Defined in:
lib/octokit/client/issues.rb

Instance Method Summary collapse

Instance Method Details

#add_comment(repo, number, comment, options = {}) ⇒ Object



55
56
57
# File 'lib/octokit/client/issues.rb', line 55

def add_comment(repo, number, comment, options={})
  post("issues/comment/#{Repository.new(repo)}/#{number}", options.merge({:comment => comment}))['comment']
end

#add_label(repo, label, number = nil, options = {}) ⇒ Object



47
48
49
# File 'lib/octokit/client/issues.rb', line 47

def add_label(repo, label, number=nil, options={})
  post(["issues/label/add/#{Repository.new(repo)}/#{label}", number].compact.join('/'), options)['labels']
end

#close_issue(repo, number, options = {}) ⇒ Object



31
32
33
# File 'lib/octokit/client/issues.rb', line 31

def close_issue(repo, number, options={})
  post("issues/close/#{Repository.new(repo)}/#{number}", options)['issue']
end

#create_issue(repo, title, body, options = {}) ⇒ Object Also known as: open_issue



26
27
28
# File 'lib/octokit/client/issues.rb', line 26

def create_issue(repo, title, body, options={})
  post("issues/open/#{Repository.new(repo)}", options.merge({:title => title, :body => body}))['issue']
end

#issue(repo, number, options = {}) ⇒ Object



18
19
20
# File 'lib/octokit/client/issues.rb', line 18

def issue(repo, number, options={})
  get("issues/show/#{Repository.new(repo)}/#{number}", options)['issue']
end

#issue_comments(repo, number, options = {}) ⇒ Object



22
23
24
# File 'lib/octokit/client/issues.rb', line 22

def issue_comments(repo, number, options={})
  get("issues/comments/#{Repository.new(repo)}/#{number}", options)['comments']
end

#issues(repo, state = 'open', options = {}) ⇒ Object Also known as: list_issues



9
10
11
# File 'lib/octokit/client/issues.rb', line 9

def issues(repo, state='open', options={})
  get("issues/list/#{Repository.new(repo)}/#{state}", options)['issues']
end

#issues_labeled(repo, label, options = {}) ⇒ Object



14
15
16
# File 'lib/octokit/client/issues.rb', line 14

def issues_labeled(repo, label, options={})
  get("issues/list/#{Repository.new(repo)}/label/#{label}", options)['issues']
end

#labels(repo, options = {}) ⇒ Object



43
44
45
# File 'lib/octokit/client/issues.rb', line 43

def labels(repo, options={})
  get("issues/labels/#{Repository.new(repo)}", options)['labels']
end

#remove_label(repo, label, number = nil, options = {}) ⇒ Object



51
52
53
# File 'lib/octokit/client/issues.rb', line 51

def remove_label(repo, label, number=nil, options={})
  post(["issues/label/remove/#{Repository.new(repo)}/#{label}", number].compact.join('/'), options)['labels']
end

#reopen_issue(repo, number, options = {}) ⇒ Object



35
36
37
# File 'lib/octokit/client/issues.rb', line 35

def reopen_issue(repo, number, options={})
  post("issues/reopen/#{Repository.new(repo)}/#{number}", options)['issue']
end

#search_issues(repo, search_term, state = 'open', options = {}) ⇒ Object



5
6
7
# File 'lib/octokit/client/issues.rb', line 5

def search_issues(repo, search_term, state='open', options={})
  get("issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", options)['issues']
end

#update_issue(repo, number, title, body, options = {}) ⇒ Object



39
40
41
# File 'lib/octokit/client/issues.rb', line 39

def update_issue(repo, number, title, body, options={})
  post("issues/edit/#{Repository.new(repo)}/#{number}", options.merge({:title => title, :body => body}))['issue']
end