diff --git a/lib/exception_notifier.rb b/lib/exception_notifier.rb index bde83602..f50182d0 100644 --- a/lib/exception_notifier.rb +++ b/lib/exception_notifier.rb @@ -12,12 +12,12 @@ def self.default_ignore_exceptions def initialize(app, options = {}) @app, @options = app, options - + Notifier.default_sender_address = @options[:sender_address] Notifier.default_exception_recipients = @options[:exception_recipients] Notifier.default_email_prefix = @options[:email_prefix] Notifier.default_sections = @options[:sections] - + @options[:ignore_exceptions] ||= self.class.default_ignore_exceptions end diff --git a/lib/exception_notifier/notifier.rb b/lib/exception_notifier/notifier.rb index d79cde60..a5d029d1 100644 --- a/lib/exception_notifier/notifier.rb +++ b/lib/exception_notifier/notifier.rb @@ -11,7 +11,7 @@ class << self attr_writer :default_exception_recipients attr_writer :default_email_prefix attr_writer :default_sections - + def default_sender_address @default_sender_address || %("Exception Notifier" ) end @@ -65,25 +65,24 @@ def exception_notification(env, exception) end private - - def clean_backtrace(exception) - Rails.respond_to?(:backtrace_cleaner) ? - Rails.backtrace_cleaner.send(:filter, exception.backtrace) : - exception.backtrace - end - - helper_method :inspect_object - - def inspect_object(object) - case object - when Hash, Array - object.inspect - when ActionController::Base - "#{object.controller_name}##{object.action_name}" - else - object.to_s - end + + def clean_backtrace(exception) + Rails.respond_to?(:backtrace_cleaner) ? + Rails.backtrace_cleaner.send(:filter, exception.backtrace) : + exception.backtrace + end + + helper_method :inspect_object + + def inspect_object(object) + case object + when Hash, Array + object.inspect + when ActionController::Base + "#{object.controller_name}##{object.action_name}" + else + object.to_s end - + end end end