lib/travis/client/session.rb in travis-1.5.2 vs lib/travis/client/session.rb in travis-1.5.3

- old
+ new

@@ -1,11 +1,16 @@ require 'travis/client' require 'faraday' require 'faraday_middleware' -require 'typhoeus/adapters/faraday' +require 'travis/tools/system' +begin + require 'typhoeus/adapters/faraday' unless Travis::Tools::System.windows? +rescue LoadError +end + require 'json' module Travis module Client class Session @@ -16,10 +21,10 @@ def initialize(options = Travis::Client::ORG_URI) @headers = {} @cache = {} @instruments = [] @config = nil - @faraday_adapter = :typhoeus + @faraday_adapter = defined?(Typhoeus) ? :typhoeus : :net_http options = { :uri => options } unless options.respond_to? :each_pair options.each_pair { |key, value| public_send("#{key}=", value) } raise ArgumentError, "neither :uri nor :connection specified" unless connection