Project

resolver

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Resolver is a flexible Redis-backed high performance index and cache solution for ActiveModel-like objects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

> 2.0.0
 Project Readme

Resolver

Resolver is a flexible Redis-backed high performance index and cache solution for ActiveModel-like objects.

Setup

Assuming you already have Redis installed:

$ gem install resolver

Or add the gem to your Gemfile.

require 'resolver'
Resolver.redis = 'redis://.../'

If you are using Rails, add the above to an initializer. If Redis is running on localhost and on the default port the second line is not needed.

Example usage

class Post < ActiveRecord::Base
  include Resolver::Key

  key :category
  key :slug, :unique => true, :global => true

end

Post.create(:category => 'News', :slug => 'example-post')

Post.find_by(:slug, 'example-post')
Post.exists_with?(:slug, 'example-post') # => true
Post.count_with(:category, 'News') # => 1

The :global => true option means that the key globally namespaced and is shared by all models. If global is set to false the key is instead namespaced based on the name of the model class.

Development

If you want to make your own changes to Resolver, first clone the repo and run the tests:

git clone git://github.com/sutajio/resolver.git
cd resolver
rake test

Remember to install the Redis server on your local machine.

Contributing

Once you've made your great commits:

  1. Fork Resolver
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Create a Pull Request from your branch
  5. That's it!

Author

Resolver was created by Niklas Holmgren (niklas@sutajio.se) and released under the MIT license.