X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fwhatever-dl.git;a=blobdiff_plain;f=src%2Furi_utilities.rb;h=df09619fce99cf8adaaaaed4f3322eb9cba8a151;hp=61d57af63ea29d84b03ef70b65dfebcbf34e6e32;hb=83e06f83d8274cb32a406739839d56e759664b09;hpb=2c835ed7a247ed5639277bc9674b848722ad998d diff --git a/src/uri_utilities.rb b/src/uri_utilities.rb index 61d57af..df09619 100644 --- a/src/uri_utilities.rb +++ b/src/uri_utilities.rb @@ -25,13 +25,6 @@ require 'vendor/ruby-progressbar/progressbar' # for trouble. class UriUtilities - # Get the filename portion of a given URI. - # Return nil if there is no filename portion. - def get_filename(uri) - return uri.path.split('/').last - end - - # Download the given URI object to . # Should use the progress_proc parameter to show # a progress bar using the Ruby/ProgressBar library. @@ -39,7 +32,7 @@ class UriUtilities # We wrap the whole thing in a begin/rescue so that # we can clean up afterwards in case of an error. begin - open(outfile_name, 'wb') do |outfile| + File.open(outfile_name, 'wb') do |outfile| pbar = nil uri.open(:content_length_proc => lambda {|content_length| if content_length && (0 < content_length)