lib/hoptoad_notifier/configuration.rb in hoptoad_notifier-2.4.2 vs lib/hoptoad_notifier/configuration.rb in hoptoad_notifier-2.4.4

- old
+ new

@@ -5,11 +5,12 @@ OPTIONS = [:api_key, :backtrace_filters, :development_environments, :development_lookup, :environment_name, :host, :http_open_timeout, :http_read_timeout, :ignore, :ignore_by_filters, :ignore_user_agent, :notifier_name, :notifier_url, :notifier_version, :params_filters, :project_root, :port, :protocol, :proxy_host, - :proxy_pass, :proxy_port, :proxy_user, :secure, :framework, :js_notifier].freeze + :proxy_pass, :proxy_port, :proxy_user, :secure, :framework, + :user_information].freeze # The API key for your project, found on the project edit form. attr_accessor :api_key # The host to connect to (defaults to hoptoadapp.com). @@ -60,13 +61,10 @@ attr_accessor :development_environments # +true+ if you want to check for production errors matching development errors, +false+ otherwise. attr_accessor :development_lookup - # +true+ if you want to enable the JavaScript notifier in production environments - attr_accessor :js_notifier - # The name of the environment the application is running in attr_accessor :environment_name # The path to the project in which the error occurred, such as the RAILS_ROOT attr_accessor :project_root @@ -81,10 +79,13 @@ attr_accessor :notifier_url # The logger used by HoptoadNotifier attr_accessor :logger + # The text that the placeholder is replaced with. {{error_id}} is the actual error number. + attr_accessor :user_information + # The framework HoptoadNotifier is configured to use attr_accessor :framework DEFAULT_PARAMS_FILTERS = %w(password password_confirmation).freeze @@ -126,15 +127,15 @@ @ignore_by_filters = [] @ignore = IGNORE_DEFAULT.dup @ignore_user_agent = [] @development_environments = %w(development test cucumber) @development_lookup = true - @js_notifier = false @notifier_name = 'Hoptoad Notifier' @notifier_version = VERSION @notifier_url = 'http://hoptoadapp.com' @framework = 'Standalone' + @user_information = 'Hoptoad Error {{error_id}}' end # 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. @@ -213,9 +214,13 @@ if secure? 'https' else 'http' end + end + + def js_notifier=(*args) + warn '[HOPTOAD] config.js_notifier has been deprecated and has no effect. You should use <%= hoptoad_javascript_notifier %> directly at the top of your layouts. Be sure to place it before all other javascript.' end def environment_filters warn 'config.environment_filters has been deprecated and has no effect.' []