<commit_before># Raven-Ruby

[![Gem Version](https://img.shields.io/gem/v/sentry-raven.svg)](https://rubygems.org/gems/sentry-raven)
[![Build Status](https://img.shields.io/travis/getsentry/raven-ruby/master.svg)](https://travis-ci.org/getsentry/raven-ruby)
[![Coverage Status](https://img.shields.io/coveralls/getsentry/raven-ruby/master.svg)](https://coveralls.io/r/getsentry/raven-ruby)

A client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API.

## Requirements

We test on Ruby MRI 1.8.7, 1.9.3 and 2.0.0. Rubinius and JRuby support is experimental.

## Installation

```ruby
gem "sentry-raven" #, :github => "getsentry/raven-ruby"
```

## Usage

The easiest way to configure Raven is by setting the ``SENTRY_DSN`` environment variable.

You'll find this value on your project settings page, and it should resemble something like ```https://public:secret@app.getsentry.com/9999```.

For alternative configuration methods, and other options see [Configuration](#configuration).

### Rails 3

In Rails 3, Sentry will "just work" capturing any exceptions thrown in your app. All Rails integrations also
have mixed-in methods for capturing exceptions you've rescued yourself inside of controllers:

```ruby
 # ...
 rescue => exception
   capture_exception(exception) # or capture_message('Flux overload')
   flash[:error] = 'Your flux capacitor is overloaded!'
 end
```

#### Delayed::Job

Reporting errors raised in delayed jobs should work out-of the box. Usage of [delayed-plugins-raven](https://github.com/qiushihe/delayed-plugins-raven) gem is deprecated.

### Rails 2

No support for Rails 2 yet, but it is being worked on.

### Rack

Add ```use Raven::Rack``` to your ```config.ru``` (or other rackup file).

### Sinatra

Like any other Rack middleware, add ```use Raven::Rack``` to your Sinatra app.

### Sidekiq

Raven includes [Sidekiq middleware](https://github.com/mperham/sidekiq/wiki/Middleware) which takes
care of reporting errors that occur in Sidekiq jobs. To use it, just require the middleware by doing

```ruby
require 'raven/sidekiq'
```
after you require Sidekiq. If you are using Sidekiq with Rails, just put this
require somewhere in the initializers.

<commit_msg>Remove manual error reporting example for Rails3<commit_after># Raven-Ruby

[![Gem Version](https://img.shields.io/gem/v/sentry-raven.svg)](https://rubygems.org/gems/sentry-raven)
[![Build Status](https://img.shields.io/travis/getsentry/raven-ruby/master.svg)](https://travis-ci.org/getsentry/raven-ruby)
[![Coverage Status](https://img.shields.io/coveralls/getsentry/raven-ruby/master.svg)](https://coveralls.io/r/getsentry/raven-ruby)

A client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API.

## Requirements

We test on Ruby MRI 1.8.7, 1.9.3 and 2.0.0. Rubinius and JRuby support is experimental.

## Installation

```ruby
gem "sentry-raven" #, :github => "getsentry/raven-ruby"
```

## Usage

The minimum configuration require setting the ``SENTRY_DSN`` with value found on your Sentry project settings page. It should resemble something like ```https://public:secret@app.getsentry.com/9999```. See [Configuration](#configuration) for configuration methods, and other options.

Many implementations will automatically capture uncaught exceptions (such as Rails, Sidekiq or by using
the Rack middleware). If you catch those exceptions yourself, but still want to report on them, see section [Capturing Events](#capturing-events).

### Rails 3 or 4

In Rails 3 or 4 all uncaught exceptions will be automatically reported.

#### Delayed::Job

No extra configuration required. Usage of [delayed-plugins-raven](https://github.com/qiushihe/delayed-plugins-raven) gem is deprecated.

### Rails 2

No support for Rails 2 yet, but it is being worked on.

### Rack

Add ```use Raven::Rack``` to your ```config.ru``` (or other rackup file).

### Sinatra

Like any other Rack middleware, add ```use Raven::Rack``` to your Sinatra app.

### Sidekiq

Raven includes [Sidekiq middleware](https://github.com/mperham/sidekiq/wiki/Middleware) which takes
care of reporting errors that occur in Sidekiq jobs. To use it, just require the middleware by doing

```ruby
require 'raven/sidekiq'
```
after you require Sidekiq. If you are using Sidekiq with Rails, just put this require somewhere in the initializers.


{'fraction_non_alphanumeric': 0.12585499316005472, 'fraction_numerical': 0.0084359325125399, 'mean_word_length': 4.8105960264900665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7091032', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1327, 'n_words': 453}