public
Description: Rack::Session, Rack::Cache and cache Redis stores for Ruby web frameworks
Homepage:
Clone URL: git://github.com/jodosha/redis-store.git
name age message
file .gitignore Wed Apr 15 12:49:10 -0700 2009 Added configuration for Redis cluster [jodosha]
file MIT-LICENSE Sat Apr 11 03:54:41 -0700 2009 Initial import [jodosha]
file README.textile Wed Jun 03 11:29:39 -0700 2009 Updated README instructions [jodosha]
file Rakefile Thu May 07 09:15:59 -0700 2009 Prepare for v0.3.5 [jodosha]
directory lib/ Thu May 28 04:15:42 -0700 2009 Removed RedisError catching [jodosha]
file redis-store.gemspec Thu May 07 09:15:59 -0700 2009 Prepare for v0.3.5 [jodosha]
directory spec/ Thu May 28 04:15:42 -0700 2009 Removed RedisError catching [jodosha]
README.textile

Rack::Session, Rack::Cache and cache Redis stores for Ruby web frameworks

Installation

Download and install Redis from http://code.google.com/p/redis/

wget http://redis.googlecode.com/files/redis-0.100.tar.gz tar -zxvf redis-0.100.tar.gz cd redis-0.100 make

Install the gems

sudo gem install ezmobius-redis-rb -s http://gems.github.com sudo gem install jodosha-redis-store -s http://gems.github.com
  1. redis-rb
    git clone git://github.com/jodosha/redis-rb.git
    cd redis-rb
    sudo rake install
  1. redis-store
    git clone git://github.com/jodosha/redis-store.git
    cd redis-rb
    sudo rake install

Cache store

Provides a cache store for your Ruby web framework of choice.

How to use with Rails

config.gem “jodosha-redis-store”, :source => “http://gems.github.com”, :lib => “redis-store” require “redis-store” config.cache_store = :redis_store

How to use with Merb

dependency “jodosha-redis-store”, “0.3.5” dependency(“merb-cache”, merb_gems_version) do Merb::Cache.setup do register(:redis, Merb::Cache::RedisStore, :servers => [“127.0.0.1:6379”]) end end

How to use with Sinatra

require ‘rubygems’ require ‘sinatra’ require ‘jodosha-redis-store’ class MyApp < Sinatra::Base register Sinatra::Cache get ‘/hi’ do cache.fetch(“greet”) { “Hello, World!” } end end

Rack::Session

Provides a Redis store for Rack::Session. See http://rack.rubyforge.org/doc/Rack/Session.html

How to use with a generic Rack application

require “rubygems” require “rack” require “jodosha-redis-store” require “application” use Rack::Session::Redis run Application.new

How to use with Rails

config.gem “jodosha-redis-store”, :source => “http://gems.github.com”, :lib => “redis-store” ActionController::Base.session_store = Rack::Session::Redis

How to use with Merb

dependency “jodosha-redis-store”, “0.3.5” Merb::Config.use do |c| c[:session_store] = ‘redis’ end Merb::BootLoader.before_app_loads do Merb::SessionContainer.subclasses << “Merb::RedisSession” end

How to use with Sinatra

Sorry, but Sinatra application boot system hardcode Rack::Session::Cookie

Rack::Cache

Provides a Redis store for HTTP caching. See http://github.com/rtomayko/rack-cache

require “rubygems” require “rack” require “rack/cache” require “jodosha-redis-store” require “application” use Rack::Cache, :metastore => ‘redis://localhost:6379/0’, :entitystore => ‘redis://localhost:6380/1’ run Application.new

Copyright

© 2009 Luca Guidi – http://lucaguidi.com, released under the MIT license