lib/downlow/fetchers/http.rb in downlow-0.1.3 vs lib/downlow/fetchers/http.rb in downlow-0.1.4
- old
+ new
@@ -1,12 +1,12 @@
require 'open-uri'
module Downlow
class Http < Fetcher
-
- handles(/^http\:\/\//)
-
+
+ handles(/^https?\:\/\//)
+
def fetch
data = ""
filename = destination.basename
open(url.to_s) do |u|
if disposition = u.meta['content-disposition'] and
@@ -20,8 +20,8 @@
filename = filename.to_s.gsub(/\?(.*)$/,'')
self.destination = destination.dirname + filename
File.open(destination, 'w') {|f| f << data }
@local_path = destination
end
-
+
end
-end
\ No newline at end of file
+end