Skip to content
This repository was archived by the owner on Jan 22, 2022. It is now read-only.

redis-store/redis-activesupport

 
 

Repository files navigation

Redis stores for ActiveSupport

redis-activesupport provides a cache for ActiveSupport. See the main redis-store readme for general guidelines.

Installation

# Gemfile
gem 'redis-activesupport'

Usage

If you are using redis-store with Rails, consider using the redis-rails gem instead. For standalone usage:

ActiveSupport::Cache.lookup_store :redis_store # { ... optional configuration ... }

Usage with Redis Sentinel

sentinel_config = {
  url: "redis://mymaster/0",
  role: "master",
  sentinels: [{
    host: "127.0.0.1",
    port: 26379
  },{
    host: "127.0.0.1",
    port: 26380
  },{
    host: "127.0.0.1",
    port: 26381
  }]
}

# configure cache, merging opts with sentinel conf
config.cache_store = :redis_store, sentinel_config.merge(
  :namespace => "cache",
  :expires_in => 1.days
)

# configure sessions, setting the sentinel config as the
# servers value, merging opts with the sentinel conf.
config.session_store :redis_store, {
  :servers => sentinel_config.merge(
    :namespace => "sessions"
  ),
  :expires_in => 2.days
}

Running tests

gem install bundler
git clone git://github.com/redis-store/redis-activesupport.git
cd redis-activesupport
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

About

Redis stores for ActiveSupport

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 45

Languages