Sha256: facb6dd481e0b112911b88a8d81b5c60ccaf2bfd1ea49e053d4598911546d331
Contents?: true
Size: 598 Bytes
Versions: 5
Compression:
Stored size: 598 Bytes
Contents
# encoding: utf-8 require 'fileutils' require_relative '../../config/config' module Jetel module Downloaders class BaseDownloader DATA_DIRECTORY = Config[:DATA_DIRECTORY] OPTS_DOWNLOAD = { :dir => DATA_DIRECTORY, :timeout => 600 } 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 end end end
Version data entries
5 entries across 5 versions & 1 rubygems