github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jodosha / redis-store

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 103
    • 6
  • Source
  • Commits
  • Network (6)
  • Issues (4)
  • Downloads (9)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (4)
    • gh-pages
    • master ✓
    • ruby-redis-client
    • socket-pooling
  • Tags (9)
    • v0.3.7
    • v0.3.6
    • v0.3.5
    • v0.3.0
    • v0.2.0
    • v0.1.0
    • v0.0.3
    • v0.0.2
    • v0.0.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

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

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Updated development and testing dependencies 
jodosha (author)
Sat Jan 16 04:11:52 -0800 2010
commit  5b3b6a09c3d67b6a732c6e5dcba4b667c6eb844d
tree    2149431ae951039f973fa6a59ba15668a663927a
parent  e47bfbb579b5703033337152bbac51f8f3f1b13b
redis-store /
name age
history
message
file .gitignore Sun Nov 15 04:21:22 -0800 2009 Removed no longer used Rake tasks. Added Gemcut... [jodosha]
file Gemfile Sat Jan 16 04:11:52 -0800 2010 Updated development and testing dependencies [jodosha]
file MIT-LICENSE Sat Apr 11 03:54:41 -0700 2009 Initial import [jodosha]
file README.md Sun Nov 15 07:01:59 -0800 2009 Version bump to 0.3.7 [jodosha]
file Rakefile Sun Nov 15 05:36:23 -0800 2009 Jeweler generated redis-store.gemspec [jodosha]
file VERSION Sun Nov 15 07:01:59 -0800 2009 Version bump to 0.3.7 [jodosha]
directory lib/ Mon Nov 16 13:42:13 -0800 2009 Made compatible with rack-cache-0.5.2 [jodosha]
file redis-store.gemspec Sun Nov 15 07:03:46 -0800 2009 Version bump to 0.3.7 [jodosha]
directory spec/ Sat Jan 16 04:11:52 -0800 2010 Updated development and testing dependencies [jodosha]
directory tasks/ Sat Jan 16 04:11:52 -0800 2010 Updated development and testing dependencies [jodosha]
README.md

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

Installation

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

curl -OL http://redis.googlecode.com/files/redis-1.02.tar.gz
tar -zxvf redis-1.02.tar.gz
mv redis-1.02 redis
cd redis
make

Install the gems

sudo gem install redis-rb redis-store

Cache store

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

Rails

config.gem "redis-store", :source => "http://gemcutter.org", :lib => "redis-store"
require "redis-store"
config.cache_store = :redis_store

Merb

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

Sinatra

require "sinatra"
require "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

Rack application

require "rack"
require "redis-store"
require "application"
use Rack::Session::Redis
run Application.new

Rails

config.gem "redis-store", :source => "http://gemcutter.org", :lib => "redis-store"
ActionController::Base.session_store = Rack::Session::Redis

Merb

dependency "redis-store", "0.3.7"
Merb::Config.use do |c|
  c[:session_store] = "redis"
end
Merb::BootLoader.before_app_loads do
  Merb::SessionContainer.subclasses << "Merb::RedisSession"
end

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 "rack"
require "rack/cache"
require "redis-store"
require "application"
use Rack::Cache,
  :metastore   => 'redis://localhost:6379/0',
  :entitystore => 'redis://localhost:6380/1'
run Application.new

Running specs

gem install jeweler bundler
git clone git://github.com/jodosha/redis-store.git
cd redis-store
gem bundle
rake dtach:install
rake redis:install
rake

If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" gem bundle

Copyright

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

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server