Skip to content

Commit fe24aac

Browse files
committed
Merge pull request github#222 from Mange/patch-1
Use push helpers to format Talker messages
2 parents f943dd5 + 5df3bf1 commit fe24aac

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

services/talker.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ def receive_push
1313
http.url_prefix = data['url']
1414

1515
if data['digest'].to_i == 1 and commits.size > 1
16-
commit = commits.last
17-
message = "#{commit['author']['name']} pushed #{commits.size} commits to [#{repository}/#{branch}] #{payload['compare']}"
18-
http_post 'messages.json', :message => message
16+
http_post 'messages.json', :message => "#{summary_message}#{summary_url}"
1917
else
20-
commits.each do |commit|
21-
message = "#{commit['author']['name']} pushed \"#{commit['message'].split("\n").first}\" - #{commit['url']} to [#{repository}/#{branch}]"
18+
http_post 'messages.json', :message => "#{pusher_name} pushed the following commits:"
19+
commit_messages.each do |message|
2220
http_post 'messages.json', :message => message
2321
end
2422
end

0 commit comments

Comments
 (0)