Giter Site home page Giter Site logo

errorgem / merb_hoptoad_notifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cv/merb_hoptoad_notifier

1.0 2.0 0.0 100 KB

A merb plugin for hoptoad notification

Home Page: http://github.com/atmos/merb_hoptoad_notifier

License: MIT License

merb_hoptoad_notifier's Introduction

merb_hoptoad_notifier
---------------------------------------------
This is merb plugin for exception notification with hoptoad. It should work with
any merb app that's based on merb 1.0 and higher

This plugin: http://github.com/atmos/merb_hoptoad_notifier/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 :)


Filtersing your post environment
--------------------------------
If you have environmental variables set in your ruby process that should not be sent to hoptoad,
there's a mechanism for filtering those attributes now.  Throw something like this in 
config/init.rb

Merb::BootLoader.after_app_loads do
  HoptoadNotifier.environment_filters = %w(^AWS ^EC2 SECRET PRIVATE KEY)
end

Each of these words will be compiled into a regex so you should be able to use anchors if needed.

Thanks to the following GitHubbers
----------------------------------
joakimk, fairchild and cv.

merb_hoptoad_notifier's People

Contributors

atmos avatar phildarnowsky avatar aanand avatar

Stargazers

Salman Ahmed avatar

Watchers

James Cloos avatar Salman Ahmed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.