Class: Codebot::Formatters::CommitComment
Overview
This class formats commit_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
34
35
36
|
# File 'lib/codebot/formatters/commit_comment.rb', line 34
def comment_body
(:comment, :body).to_s
end
|
#commit_id ⇒ Object
38
39
40
|
# File 'lib/codebot/formatters/commit_comment.rb', line 38
def commit_id
(:comment, :commit_id)
end
|
26
27
28
|
# File 'lib/codebot/formatters/commit_comment.rb', line 26
def default_format
'[%<repository>s] %<sender>s commented on commit %<hash>s: %<summary>s'
end
|
Formats IRC messages for a commit_comment event.
13
14
15
|
# File 'lib/codebot/formatters/commit_comment.rb', line 13
def format
["#{summary}: #{format_url url}"]
end
|
#summary ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/codebot/formatters/commit_comment.rb', line 17
def summary
default_format % {
repository: format_repository(repository_name),
sender: format_user(sender_name),
hash: format_hash(commit_id),
summary: prettify(comment_body)
}
end
|
#summary_url ⇒ Object
30
31
32
|
# File 'lib/codebot/formatters/commit_comment.rb', line 30
def summary_url
(:comment, :html_url).to_s
end
|