Skip to content

Commit

Permalink
Merge pull request github#222 from Mange/patch-1
Browse files Browse the repository at this point in the history
Use push helpers to format Talker messages
  • Loading branch information
technoweenie committed Jan 13, 2012
2 parents f943dd5 + 5df3bf1 commit fe24aac
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions services/talker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ def receive_push
http.url_prefix = data['url']

if data['digest'].to_i == 1 and commits.size > 1
commit = commits.last
message = "#{commit['author']['name']} pushed #{commits.size} commits to [#{repository}/#{branch}] #{payload['compare']}"
http_post 'messages.json', :message => message
http_post 'messages.json', :message => "#{summary_message}#{summary_url}"
else
commits.each do |commit|
message = "#{commit['author']['name']} pushed \"#{commit['message'].split("\n").first}\" - #{commit['url']} to [#{repository}/#{branch}]"
http_post 'messages.json', :message => "#{pusher_name} pushed the following commits:"
commit_messages.each do |message|
http_post 'messages.json', :message => message
end
end
Expand Down

0 comments on commit fe24aac

Please sign in to comment.