Sha256: 3b601d841afd267e9de7fa7b3aa211be23218a412a35ea876ac7583b0722fa09

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

module Errplane
  class Configuration
    attr_accessor :api_key
    attr_accessor :api_host
    attr_accessor :application_id
    attr_accessor :application_name
    attr_accessor :application_root

    attr_accessor :logger
    attr_accessor :rails_environment
    attr_accessor :framework
    attr_accessor :framework_version
    attr_accessor :language
    attr_accessor :language_version
    attr_accessor :ignored_exceptions
    attr_accessor :ignored_environments
    attr_accessor :environment_variables

    attr_accessor :debug

    DEFAULTS = {
      :api_host => "api.errplane.com",
      :ignored_exceptions => %w{ActiveRecord::RecordNotFound
                                ActionController::RoutingError},
      :ignored_environments => %w{development test cucumber selenium}
    }

    def initialize
      @api_host = DEFAULTS[:api_host]
      @ignored_exceptions = DEFAULTS[:ignored_exceptions].dup
      @ignored_environments = DEFAULTS[:ignored_environments].dup
      @debug = false
    end

    def debug?
      !!@debug
    end

    def ignore_current_environment?
      self.ignored_environments.include?(self.rails_environment)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
errplane-0.2.0 lib/errplane/configuration.rb
errplane-0.1.9 lib/errplane/configuration.rb