Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samwho/airbrake-sinatra
A Sinatra helper method for injecting the Airbrake javascript into your templates.
https://github.com/samwho/airbrake-sinatra
Last synced: about 2 months ago
JSON representation
A Sinatra helper method for injecting the Airbrake javascript into your templates.
- Host: GitHub
- URL: https://github.com/samwho/airbrake-sinatra
- Owner: samwho
- License: mit
- Created: 2012-11-08T12:18:33.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-11-12T10:47:35.000Z (about 12 years ago)
- Last Synced: 2024-10-14T20:43:32.272Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 125 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Airbrake::Sinatra
The helper method provided with the official Airbrake gem is specific to Rails
and requires a bit of hacking to get working in Sinatra. This gem exists to
serve as a Sinatra helper method for the Airbrake Javascript.## Installation
Add this line to your application's Gemfile:
gem 'airbrake-sinatra', :require => 'sinatra/airbrake-javascript'
And then execute:
$ bundle
Or install it yourself as:
$ gem install airbrake-sinatra
## Usage
There are two sample applications in the source code on Github. You will find
them under the `examples/` directory. One of them shows how to use this gem with
a standard Sinatra `server.rb` file. The other shows how to use this gem with
your own class that extends `Sinatra::Base`. There is a subtle difference :)Essentially all it boils down to is using the `airbrake_javascript_sinatra`
helper in your views. An example layout might look something like this:``` haml
%head
= airbrake_javascript_sinatra
%body
%p
The Airbrake javascript helper is outputting the following into the header:
%pre= h airbrake_javascript_sinatra
```Note that if you do not use `Bundler.require` with the `gem` line specified in
the above section you will need to require the gem manually like so:``` ruby
require 'sinatra/airbrake-javascript'
```## Developing
There are two Rake tasks that are there for development purposes:
$ rake example:one
$ rake example:twoBoth of these cd into the appropriate `example/` directory and execute the
`shotgun` command.## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request