From: <jh...@us...> - 2009-09-23 00:58:17
|
Revision: 97 http://etch.svn.sourceforge.net/etch/?rev=97&view=rev Author: jheiss Date: 2009-09-23 00:58:08 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Use URI.join to create URIs rather than string concatenation. Add the request to the debug message that is printed before sending the request to the server. Modified Paths: -------------- trunk/client/etch.rb Modified: trunk/client/etch.rb =================================================================== --- trunk/client/etch.rb 2009-09-23 00:55:17 UTC (rev 96) +++ trunk/client/etch.rb 2009-09-23 00:58:08 UTC (rev 97) @@ -29,7 +29,7 @@ end class Etch::Client - VERSION = '1.13' + VERSION = '1.14' CONFIRM_PROCEED = 1 CONFIRM_SKIP = 2 @@ -60,9 +60,15 @@ # FIXME: Read from config file ENV['PATH'] = '/bin:/usr/bin:/sbin:/usr/sbin:/opt/csw/bin:/opt/csw/sbin' - @filesuri = URI.parse(@server + '/files') - @resultsuri = URI.parse(@server + '/results') + # Make sure the server URL ends in a / so that we can append paths + # to it using URI.join + if @server !~ %r{/$} + @server << '/' + end + @filesuri = URI.join(@server, 'files') + @resultsuri = URI.join(@server, 'results') + @origbase = File.join(@varbase, 'orig') @historybase = File.join(@varbase, 'history') @lockbase = File.join(@varbase, 'locks') @@ -174,7 +180,7 @@ # Send request to server # - puts "Sending request to server #{@filesuri}" if (@debug) + puts "Sending request to server #{@filesuri}: #{request.inspect}" if (@debug) post = Net::HTTP::Post.new(@filesuri.path) post.set_form_data(request) sign_post!(post, @key) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |