From dc03a5838fb3331b67c3b870f52de78744905c64 Mon Sep 17 00:00:00 2001 From: hakanensari Date: Fri, 14 Mar 2014 12:48:58 +0000 Subject: [PATCH] Add Honeybadger --- Gemfile | 1 + Gemfile.lock | 4 ++++ config.ru | 2 ++ config/initializers/honeybadger.rb | 10 ++++++++++ lib/tasks/honeybadger.rake | 1 + 5 files changed, 18 insertions(+) create mode 100644 config/initializers/honeybadger.rb create mode 100644 lib/tasks/honeybadger.rake 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'