diff --git a/Gemfile b/Gemfile index 1363e6d..52075bd 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'http://rubygems.org' ruby '2.1.1' gem 'fixer' +gem 'honeybadger' gem 'rake' gem 'sequel_pg' gem 'sinatra-jsonp' diff --git a/Gemfile.lock b/Gemfile.lock index 1b6d664..9aad827 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,10 @@ GEM equalizer (0.0.9) fixer (0.5.0) nokogiri (~> 1.5) + honeybadger (1.11.0) + json ice_nine (0.11.0) + json (1.8.1) kgio (2.9.2) mini_portile (0.5.2) minitest (5.3.0) @@ -59,6 +62,7 @@ PLATFORMS DEPENDENCIES fixer + honeybadger minitest rack-test rake diff --git a/config.ru b/config.ru index 1903526..7072c37 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,5 @@ require './config/environment' require 'api' + +use Honeybadger::Rack run Sinatra::Application diff --git a/config/initializers/honeybadger.rb b/config/initializers/honeybadger.rb new file mode 100644 index 0000000..c4dbcf3 --- /dev/null +++ b/config/initializers/honeybadger.rb @@ -0,0 +1,10 @@ +require 'honeybadger' + +Honeybadger.configure do |config| + config.environment_name = App.env + config.api_key = ENV['HONEYBADGER_API_KEY'] + + config.async do |notice| + Thread.new { notice.deliver } + end +end diff --git a/lib/tasks/honeybadger.rake b/lib/tasks/honeybadger.rake new file mode 100644 index 0000000..e636982 --- /dev/null +++ b/lib/tasks/honeybadger.rake @@ -0,0 +1 @@ +require 'honeybadger/shared_tasks'