Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A merb plugin for hoptoad notification

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
README
This is merb plugin for using hoptoad with merb.

This plugin: http://github.com/joakimk/hoptoad_notifier_merb/tree/master
The original: http://github.com/thoughtbot/hoptoad_notifier/tree/master

Usage:

1) Get your api key for your app from hoptoadapp.com

2) Add the api key to config/hoptoad.yml with a similar syntax as the following
---
:development: &defaults
  :api_key: ZOMGLOLROFLMAO

:rake:
  <<: *defaults

:test:
  <<: *defaults

:production:
  :api_key: UBERSECRETSHIT


3) Require hoptoad in init.rb
require 'merb_hoptoad_notifier'

4) Add the following method to your Exceptions controller.  Depending on your merb version you'll need to use the exceptions,standard_error, or internal_server error as the action name.  Kinda weak, but the API changed a lot in 0.9.x

class Exceptions < Merb::Controller
  if %w( staging production ).include?(Merb.env)
    def standard_error
      HoptoadNotifier.notify_hoptoad(request, session)
      render
    end
  end
end

5) Restart the server, trigger an error(in staging or prod) and check that it arrived at hoptoad :)


Many thanks to Joakim Kolsjö for creating most of the hoptoad code.  I just spec'd and updated it. ;)

Something went wrong with that request. Please try again.