<commit_before>= => errship

The static error pages Rails comes with are nice for getting started - you can't
break them, no matter what. But without your layout and navigation wrapped around
them, they create a frustrating trap for your users.

The obvious solution is to render your layout into the static file, but what happens
when you make a change?

Worse, what if you run a network of many Rails applications? Should they share one
error page style? Should they all have their own?

You could hire your nephew to keep them all up to date... or you can use Errship.

Errship is a Rails 3.1 engine for rendering error pages inside your layout. It supports
i18n, custom exceptions, and Airbrake (Hoptoad) error tracking.

You can also use the flashback method to set an error message and redirect :back safely - if
a RedirectBackError is raised, the user is dropped off at the nearest error page and given 
the flash message anyway.

== Installation

Add this to your Gemfile
    gem 'errship', :git => '<EMAIL>:agoragames/errship.git'

Add this to your ApplicationController
    class ApplicationController < ActionController::Base
      include Errship::Rescuers

Errship is ready to go! To test it out in development, you'll need to set

    config.consider_all_requests_local = false

in your config/environments/development.rb file. Just don't forget to change it back
when you want useful debugging output again instead!

Alternatively, simply point your browser to /error or /not_found to get a taste.

== Custom Rescuers

If you want errship to rescue errors from your own custom exception class, you need
to add a custom rescuer in your ApplicationController, like so:

    # Render the 404 page
    rescue_from MyException::SomethingMissing, :with => :render_404_error

    # Render the 500 page
    rescue_from MyException::SomethingWentWrong, :with => :render_error<commit_msg>Updating README for version 1.0.0<commit_after>= => errship

The static error pages Rails comes with are nice for getting started - you can't
break them, no matter what. But without your layout and navigation wrapped around
them, they create a frustrating trap for your users.

The obvious solution is to render your layout into the static file, but what happens
when you make a change?

Worse, what if you run a network of many Rails applications? Should they share one
error page style? Should they all have their own?

You could hire your nephew to keep them all up to date... or you can use Errship.

Errship is a Rails 3.1 engine for rendering error pages inside your layout. It supports
i18n, custom exceptions, and Airbrake (Hoptoad) error tracking.

You can also use the flashback method to set an error message and redirect :back safely - if
a RedirectBackError is raised, the user is dropped off at the nearest error page and given 
the flash message anyway.

== Installation

Add this to your Gemfile
    gem 'errship', '1.0.0'

Add this to your ApplicationController
    class ApplicationController < ActionController::Base
      include Errship::Rescuers

Errship is ready to go! To test it out in development, you'll need to set

    config.consider_all_requests_local = false

in your config/environments/development.rb file. Just don't forget to change it back
when you want useful debugging output again instead!

Alternatively, simply point your browser to /error or /not_found to get a taste.

== Custom Rescuers

If you want errship to rescue errors from your own custom exception class, you need
to add a custom rescuer in your ApplicationController, like so:

    # Render the 404 page
    rescue_from MyException::SomethingMissing, :with => :render_404_error

    # Render the 500 page
    rescue_from MyException::SomethingWentWrong, :with => :render_error
{'fraction_non_alphanumeric': 0.046117148157964485, 'fraction_numerical': 0.008481314603763583, 'mean_word_length': 4.2635983263598325, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2424080', 'n_tokens_mistral': 1006, 'n_tokens_neox': 956, 'n_words': 544}