TinyRackFlash
A very small flash implementation for Rack apps
Works well with Cuba, Sinatra, and others--
Installation
Add this line to your application's Gemfile:
gem 'tiny-rack-flash'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tiny-rack-flash
Usage
Inside your main Rack class (e.g., Sinatra::Base or Cuba), simply add a
require 'tiny_rack_flash'
include TinyRackFlash
The include will hook up some Rack middleware for rotating the flash and provide a flash method for use in your route handlers.
See tests.rb for examples.
Notes
This gem's FlashHash implementation is taken from Stephen Eley's FlashHash implementation at https://github.com/SFEley/sinatra-flash.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request