Created
February 8, 2015 14:40
-
-
Save YouSysAdmin/44f0e55c3dab1f3e107d to your computer and use it in GitHub Desktop.
Get Travis-CI status
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
require 'open-uri' | |
require 'string_color' | |
xml_data = open('https://api.travis-ci.org/repos/POStroi/EveOnlineItemParse/cc.xml').read | |
status = xml_data.scan(%r{lastBuildStatus="(.*)"})[0][0] | |
case status | |
when 'Success' | |
puts 'Ok'.green | |
when 'Failure' | |
puts 'Not Ok'.red | |
when 'Unknown' | |
puts 'Unknown status'.yellow | |
else | |
puts 'No data'.red | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment