redis-rails-5.0.2/0000755000004100000410000000000013106206046013762 5ustar www-datawww-dataredis-rails-5.0.2/Rakefile0000644000004100000410000000014713106206046015431 0ustar www-datawww-datarequire "bundler/setup" require "rake" require "bundler/gem_tasks" require "redis-store/testing/tasks" redis-rails-5.0.2/CHANGELOG0000644000004100000410000000132613106206046015176 0ustar www-datawww-data# Changelog ## 5.0.1 Breaking changes - None Added - None Fixed - Use non-prerelease versions of dependencies ## 5.0.0 Breaking changes - None Added - Begin testing against ruby 2.1.2, 2.2, and 2.3 - Bump dependencies to support Rails 5 Fixed - Various documentation improvements ## 4.0.0 Not documented yet. Contributions welcome. ## 3.2.4 Not documented yet. Contributions welcome. ## 3.2.3 Not documented yet. Contributions welcome. ## 3.2.2 Not documented yet. Contributions welcome. ## 3.2.1 Not documented yet. Contributions welcome. ## 3.1.5 Not documented yet. Contributions welcome. ## 3.1.4 Not documented yet. Contributions welcome. ## 3.1.3 Not documented yet. Contributions welcome. redis-rails-5.0.2/Gemfile0000644000004100000410000000125413106206046015257 0ustar www-datawww-datasource "https://rubygems.org" gemspec # if ::File.directory?(gem_path = "../redis-store") # gem "redis-store", [">= 1.2.0", "< 1.4"], path: gem_path # end # if ::File.directory?(gem_path = "../redis-rack") # gem "redis-rack", "~> 2.0.0.pre", path: gem_path # end # if ::File.directory?(gem_path = "../redis-activesupport") # gem "redis-activesupport", '>= 4.0.0', '< 5.1', path: gem_path # end # if ::File.directory?(gem_path = "../redis-actionpack") # gem "redis-actionpack", ">= 4.0.0", '< 5.1', path: gem_path # end version = ENV["RAILS_VERSION"] || '5' rails = case version when "master" {:github => "rails/rails"} else "~> #{version}.0" end gem "rails", rails redis-rails-5.0.2/MIT-LICENSE0000644000004100000410000000204513106206046015417 0ustar www-datawww-dataCopyright (c) 2009 - 2011 Luca Guidi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. redis-rails-5.0.2/.travis.yml0000644000004100000410000000032013106206046016066 0ustar www-datawww-datalanguage: ruby before_install: gem install bundler script: 'bundle exec rake' rvm: - 2.2 - 2.3 - 2.4.0 - ruby-head - jruby-head matrix: allow_failures: - rvm: jruby-head - rvm: ruby-head redis-rails-5.0.2/lib/0000755000004100000410000000000013106206046014530 5ustar www-datawww-dataredis-rails-5.0.2/lib/redis-rails.rb0000644000004100000410000000026013106206046017271 0ustar www-datawww-datarequire "redis-store" require "redis-rails/version" require "redis-activesupport" require "redis-actionpack" class Redis module Rails # Your code goes here... end end redis-rails-5.0.2/lib/redis-rails/0000755000004100000410000000000013106206046016746 5ustar www-datawww-dataredis-rails-5.0.2/lib/redis-rails/version.rb0000644000004100000410000000007313106206046020760 0ustar www-datawww-dataclass Redis module Rails VERSION = '5.0.2' end end redis-rails-5.0.2/test/0000755000004100000410000000000013106206046014741 5ustar www-datawww-dataredis-rails-5.0.2/test/test_helper.rb0000644000004100000410000000013713106206046017605 0ustar www-datawww-datarequire "bundler/setup" require "minitest/autorun" require "mocha/setup" require "redis-rails" redis-rails-5.0.2/test/redis_rails_test.rb0000644000004100000410000000041513106206046020625 0ustar www-datawww-datarequire "test_helper" describe Redis::Rails do it "must require ActiveSupport dependency" do assert defined?(ActiveSupport::Cache::RedisStore) end it "must require ActionPack dependency" do assert defined?(ActionDispatch::Session::RedisStore) end end redis-rails-5.0.2/.gitignore0000644000004100000410000000003013106206046015743 0ustar www-datawww-dataGemfile.lock *.gem tmp/ redis-rails-5.0.2/redis-rails.gemspec0000644000004100000410000000227113106206046017547 0ustar www-datawww-data# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "redis-rails/version" Gem::Specification.new do |s| s.name = "redis-rails" s.version = Redis::Rails::VERSION s.authors = ["Luca Guidi", "Ryan Bigg"] s.email = ["me@lucaguidi.com", "me@ryanbigg.com"] s.homepage = "http://redis-store.org/redis-rails" s.summary = %q{Redis for Ruby on Rails} s.description = %q{Redis for Ruby on Rails} s.license = 'MIT' s.rubyforge_project = "redis-rails" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.add_dependency "redis-store", [">= 1.2", "< 2"] s.add_dependency "redis-activesupport", [">= 5.0", "< 6"] s.add_dependency "redis-actionpack", [">= 5.0", "< 6"] s.add_development_dependency "rake", "~> 10" s.add_development_dependency "bundler", "~> 1.3" s.add_development_dependency "mocha", "~> 0.14.0" s.add_development_dependency "minitest", [">= 4.2", "< 6"] s.add_development_dependency "redis-store-testing" end redis-rails-5.0.2/README.md0000644000004100000410000000627713106206046015255 0ustar www-datawww-data# Redis stores for Ruby on Rails __`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. ## Installation Add the following to your Gemfile: ```ruby gem 'redis-rails' ``` To use with Rails 4.0+, pin the gem to the latest 4.0 version: ```ruby gem 'redis-rails', '~> 4' ``` ## Usage ```ruby # config/application.rb config.cache_store = :redis_store, "redis://localhost:6379/0/cache", { expires_in: 90.minutes } ``` (**NOTE:** The `:expires_in` option can also be written as `:expire_in` and `:expire_after`) Configuration values at the end are optional. If you want to use Redis as a backend for sessions, you will also need to set: ```ruby # config/initializers/session_store.rb MyApplication::Application.config.session_store :redis_store, servers: ["redis://localhost:6379/0/session"] ``` You can also provide a hash instead of a URL ```ruby config.cache_store = :redis_store, { host: "localhost", port: 6379, db: 0, password: "mysecret", namespace: "cache" } ``` And similarly for the session store: ```ruby MyApplication::Application.config.session_store :redis_store, { servers: [ { host: "localhost", port: 6379, db: 0, password: "mysecret", namespace: "session" }, ], expire_after: 90.minutes } ``` And if you would like to use Redis as a rack-cache backend for HTTP caching, add [`redis-rack-cache`](https://github.com/redis-store/redis-rack-cache) to your Gemfile and add: ```ruby # config/environments/production.rb config.action_dispatch.rack_cache = { metastore: "redis://localhost:6379/1/metastore", entitystore: "redis://localhost:6379/1/entitystore" } ``` ## Usage with Redis Sentinel ```ruby 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 ```shell gem install bundler git clone git://github.com/redis-store/redis-rails.git cd redis-rails RAILS_VERSION=5.0.1 bundle install RAILS_VERSION=5.0.1 bundle exec rake ``` If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bundle exec rake` ## Status [![Gem Version](https://badge.fury.io/rb/redis-rails.png)](http://badge.fury.io/rb/redis-rails) [![Build Status](https://secure.travis-ci.org/redis-store/redis-rails.png?branch=master)](http://travis-ci.org/redis-store/redis-rails?branch=master) [![Code Climate](https://codeclimate.com/github/redis-store/redis-rails.png)](https://codeclimate.com/github/redis-store/redis-rails) ## Copyright 2009 - 2011 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license