Module HoptoadNotifier
In: lib/hoptoad_notifier.rb
lib/hoptoad_notifier/railtie.rb
lib/hoptoad_notifier/rails/controller_methods.rb
lib/hoptoad_notifier/rails/action_controller_catcher.rb
lib/hoptoad_notifier/rails/javascript_notifier.rb
lib/hoptoad_notifier/rails/error_lookup.rb
lib/hoptoad_notifier/rails.rb
lib/hoptoad_notifier/rack.rb
lib/hoptoad_notifier/backtrace.rb
lib/hoptoad_notifier/sender.rb
lib/hoptoad_notifier/user_informer.rb
lib/hoptoad_notifier/version.rb
lib/hoptoad_notifier/configuration.rb
lib/hoptoad_notifier/notice.rb

Gem for applications to automatically post errors to the Hoptoad of their choice.

Methods

Classes and Modules

Module HoptoadNotifier::Rails
Class HoptoadNotifier::Backtrace
Class HoptoadNotifier::Configuration
Class HoptoadNotifier::Notice
Class HoptoadNotifier::Rack
Class HoptoadNotifier::Railtie
Class HoptoadNotifier::Sender
Class HoptoadNotifier::UserInformer

Constants

API_VERSION = "2.0"
LOG_PREFIX = "** [Hoptoad] "
HEADERS = { 'Content-type' => 'text/xml', 'Accept' => 'text/xml, application/xml'
VERSION = "2.4.11".freeze
IGNORE_DEFAULT = ['ActiveRecord::RecordNotFound', 'ActionController::RoutingError', 'ActionController::InvalidAuthenticityToken', 'CGI::Session::CookieStore::TamperedWithCookie', 'ActionController::UnknownAction', 'AbstractController::ActionNotFound']

External Aliases

secure -> secure?

Attributes

configuration  [RW]  A Hoptoad configuration object. Must act like a hash and return sensible values for all Hoptoad configuration options. See HoptoadNotifier::Configuration.
sender  [RW]  The sender object is responsible for delivering formatted data to the Hoptoad server. Must respond to send_to_hoptoad. See HoptoadNotifier::Sender.

Public Class methods

Call this method to modify defaults in your initializers.

@example

  HoptoadNotifier.configure do |config|
    config.api_key = '1234567890abcdef'
    config.secure  = false
  end

Returns the Ruby version, Rails version, and current Rails environment

Look for the Rails logger currently defined

Sends an exception manually using this method, even when you are not in a controller.

@param [Exception] exception The exception you want to notify Hoptoad about. @param [Hash] opts Data that will be sent to Hoptoad.

@option opts [String] :api_key The API key for this project. The API key is a unique identifier that Hoptoad uses for identification. @option opts [String] :error_message The error returned by the exception (or the message you want to log). @option opts [String] :backtrace A backtrace, usually obtained with caller. @option opts [String] :request The controller‘s request object. @option opts [String] :session The contents of the user‘s session. @option opts [String] :environment ENV merged with the contents of the request‘s environment.

Sends the notice unless it is one of the default ignored exceptions @see HoptoadNotifier.notify

Prints out the environment info to the log for debugging help

Tell the log that the Notifier is good to go

Prints out the response body from Hoptoad for debugging help

Writes out the given message to the logger

Public Instance methods

Allows config options to be read like a hash

@param [Symbol] option Key for a given attribute

Takes a block and adds it to the list of backtrace filters. When the filters run, the block will be handed each line of the backtrace and can modify it as necessary.

@example

  config.filter_bracktrace do |line|
    line.gsub(/^#{Rails.root}/, "[RAILS_ROOT]")
  end

@param [Proc] block The new backtrace filter. @yieldparam [String] line A line in the backtrace.

Takes a block and adds it to the list of ignore filters. When the filters run, the block will be handed the exception. @example

  config.ignore_by_filter do |exception_data|
    true if exception_data[:error_class] == "RuntimeError"
  end

@param [Proc] block The new ignore filter @yieldparam [Hash] data The exception data given to +HoptoadNotifier.notify+ @yieldreturn [Boolean] If the block returns true the exception will be ignored, otherwise it will be processed by hoptoad.

Overrides the list of default ignored errors.

@param [Array<Exception>] names A list of exceptions to ignore.

Overrides the list of default ignored user agents

@param [Array<String>] A list of user agents to ignore

Returns a hash of all configurable options merged with hash

@param [Hash] hash A set of configuration options that will take precedence over the defaults

Determines if the notifier will send notices. @return [Boolean] Returns false if in a development environment, true otherwise.

Returns a hash of all configurable options

[Validate]