Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zapnap/redis_store_jr
Simple Redis Cache Store for Rails
https://github.com/zapnap/redis_store_jr
Last synced: about 2 months ago
JSON representation
Simple Redis Cache Store for Rails
- Host: GitHub
- URL: https://github.com/zapnap/redis_store_jr
- Owner: zapnap
- License: mit
- Created: 2010-08-04T23:45:11.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-08-05T22:31:38.000Z (over 14 years ago)
- Last Synced: 2024-03-15T12:52:25.149Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 101 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= Redis Store Jr.
This is a vastly simplified version of RedisStore.
Much of this code was shamelessly lifted from an earlier version of Luca
Guidi's redis-store gem. It does *not* support Sinatra, Merb, distributed
storage, or many of the other options that his Gem does. So if you're
lookig for that stuff, you probably want to take a look at the original
project:http://github.com/jodosha/redis-store
On the other hand, if you're looking for a super-simple Redis store interface
that works reliably with Rails and Redis 1.2, without the complicated
(and often unnecessary) dependencies, look no further.Note that this gem is specifically designed to work with Redis 1.2 and v1.0.7
of the Redis gem.== Installation
We assume you already have Redis (http://code.google.com/p/redis/) set up and
running. If not, you know what to do.In your environment.rb:
config.gem 'redis_store_jr', :lib => 'redis_store'
Or your Gemfile:
gem 'redis_store_jr', :require => 'redis_store'
To use the Rails.cache store, add the following to an initializer or your
environment-specific config:require 'redis_store'
config.cache_store = :redis_store, 'localhost:6379/10'Want to store user session data in Redis too? Of course you do.
ActionController::Base.session = {
:host => 'dbhost'
:port => 6379,
:db => 2,
:expire_after => 24.hours,
:key_prefix => "myapp:session:"
}
ActionController::Base.session_store = :redis_session_storeThis has only been tested on Rails 2.3.x. No guarantees about Rails 3.
== Note on Patches/Pull Requests
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.== Copyright
Copyright (c) 2010 Nick Plante. See LICENSE for details.