Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tryn Mirell
committed
May 10, 2012
1 parent
2a725e1
commit cf90f94
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Find the build status of an open-source project on Travis | ||
# | ||
# <travis me> sferik/rails_admin - Returns the build status of https://github.com/sferik/rails_admin | ||
# | ||
|
||
module.exports = (robot) -> | ||
robot.respond /travis me (.*)/i, (msg) -> | ||
project = escape(msg.match[1]) | ||
msg.http("http://travis-ci.org/#{project}.json") | ||
.get() (err, res, body) -> | ||
response = JSON.parse(body) | ||
if response.last_build_status == 0 | ||
msg.send "Build status for #{project}: Passing" | ||
else if response.last_build_status == 1 | ||
msg.send "Build status for #{project}: Failing" | ||
else | ||
msg.send "Build status for #{project}: Unknown" |