Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rack middleware replacing status codes with relevant pictures of cats.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 cats
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
Octocat-spinner-32 status_cats.gemspec
README.md

Status Cats

Rack middleware replacing responses with relevant pictures of cats, based on the status code.

The pictures are made/collected by girliemac on Flickr

There is also an apache module.

Usage

Install:

gem install status_cats

Place inside your rackup file:

require 'status_cats'
use StatusCats

This will also replace valid responses, even 200, basically making your application useless.

You can manage which status codes should be replaced with cats, by using the :only and :except options, which take arrays or ranges.

use StatusCats, :only => [ 403, 404, 500 ]

# or ...

use StatusCats, :except => 200...300

Development

Install dependencies:

bundle install

Run tests:

rake

You can run the demo application:

bundle exec rackup

The application will trigger the response code depending on the path you visit, so visiting http://localhost:9292/418 will respond with a teapot.

Known issues

Status code 100 (Continue) cannot have a response body. Triggering it will cause Rack to throw up.

License

The Ruby code in this project is released under the MIT License.

The pictures of cats are by Flickr user girliemac, released under this Creative Commons License.

Something went wrong with that request. Please try again.