Pull request Compare This branch is 1 commit ahead, 109 commits behind redis-store:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
MIT-LICENSE
README.md
Rakefile
redis-sinatra.gemspec

README.md

Redis stores for Sinatra

redis-sinatra provides a Redis backed cache store for Sinatra. See the main redis-store readme for general guidelines.

Installation

# Gemfile
gem 'redis-sinatra'

Usage

require 'sinatra'
require 'redis-sinatra'

class MyApp < Sinatra::Base
  register Sinatra::Cache
  get "/hi" do
    settings.cache.fetch("greet") { "Hello, World!" }
  end
end

Keep in mind that the above fetch will return "OK" on success, not the return of the block.

Running tests

gem install bundler
git clone git://github.com/jodosha/redis-store.git
cd redis-store/redis-sinatra
bundle install
bundle exec rake

If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle exec rake

Copyright

(c) 2009 - 2011 Luca Guidi - http://lucaguidi.com, released under the MIT license