Class: Gravaty::Utils::Downloader::Downloader

Inherits:
Object
  • Object
show all
Defined in:
lib/gravaty/utils/downloader.rb

Overview

!/usr/bin/env ruby

An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile’s HTTP implementation.

Author

Jon Maken

License

3-clause BSD

Revision

2012-03-25 23:01:19 -0600

Constant Summary collapse

VERSION =
'0.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.ftp_data_chunk_sizeObject

Returns the value of attribute ftp_data_chunk_size.



56
57
58
# File 'lib/gravaty/utils/downloader.rb', line 56

def ftp_data_chunk_size
  @ftp_data_chunk_size
end

.loggerObject

Returns the value of attribute logger.



56
57
58
# File 'lib/gravaty/utils/downloader.rb', line 56

def logger
  @logger
end

.max_ca_verify_depthObject

Returns the value of attribute max_ca_verify_depth.



56
57
58
# File 'lib/gravaty/utils/downloader.rb', line 56

def max_ca_verify_depth
  @max_ca_verify_depth
end

Class Method Details

.download_file(url, full_path, count = 3) ⇒ Object



63
64
65
66
67
68
# File 'lib/gravaty/utils/downloader.rb', line 63

def self.download_file(url, full_path, count = 3)
  raise I18n.t('error.nil') if url.nil?
  return if File.exist?(full_path)

  http_download(url, full_path, count)
end