Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

peterc/simredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimRedis (Pure Ruby Redis simulator for redis-rb)

STATUS:

SimRedis is NOT READY FOR ANY SORT OF SERIOUS USE YET! Currently all of the generic and string methods are working OK, except for anything involving expiration or blocking.

DESCRIPTION:

SimRedis is a Redis simulator for the popular redis-rb library. SimRedis lets you use the Redis Ruby client library without a Redis daemon running. Everything is stored in memory only and is very thread unsafe, but persistence and locking comes in time.

Why simulate Redis? I love Redis and some of the ideas it brings to the table, and while I can roll out onto servers stocked with working Redis installs OK, sometimes I might want to still use Redis in my app but not require its full power (or I might want to deploy somewhere that doesn’t have Redis - like Dreamhost, say). I’d also like to distribute apps I make so that other people can use them without being forced to install a whole new daemon first.

EXAMPLES:

require 'redis'
require 'simredis'

r = Redis.new
r.set("a", "hello world")
r.get("a")  # => "hello world"
r.keys("*") # => ['a']
r.flushdb
r.keys("*") # => []

SimRedis comes with tests (of a sort) “baked in.” Running the simredis.rb file directly runs the suite.

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 as it’s handled by Jeweler (which is awesome, btw).

  • Send me a pull request. I may or may not accept it (sorry, practicality rules.. but message me and we can talk!)

COPYRIGHT AND LICENSE

Copyright © 2010 Peter Cooper

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.

About

Redis simulator that allows you to use redis-rb without a Redis daemon running

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages