A CouchDB adapter for the IronHide authorization library.
Add this line to your application's Gemfile:
gem 'iron_hide-storage-couchdb_adapter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install iron_hide-storage-couchdb_adapter
Assuming that you don't have a CouchDB server, this project comes with a few helper Rake tasks.
The best resource for getting started with CouchDB is http://guide.couchdb.org/
Using brew:
brew install couchdb
couchdb # Starts the server
To install the helper Rake tasks:
# Rakefile
require 'rake'
require 'iron_hide/couchdb_tasks'
To create a new database, either use the HTTP API, Futon, or this simple Rake task:
bundle exec rake iron_hide:create_db\['http://127.0.0.1:5984/rules'\]
To upload some rules to this database:
bundle exec rake iron_hide:load_rules\['/absolute/path/file.json','http://127.0.0.1:5984/rules'\]
Note: Required step Setup the required views
bundle exec iron_hide:rake create_views\['http://127.0.0.1:5984/rules'\]
require 'iron_hide'
require 'iron_hide/storage/couchdb_adapter'
IronHide.config do |c|
c.adapter = :couchdb
c.namespace = 'TestApp'
c.couchdb_server = 'http://127.0.0.1:5984' # Default
c.couchdb_database = 'rules' # Default
end
- Fork it ( http://github.com//iron_hide-storage-couchdb_adapter/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Caching
- Tests