/ Published in: Ruby
                    
                                        
This example shows how to release artifacts into Artifactory by using Buildr, the origin of this code is http://groups.google.com/group/buildr-talk/
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
module URI
class HTTP
protected
def write_internal(options, &block)
puts "Uploading to #{self}" if Rake.application.options.trace
Net::HTTP.start(host, port) do |http|
req=Net::HTTP::Put.new(path)
req.basic_auth user, password unless user.nil?
request_data=""
while chunk = yield(32*4096)
request_data+=chunk
end
resp, response_data=http.request(req, request_data)
unless resp.is_a?(Net::HTTPOK)
fail "Server returned failing response for upload to
#{self}: #{resp}\n#{response_data}"
end
end#def write_internal
end
end
end
Comments
 Subscribe to comments
                    Subscribe to comments
                
                