Sha256: aa3a0086f77a3c53fd5c45587a3fc7151f1cf12db9e3400c315c6215c8cde42c

Contents?: true

Size: 612 Bytes

Versions: 11

Compression:

Stored size: 612 Bytes

Contents

require 'dply/helper'
require 'fileutils'
require 'dply/curl'

module Dply
  class ConfigDownloader

    include Helper
    attr_writer :skip_download

    def initialize(config_files , base_url)
      @config_files = config_files
      @base_url = base_url
      @skip_download = []
    end

    def download_all
      @config_files.each do |f|
        if @skip_download.include? f
          logger.debug "skipping to download file #{f}"
          next
        end
        curl.download "#{@base_url}/#{f}", "config/#{f}"
      end
    end

    private

    def curl
      @curl ||= Curl.new
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dply-0.2.19 lib/dply/config_downloader.rb
dply-0.2.18 lib/dply/config_downloader.rb
dply-0.2.17 lib/dply/config_downloader.rb
dply-0.2.16 lib/dply/config_downloader.rb
dply-0.2.15 lib/dply/config_downloader.rb
dply-0.2.14 lib/dply/config_downloader.rb
dply-0.2.13 lib/dply/config_downloader.rb
dply-0.2.11 lib/dply/config_downloader.rb
dply-0.2.10 lib/dply/config_downloader.rb
dply-0.2.9 lib/dply/config_downloader.rb
dply-0.2.8 lib/dply/config_downloader.rb