thoughtfusion/suitcase — pull request #5 by hovatterz (2012-04-20 15:12:21+00:00)
Title: Caching + Redis Adapter

These changes add an example Redis adapter and a few changes to the Cache class. This is a cleaner version of the stuff I sent via email the other day (which was a bit hasty and sloppy).

The Redis adapter stores the params/response as JSON encoded field/value in a Redis hash with a key of "ean_cache:#{action}". I wrote this up using the 'redis' gem, but I'm sure it could be modified to use any of the others.

The changes of the cache class are pretty minor. It converts all symbol keys to strings before passing them to the adapter. I did this because I was having problems with string vs symbol comparisons in parameters. Tests still pass, and there's no new functionality so I haven't written any new tests for this.

If there's anything I can improve please let me know!