lib/travis/client/session.rb in travis-1.3.1 vs lib/travis/client/session.rb in travis-1.4.0

- old
+ new

@@ -1,9 +1,11 @@ require 'travis/client' require 'faraday' require 'faraday_middleware' +require 'typhoeus/adapters/faraday' + require 'json' module Travis module Client class Session @@ -14,16 +16,16 @@ def initialize(options = Travis::Client::ORG_URI) @headers = {} @cache = {} @instruments = [] @config = nil - @faraday_adapter = :net_http_persistent + @faraday_adapter = :typhoeus 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 - headers['Accept'] ||= 'application/vnd.travis-ci.2+json, */*; q=0.01' + headers['Accept'] ||= 'application/json; version=2' end def uri connection.url_prefix.to_s if connection end