lib/desi/downloader.rb in desi-0.1.0 vs lib/desi/downloader.rb in desi-0.2.0
- old
+ new
@@ -9,10 +9,10 @@
class Downloader
def initialize(opts = {})
@destination_dir = Pathname(opts.fetch(:destination_dir, Desi::LocalInstall.new))
@host = URI(opts.fetch(:host, 'http://cloud.github.com/'))
- @client = Desi::HttpClient.new(@host)
+ @client = opts.fetch(:http_client_factory, Desi::HttpClient).new(@host)
@verbose = opts[:verbose]
end
def download!(version, opts = {})
path = "/downloads/elasticsearch/elasticsearch/#{version.name}"