Project

castache

0.0
No commit activity in last 3 years
No release in over 3 years
Simple structured object cache for ruby apps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.4
~> 4.2
~> 0.13
~> 0.9
~> 10
~> 0.9

Runtime

~> 3.0
 Project Readme

Castache

Simple structured cache for ruby apps. Marshals objects to and from Redis quickly and painlessly.

Installation

Add this line to your application's Gemfile:

gem 'castache'

And then execute:

$ bundle

Or install it yourself as:

$ gem install castache

Usage

require 'castache'
Castache.redis = Redis.new # you can also pass it a redis:// URI string
                            # or hash of options to pass to Redis.new
object = Castache.fetch 'cache:key:1' do 
  {greeting: 'hello'} # some expensive operation goes here...
end
p object

Castache.set 'cache:key:2', {greeting: 'goodbye'}
object2 = Castache.get 'cache:key:2'
p object2

objects = Castache.mget ['cache:key:1','cache:key:2']
objects.each {|o| puts o[:greeting] }

Project Status

  • Build: Build Status
  • Code Quality: Code Climate
  • Dependencies: Dependency Status

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request