lib/carrierwave/storage/ftp.rb in carrierwave-ftp-0.2.1 vs lib/carrierwave/storage/ftp.rb in carrierwave-ftp-0.2.2

- old
+ new

@@ -67,20 +67,22 @@ def delete connection do |ftp| ftp.chdir(::File.dirname "#{@uploader.ftp_folder}/#{path}") ftp.delete(filename) end + rescue end private def file require 'net/http' - url = URI.parse(url) + url = URI.parse(self.url) req = Net::HTTP::Get.new(url.path) Net::HTTP.start(url.host, url.port) do |http| http.request(req) end + rescue end def connection ftp = ExFTP.open(@uploader.ftp_host, @uploader.ftp_user, @uploader.ftp_passwd, @uploader.ftp_port) ftp.passive = @uploader.ftp_passive