All Projects → redis-store → redis-sinatra

redis-store / redis-sinatra

Licence: MIT license
Redis stores for Sinatra

Programming Languages

ruby
36898 projects - #4 most used programming language

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/redis-store/redis-sinatra.git
cd 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

Status

Gem Version Build Status Code Climate

Copyright

2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].