Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ffae2d

Browse files
committed
break up campfire messages into two parts. 1) paste with all commits messages 2) compare or commit url
1 parent 448ba26 commit 4ffae2d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

services/campfire.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@
2222

2323
throw(:halt, 400) unless room
2424

25+
message = "[#{repository}/#{branch}]\n"
26+
message += commits.map do |commit|
27+
"#{commit['id'][0..5]} #{commit['message']} - #{commit['author']['name']}"
28+
end.join("\n")
29+
2530
if commits.size > 1
26-
commit = commits.last
2731
before, after = payload['before'], payload['after']
28-
compare_url = payload['repository']['url'] + "/compare/#{before}...#{after}"
29-
room.speak "[#{repository}/#{branch}] #{commit['message']} (+#{commits.size - 1} more commits...) - #{commit['author']['name']} (#{compare_url})"
32+
url = payload['repository']['url'] + "/compare/#{before}...#{after}"
3033
else
31-
commits.each do |commit|
32-
room.speak "[#{repository}/#{branch}] #{commit['message']} - #{commit['author']['name']} (#{commit['url']})"
33-
end
34+
url = commit['url']
3435
end
36+
37+
room.paste message
38+
room.speak url
3539
room.play "rimshot" if play_sound
3640

3741
room.leave

0 commit comments

Comments
 (0)