README.md in redis-rails-3.2.3 vs README.md in redis-rails-3.2.4

- old
+ new

@@ -1,64 +1,55 @@ # Redis stores for Ruby on Rails -__`redis-rails`__ provides a full set of stores (*Cache*, *Session*, *HTTP Cache*) for __Ruby on Rails__. It natively supports object marshalling, timeouts, single or multiple nodes and namespaces. +__`redis-rails`__ provides a full set of stores (*Cache*, *Session*, *HTTP Cache*) for __Ruby on Rails__. See the main [redis-store readme](https://github.com/redis-store/redis-store) for general guidelines. -## Redis Installation +## Installation -### Option 1: Homebrew +```ruby +# Gemfile +gem 'redis-rails' # Will install several other redis-* gems +``` -MacOS X users should use [Homebrew](https://github.com/mxcl/homebrew) to install Redis: - - brew install redis - -### Option 2: From Source - -Download and install Redis from [http://redis.io](http://redis.io/) - - wget http://redis.googlecode.com/files/redis-2.4.5.tar.gz - tar -zxf redis-2.4.5.tar.gz - mv redis-2.4.5 redis - cd redis - make - ## Usage - # Gemfile - gem 'redis-rails' +```ruby +# config/application.rb +config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes } +``` -### Cache Store: +Configuration values at the end are optional. If you want to use Redis as a backend for sessions, you will also need to set: - # config/environments/production.rb - config.cache_store = :redis_store # { ... optional configuration ... } +```ruby +# config/initializers/session_store.rb +MyApplication::Application.config.session_store :redis_store +``` -### Session Store: +And if you would like to use Redis as a rack-cache backend for HTTP caching: - # config/initializers/session_store.rb - MyApplication::Application.config.session_store :redis_store +```ruby +# config/environments/production.rb +config.action_dispatch.rack_cache = { + metastore: 'redis://localhost:6379/1/metastore', + entitystore: 'redis://localhost:6379/1/entitystore' +} +``` -### HTTP Cache - - # config.ru - require 'rack' - require 'rack/cache' - require 'redis-rack-cache' - - use Rack::Cache, - :metastore => 'redis://localhost:6379/0/metastore', - :entitystore => 'redis://localhost:6380/0/entitystore' - -#### Configuration - -For advanced configuration options, please check the [Redis Store Wiki](https://github.com/jodosha/redis-store/wiki). - ## Running tests - git clone git://github.com/jodosha/redis-store.git - cd redis-store/redis-rails - gem install bundler --pre # required version: 1.1.rc - bundle exec rake +```shell +gem install bundler +git clone git://github.com/redis-store/redis-rails.git +cd redis-rails +git checkout -t origin/3.2.x +bundle install +bundle exec rake +``` If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bundle exec rake` +## Status + +[![Build Status](https://secure.travis-ci.org/redis-store/redis-rails.png?branch=3.2.x)](http://travis-ci.org/jodosha/redis-rails?branch=3.2.x) + ## Copyright -(c) 2009 - 2011 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license +2009 - 2013 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license