Skip to content

Instantly share code, notes, and snippets.

@YouSysAdmin
Created February 8, 2015 14:40
Show Gist options
  • Save YouSysAdmin/44f0e55c3dab1f3e107d to your computer and use it in GitHub Desktop.
Save YouSysAdmin/44f0e55c3dab1f3e107d to your computer and use it in GitHub Desktop.
Get Travis-CI status
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