class ErrorappNotifier::Config

Constants

DEFAULT_IGNORE_EXCEPTIONS
DEFAULT_PARAMS_FILTERS

Attributes

api_key[RW]
disabled_by_default[RW]
environment_name[RW]
http_open_timeout[RW]
http_proxy_host[RW]
http_proxy_password[RW]
http_proxy_port[RW]
http_proxy_username[RW]
http_read_timeout[RW]
ignore_exceptions[RW]
ignore_user_agents[RW]
logger[RW]
params_filters[RW]
project_root[RW]
remote_host[RW]
remote_port[RW]
ssl[RW]
ssl?[RW]

Public Class Methods

new() click to toggle source
# File lib/errorapp_notifier/config.rb, line 37
def initialize
  @api_key             = ENV['ERRORAPP_API_KEY']
  @disabled_by_default = %w(development test)
  @http_open_timeout   = 2
  @http_read_timeout   = 4
  @ignore_exceptions   = DEFAULT_IGNORE_EXCEPTIONS
  @ignore_user_agents  = []
  @logger              = Logger.new(STDOUT)
  @params_filters      = DEFAULT_PARAMS_FILTERS
  @remote_host         = "errorapp.com"
  @remote_port         = nil
  @ssl                 = true
end

Public Instance Methods

application_environment() click to toggle source
# File lib/errorapp_notifier/config.rb, line 63
def application_environment
  @environment_name || ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
end
application_root() click to toggle source
# File lib/errorapp_notifier/config.rb, line 55
def application_root
  @project_root || Dir.pwd
end
should_send_to_api?() click to toggle source
# File lib/errorapp_notifier/config.rb, line 51
def should_send_to_api?
  !disabled_by_default.include?(application_environment)
end