Skip to content
Browse files

Only show up to 7 commits

  • Loading branch information...
1 parent f15db52 commit ff03e3e8ed002cd5cc644d5d4b191cd4ed46969e Evan Phoenix committed Jan 6, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/irc_cat/http_server/github.rb
View
10 lib/irc_cat/http_server/github.rb
@@ -15,7 +15,11 @@ def process(request, response)
json = JSON.parse(post['payload'].join(','))
channel = @config['irc']['channel']
branch = json['ref'].split("/").last
- json['commits'].each do |c|
+ commits = json['commits']
+
+ show = commits[0,7]
+
+ show.each do |c|
topic = c['message'].split("\n").first
ref = c['id'][0,7]
author = c['author']['name']
@@ -25,6 +29,10 @@ def process(request, response)
@bot.say channel, "#{topic} - #{ref} - #{author}"
end
end
+
+ if commits.size > 7
+ @bot.say channel, "#{commits.size - 7} more commits"
+ end
end
end
end

0 comments on commit ff03e3e

Please sign in to comment.
Something went wrong with that request. Please try again.