class Jetel::Downloaders::BaseDownloader

Constants

DATA_DIRECTORY
OPTS_DOWNLOAD

Public Instance Methods

download(url, opts = OPTS_DOWNLOAD) click to toggle source
# File lib/jetel/downloaders/base_downloader.rb, line 36
def download(url, opts = OPTS_DOWNLOAD)
  opts = OPTS_DOWNLOAD.merge(opts)

  dir = opts[:dir]

  fail 'Dir can not be nil or empty!' if dir.nil? || dir.empty?
  unless Dir.exist?(dir)
    FileUtils.mkdir_p(dir)
  end

  puts "Downloading #{url}"
end