Sha256: 31a3904e374c0e1a0f40a5ab5efe9daa0a43451b8a7acd59156026daf40c845f

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

require "captivus/version"
require 'captivus/configuration'
require 'faraday/request/hmac_authentication'

module Captivus
  class << self
    def config
      @config ||= Configuration.new
    end

    def configure(*args, &block)
      config.configure *args, &block
    end

    def notify(exception)
      connection = Faraday.new(:url => "#{config.scheme}://#{config.host}") do |faraday|
        faraday.request :hmac_authentication, config.api_key, config.api_secret_key, {:service_id => 'Captivus'}
        faraday.adapter :net_http
      end

      connection.post do |request|
        request.headers['Content-Type'] = 'application/json; charset=UTF-8'
        request.url '/events'
        request.body = MultiJson.dump(Payload.new(exception).as_json)
      end
    end
  end
end

require 'captivus/auth_hmac'
require 'captivus/backtrace'
require 'captivus/payload'
require 'captivus/rack_capturer'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
captivus-0.0.3 lib/captivus.rb
captivus-0.0.2 lib/captivus.rb