= Cruise Status CruiseStatus allows your Ruby scripts to check the status of your project's build. Use this to abort check-ins when the build has failed, for example. CruiseStatus currently supports checking builds run on cruisecontrol.rb[http://cruisecontrolrb.thoughtworks.com/] or on runcoderun.com[http://runcoderun.com/]. == CruiseControl.rb Example: To check a cruise.rb build, pass the url to the project RSS feed to +CruiseStatus+: require "cruisestatus" if CruiseStatus.new( 'http://my.cruise.com/projects.rss' ).pass? puts "Build passed!" else abort "Build failed…Boo!" end == RunCodeRun.com Example: To check a build on http://runcoderun.com, simply pass the url for the json API: require "cruisestatus" if CruiseStatus.new( 'http://runcoderun.com/api/v1/json/tobytripp' ).pass? puts "Build passed!" else abort "Build failed…boo!" end == Command-line Usage: The gem's binary is +cruisestatus+. Pass a URL to it and +cruisestatus+ will check the build status at that URL and return a non-zero status if any of the builds reported there have failed. Pass a `-p` option to prompt the user when a build has failed. If the user enters 'y' at the prompt, +cruisestatus+ will return a zero status regardless of build failures. For example: toby@Tobys-Mac:(git)cruisestatus[master]/$ cruisestatus -p http://runcoderun.com/api/v1/json/tobytripp Build FAILURES: cruisestatus Are you sure you want to check in? (y/n): y toby@Tobys-Mac:(git)cruisestatus[master]/$ echo $? 0 toby@Tobys-Mac:(git)cruisestatus[master]/$ cruisestatus -p http://runcoderun.com/api/v1/json/tobytripp Build FAILURES: cruisestatus Are you sure you want to check in? (y/n): n toby@Tobys-Mac:(git)cruisestatus[master]/$ echo $? 1 toby@Tobys-Mac:(git)cruisestatus[master]/$ You can use this to abort check-ins onto broken builds. (See the post-commit hook in http://github.com/tobytripp/git-pre-commit for example). As you know, if the CI build is broken, no one should be checking in new code unless they're fixing the build. You can use +cruisestatus+ to help keep developers honest in that regard. == Note on Patches/Pull Requests * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send me a pull request. == Build Status http://runcoderun.com/tobytripp/cruisestatus == TODO * Cruise.java support? == Copyright Copyright (c) 2010 Toby Tripp. See LICENSE for details.