Class: Deployman::Component::Downloader::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/deployman/component/downloader.rb

Instance Method Summary collapse

Instance Method Details

#download_file(url, full_path, auth = false, redirects = 3) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/deployman/component/downloader.rb', line 15

def download_file(url, full_path, auth = false, redirects = 3)
  if File.exist?(full_path)
    print "(file already exists)..."
    return
  end

  uri = URI.parse(url)
  case uri.scheme.downcase
  when /ftp/
      puts "ftp not supported yet"
return false
  when /http|https/
    Main::http_download(url, full_path, auth, redirects)
  end
end