Created
October 2, 2012 21:43
-
-
Save hinke/3823496 to your computer and use it in GitHub Desktop.
Fetch headers from build image and do something
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
get '/travis/:id/status' do |id| | |
token = "token!!" | |
http = Net::HTTP.new('magnum.travis-ci.com', 443) | |
http.use_ssl = true | |
path = "/Readmill/#{id}.png?token=#{token}" | |
response = http.head(path, nil) | |
if response['Content-Disposition'].include?('failing') | |
@message = "The build failed." | |
@background = "red" | |
else | |
@message = "The build passed." | |
@background = "green" | |
end | |
erb :travis_status, :layout => false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How does
@background
work? Do you do some trick with HTML in the Geckoboard text-widget?