Class: Gish::Cli::Comments

Inherits:
Thor
  • Object
show all
Defined in:
lib/gish/cli/comments.rb

Instance Method Summary collapse

Instance Method Details

#delete(comment_number) ⇒ Object



24
25
26
27
# File 'lib/gish/cli/comments.rb', line 24

def delete(comment_number)
  return unless options.force? || confirm('Are you sure you want to delete this comment? (y/n)... ')
  Gish.delete_comment(comment_number)
end

#list(issue_number) ⇒ Object



9
10
11
# File 'lib/gish/cli/comments.rb', line 9

def list(issue_number)
  puts Gish.comments(issue_number)
end

#update(comment_number) ⇒ Object



15
16
17
18
19
20
# File 'lib/gish/cli/comments.rb', line 15

def update(comment_number)
  existing_comment = Gish.issue_comment(comment_number).body
  message = capture_editor_input(existing_comment) unless options.message? && options.message != 'message'
  message ||= options.message
  Gish.update_comment(comment_number, message)
end