Naughty Step

Added by mig-hub at October 03, 2011 08:11 Star_smallStar_smallStar_smallStar_smallStar_small_gray
GitHub stats:
Magnifier watcher(s)
Arrow_branch fork(s)
Wrench

About

A Rack middleware for simple 404 and 500 status handling

Usage

= Naughty Step

Well, Naughty Step is nothing ground-breaking. This is just a basic way of catching errors (Status 500) and pages not found (Status 404) and use related html pages you’ve written for that purpose. The middleware even has default values:

- public/404.html
- public/500.html

So a very simple example might be to require the Gem and then:

use ::Rack::NaughtyStep

Or if you want to declare your paths:

use ::Rack::NaughtyStep ‘/path/to/404/page.html’, ‘/path/to/500/page.html’

Here you go. Truth is that I’ve been naughty as well. I did not write a proper full example, neither a spec. Just because I was in a rush, but I’ll do it as soon as I can. Please don’t spank me.

blog comments powered by Disqus