Created
February 27, 2011 21:23
-
-
Save hoverlover/846552 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Travis | |
class Builder | |
@@ -29,9 +30,18 @@ module Travis | |
host = rails_config['url'] || 'http://127.0.0.1' | |
url = "#{host}/builds/#{build['id']}#{'/log' if data.delete(:append)}" | |
uri = URI.parse(host) | |
- data = { :body => { :_method => :put, :build => data }, :head => { :authorization => [uri.user, uri.password] } } | |
- # stdout.puts "-- post to #{url} : #{data.inspect}" | |
- register_connection EventMachine::HttpRequest.new(url).post(data) | |
+ data = { | |
+ :body => { | |
+ :_method => :put, | |
+ :build => data | |
+ }, | |
+ :basic_auth => { | |
+ :username => uri.user, | |
+ :password => uri.password | |
+ } | |
+ } | |
+ #stdout.puts "-- post to #{url} : #{data.inspect}" | |
+ HTTParty.post(url, data) | |
rescue Exception => e | |
stdout.puts e.inspect | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment