lib/buildbox/api.rb
def connection
      @connection ||= Faraday.new(:url => @config.api_endpoint,
                                  :ssl => { :ca_file => Buildbox.gem_path.join("lib", "certs", "cacert.pem").to_s }) do |faraday|
        faraday.request :retry
        faraday.request :json

        faraday.response :logger, ProxyLogger.new(@logger)
        faraday.response :mashify

        # JSON needs to come after mashify as it needs to run before the mashify
        # middleware.
        faraday.response :json
        faraday.response :raise_error

        faraday.adapter Faraday.default_adapter

        # Set some sensible defaults on the adapter.
        faraday.options[:timeout]      = 60
        faraday.options[:open_timeout] = 60
      end
    end
# Faraday uses debug to show response information, but when the agent is in
# DEBUG mode, it's kinda useless noise. So we use a ProxyLogger to only push
# the information we care about to the logger.
Faraday uses debug to show response information, but when the agent is in
DEBUG mode, it's kinda useless noise. So we use a ProxyLogger to only push
the information we care about to the logger.
Faraday uses debug to show response information but when the agent is in DEBUG mode it ' s kinda useless noise . So we use a ProxyLogger to only push the information we care about to the logger .
def connection
      @connection ||= Faraday.new(:url => @config.api_endpoint,
                                  :ssl => { :ca_file => Buildbox.gem_path.join("lib", "certs", "cacert.pem").to_s }) do |faraday|
        faraday.request :retry
        faraday.request :json
        faraday.response :logger, ProxyLogger.new(@logger)
        faraday.response :mashify
        faraday.response :json
        faraday.response :raise_error
        faraday.adapter Faraday.default_adapter
        faraday.options[:timeout]      = 60
        faraday.options[:open_timeout] = 60
      end
    end
def connection @connection ||= Faraday . new ( :url => @config . api_endpoint , :ssl => { :ca_file => Buildbox . gem_path . join ( "lib" , "certs" , "cacert.pem" ) . to_s } ) do | faraday | faraday . request :retry faraday . request :json faraday . response :logger , ProxyLogger . new ( @logger ) faraday . response :mashify faraday . response :json faraday . response :raise_error faraday . adapter Faraday . default_adapter faraday . options [ :timeout ] = 60 faraday . options [ :open_timeout ] = 60 end end
Faraday uses debug to show response information, but when the agent is in
DEBUG mode, it's kinda useless noise.
Faraday uses debug to show response information but when the agent is in DEBUG mode it ' s kinda useless noise .
# JSON needs to come after mashify as it needs to run before the mashify # middleware. # Set some sensible defaults on the adapter.