Skip to content

Commit 02ed779

Browse files
committed
Moved back from jodosha/redis-store
1 parent 06b2969 commit 02ed779

File tree

24 files changed

+430
-2
lines changed

24 files changed

+430
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Gemfile.lock
2+
*.gem
3+
tmp/

Gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
source 'https://rubygems.org'
2+
gemspec
3+
4+
gem 'redis-store', '~> 1.1.0', path: '../redis-store'
5+
gem 'redis-rack', '~> 1.5.0', path: '../redis-rack'
6+
7+
version = ENV["RAILS_VERSION"] || "4"
8+
9+
rails = case version
10+
when "master"
11+
{:github => "rails/rails"}
12+
else
13+
"~> #{version}.0"
14+
end
15+
16+
gem "rails", rails

MIT-LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2009 - 2011 Luca Guidi
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1-
# redis-actionpack
2-
## Moved to [https://github.com/jodosha/redis-store/tree/master/redis-actionpack](https://github.com/jodosha/redis-store/tree/master/redis-actionpack)
1+
# Redis stores for ActionPack
2+
3+
__`redis-actionpack`__ provides a session store for __ActionPack__, specifically for __ActionDispatch__. See the main [redis-store readme](https://github.com/jodosha/redis-store) for general guidelines.
4+
5+
## Installation
6+
7+
```ruby
8+
# Gemfile
9+
gem 'redis-actionpack'
10+
```
11+
12+
### Usage
13+
14+
If you are using redis-store with Rails, consider using the [redis-rails gem](https://github.com/jodosha/redis-store/tree/master/redis-rails) instead. For standalone usage:
15+
16+
```ruby
17+
ActionController::Base.cache_store = ActionDispatch::Session::RedisSessionStore.new
18+
```
19+
20+
## Running tests
21+
22+
```shell
23+
gem install bundler
24+
git clone git://github.com/jodosha/redis-actionpack.git
25+
cd redis-actionpack
26+
bundle install
27+
bundle exec rake
28+
```
29+
30+
If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bundle exec rake`
31+
32+
## Copyright
33+
34+
(c) 2009 - 2013 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license

Rakefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'bundler/setup'
2+
require 'rake'
3+
require 'bundler/gem_tasks'
4+
require 'redis-store/testing/tasks'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'redis-store'
2+
require 'redis-rack'
3+
require 'action_dispatch/middleware/session/abstract_store'
4+
5+
module ActionDispatch
6+
module Session
7+
class RedisStore < Rack::Session::Redis
8+
include Compatibility
9+
include StaleSessionCheck
10+
def initialize(app, options = {})
11+
options = options.dup
12+
options[:redis_server] ||= options[:servers]
13+
super
14+
end
15+
end
16+
end
17+
end

lib/redis-actionpack.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'redis-store'
2+
require 'action_pack'
3+
require 'redis/actionpack/version'
4+
require 'action_dispatch/middleware/session/redis_store'

lib/redis/actionpack/version.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Redis
2+
module ActionPack
3+
VERSION = '4.0.0'
4+
end
5+
end

redis-actionpack.gemspec

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- encoding: utf-8 -*-
2+
$:.push File.expand_path('../lib', __FILE__)
3+
require 'redis/actionpack/version'
4+
5+
Gem::Specification.new do |s|
6+
s.name = 'redis-actionpack'
7+
s.version = Redis::ActionPack::VERSION
8+
s.authors = ['Luca Guidi']
9+
s.email = ['[email protected]']
10+
s.homepage = 'http://redis-store.org/redis-actionpack'
11+
s.summary = %q{Redis session store for ActionPack}
12+
s.description = %q{Redis session store for ActionPack}
13+
s.license = 'MIT'
14+
15+
s.rubyforge_project = 'redis-actionpack'
16+
17+
s.files = `git ls-files`.split("\n")
18+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20+
s.require_paths = ['lib']
21+
22+
s.add_runtime_dependency 'redis-store', '~> 1.1.0'
23+
s.add_runtime_dependency 'redis-rack', '~> 1.5.0'
24+
s.add_runtime_dependency 'actionpack', '~> 4'
25+
26+
s.add_development_dependency 'rake', '~> 10'
27+
s.add_development_dependency 'bundler', '~> 1.3'
28+
s.add_development_dependency 'mocha', '~> 0.14.0'
29+
s.add_development_dependency 'minitest', '~> 4.2'
30+
s.add_development_dependency 'tzinfo'
31+
s.add_development_dependency 'mini_specunit'
32+
s.add_development_dependency 'mini_backtrace'
33+
s.add_development_dependency 'redis-store-testing'
34+
end

test/dummy/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
log/*

0 commit comments

Comments
 (0)