Skip to content

Instantly share code, notes, and snippets.

@hoverlover
Created February 27, 2011 21:23
Show Gist options
  • Save hoverlover/846552 to your computer and use it in GitHub Desktop.
Save hoverlover/846552 to your computer and use it in GitHub Desktop.
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