No commit activity in last 3 years
No release in over 3 years
Hoptoad notifier for rack-based frameworks
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 2.1.2
= 0.2.6
 Project Readme

Lilypad

Hoptoad notifier for Rack-based frameworks.

Install

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

Basic Usage

require 'lilypad'
use Rack::Lilypad, 'hoptoad_api_key_goes_here'

Rails

config/environment.rb

require 'lilypad'

Rails::Initializer.run do |config|
  config.middleware.insert_after(ActionController::Failsafe, Rack::Lilypad)
end

Lilypad do
  api_key 'hoptoad_api_key_goes_here'
  rails
end

Sinatra

require 'lilypad'

class MyApp < Sinatra::Application
  use Rack::Lilypad do
    api_key 'hoptoad_api_key_goes_here'
    sinatra
  end
end

Error Redirection

Conditionally redirect errors to different Hoptoad buckets.

Lilypad do
  api_key do |env, exception|
    if exception && exception.message =~ /No route matches/
      'hoptoad_api_key_goes_here'
    elsif env && env['HTTP_USER_AGENT'] =~ /Googlebot/
      'hoptoad_api_key_goes_here'
    else
      'hoptoad_api_key_goes_here'
    end
  end
end

Notify

Send exceptions to Hoptoad from a rescue block.

begin
  raise 'Test'
rescue Exception => e
  Lilypad.notify(e)
end

Deploy

Send deploy notifications to Hoptoad.

deploy.rb

require 'capistrano/lilypad'
Lilypad { api_key 'hoptoad_api_key_goes_here' }

Or you can do it manually:

Lilypad.deploy(
  :environment => 'production',
  :repository => 'git@github.com:winton/lilypad.git',
  :revision => '8acc488967085987f0a9f2c662383119f83e1bb8',
  :username => 'winton'
)

Options

Below are the available options and their default values:

Lilypad do
  api_key nil
  environments %w(production staging)
  deploy_url 'http://hoptoadapp.com:80/deploys.txt'
  notify_url 'http://hoptoadapp.com:80/notifier_api/v2/notices'
  filters []  # Array of environment variables to hide from Hoptoad
  log nil     # Path of Hoptoad log
  rails       # Requires the Rails adapter
  sinatra     # Requires the Sinatra adapter
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.