Class: Codebot::Formatters::IssueComment
Overview
This class formats issue_comment events.
Instance Attribute Summary
#payload
Instance Method Summary
collapse
#abbreviate, #action, #ary_to_sentence, #closed?, #extract, #format_branch, #format_dangerous, #format_event, #format_hash, #format_number, #format_repository, #format_url, #format_user, #gitlab_action, #gitlab_closed?, #gitlab_opened?, #gitlab_repository_url, #gitlab_url, #initialize, #opened?, #prettify, #repository_name, #repository_url, #sanitize, #sender_name, #shorten_url, #url
Instance Method Details
#comment_body ⇒ Object
32
33
34
|
# File 'lib/codebot/formatters/issue_comment.rb', line 32
def comment_body
(:comment, :body).to_s
end
|
23
24
25
26
|
# File 'lib/codebot/formatters/issue_comment.rb', line 23
def default_format
'[%<repository>s] %<sender>s commented on issue' \
' #%<number>s: %<summary>s'
end
|
Formats IRC messages for an issue_comment event.
10
11
12
|
# File 'lib/codebot/formatters/issue_comment.rb', line 10
def format
["#{summary}: #{format_url url}"]
end
|
#issue_number ⇒ Object
36
37
38
|
# File 'lib/codebot/formatters/issue_comment.rb', line 36
def issue_number
(:issue, :number)
end
|
#summary ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/codebot/formatters/issue_comment.rb', line 14
def summary
default_format % {
repository: format_repository(repository_name),
sender: format_user(sender_name),
number: issue_number,
summary: prettify(comment_body)
}
end
|
#summary_url ⇒ Object
28
29
30
|
# File 'lib/codebot/formatters/issue_comment.rb', line 28
def summary_url
(:comment, :html_url).to_s
end
|