lib/desi/upstream.rb in desi-0.1.0 vs lib/desi/upstream.rb in desi-0.2.0

- old
+ new

@@ -1,19 +1,20 @@ # encoding: utf-8 require "desi/http_client" +require "json" module Desi class Upstream class Release < Struct.new(:name, :description, :release_date, :download_url) def to_s self.name end end - def initialize - @client = Desi::HttpClient.new('https://api.github.com/') + def initialize(opts = {}) + @client = opts.fetch(:http_client_factory, Desi::HttpClient).new('https://api.github.com/') end def releases @releases ||= fetch_releases. select {|v| v['content_type'] == 'application/gzip' }.