Class: Codebot::Formatters::Fork
Overview
This class formats fork 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
23
24
25
|
# File 'lib/codebot/formatters/fork.rb', line 23
def default_format
'[%<repository>s] %<sender>s created fork %<fork_owner>s/%<fork_name>s'
end
|
#fork_name ⇒ Object
31
32
33
|
# File 'lib/codebot/formatters/fork.rb', line 31
def fork_name
(:forkee, :name)
end
|
#fork_owner_login ⇒ Object
27
28
29
|
# File 'lib/codebot/formatters/fork.rb', line 27
def fork_owner_login
(:forkee, :owner, :login)
end
|
Formats IRC messages for a fork event.
10
11
12
|
# File 'lib/codebot/formatters/fork.rb', line 10
def format
["#{summary}: #{format_url url}"]
end
|
#summary ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/codebot/formatters/fork.rb', line 14
def summary
default_format % {
repository: format_repository(repository_name),
sender: format_user(sender_name),
fork_owner: format_user(fork_owner_login),
fork_name: format_repository(fork_name)
}
end
|
#summary_url ⇒ Object
35
36
37
|
# File 'lib/codebot/formatters/fork.rb', line 35
def summary_url
(:forkee, :html_url).to_s
end
|