diff --git a/Gemfile b/Gemfile index d5fd2c07..9af7f9fd 100644 --- a/Gemfile +++ b/Gemfile @@ -55,3 +55,6 @@ gem 'active_model_serializers' gem 'axlsx_rails' gem 'd3_rails' gem 'coveralls', require: false +# Use a self-hosted errbit with the old notifier +gem 'hoptoad_notifier', "~> 2.3" + diff --git a/Gemfile.lock b/Gemfile.lock index bbbc4b4e..2ace9999 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,6 +97,9 @@ GEM haml (4.0.5) tilt hike (1.2.3) + hoptoad_notifier (2.4.11) + activesupport + builder htmlentities (4.3.1) i18n (0.6.9) inversion (0.12.3) @@ -170,7 +173,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.1.1) + rake (10.2.2) rdoc (3.12.2) json (~> 1.4) rdoc-generator-fivefish (0.0.1) @@ -267,6 +270,7 @@ DEPENDENCIES formtastic-bootstrap gravtastic haml + hoptoad_notifier (~> 2.3) jquery-fileupload-rails jquery-rails jquery-ui-rails diff --git a/config/config.yml.example b/config/config.yml.example index 1a7a7abb..1ff22de3 100644 --- a/config/config.yml.example +++ b/config/config.yml.example @@ -5,6 +5,9 @@ defaults: &defaults url_for_emails: localhost:3000 # A secret key. You can generate one with 'rake secret' devise_secret_key: 12345 + # errbit configuration, get your own instance: https://github.com/errbit/errbit + #errbit_key: 123456789101112131415 + #errbit_host: errbit.exmaple.com development: <<: *defaults diff --git a/config/initializers/hoptoad.rb b/config/initializers/hoptoad.rb new file mode 100644 index 00000000..970310a8 --- /dev/null +++ b/config/initializers/hoptoad.rb @@ -0,0 +1,24 @@ +HoptoadNotifier.configure do |config| + # Change this to some sensible data for your errbit instance + config.api_key = CONFIG["errbit_key"] || "" + config.host = CONFIG["errbit_host"] || "" + if config.api_key.blank? || config.host.blank? + config.development_environments = "production development test" + else + config.development_environments = "development test" + end + + config.ignore_only = %w{ + Some::ExceptionName + } + + config.ignore_by_filter do |exception_data| + ret=false + if exception_data[:error_class] == "ActionController::RoutingError" + message = exception_data[:error_message] + ret=true if message =~ %r{\[GET\]} + end + ret + end + +end