Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Airbrake notifier for rack-based frameworks
Ruby
tree: 3daa1b860c

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/rack
spec
.gitignore
MIT-LICENSE
README.markdown
Rakefile
gemspec.rb

README.markdown

Lilypad

Hoptoad notifier for Rack-based frameworks.

Install

sudo gem install lilypad --source http://gemcutter.org

Rails

config/environment.rb:

require 'rack/lilypad'

Rails::Initializer.run do |config|
  ENV['RACK_ENV'] = ENV['RAILS_ENV']
  config.middleware.insert_after(ActionController::Failsafe, Rack::Lilypad, 'hoptoad_api_key_goes_here')
end

app/controllers/application_controller.rb:

class ApplicationController < ActionController::Base

  def rescue_action(exception)
    super
    request.env['rack.lilypad.component'] = params[:controller]
    request.env['rack.lilypad.action'] = params[:action]
    raise exception
  end
end

Sinatra

require 'rack/lilypad'

class MyApp < Sinatra::Application
  enable :raise_errors # not necessary for Sinatra::Base
  use Rack::Lilypad, 'hoptoad_api_key_goes_here'
end

Filters

Don't send certain environment variables to Hoptoad.

use Rack::Lilypad, 'hoptoad_api_key_goes_here' do |hoptoad|
  hoptoad.filters << %w(AWS_ACCESS_KEY AWS_SECRET_ACCESS_KEY AWS_ACCOUNT SSH_AUTH_SOCK)
end

Debug

See what you are sending and receiving from Hoptoad.

use Rack::Lilypad, 'hoptoad_api_key_goes_here' do |hoptoad|
  hoptoad.log = '/var/www/log/hoptoad.log'
end

Compatibility

Tested with Ruby 1.8.6, 1.8.7, and 1.9.1.

Thanks

Lilypad wouldn't have happened without rack_hoptoad, toadhopper, Builder, and Nokogiri.

Something went wrong with that request. Please try again.