couchdb-ruby-server

CouchDB query server to run ruby design docs.

Build Status Gem Version Dependency Status GitHub license Code Climate Test Coverage Inline docs

Installation

gem install couchdb-ruby-server as usual.

Edit your couchdb's local.ini and set this in the [query_servers] group:

ruby = couchdb-ruby-server

Restart CouchDB then.

Usage

Design functions (map, reduce, update, etc.) are well defined as lambda or proc blocks:

lambda { |doc| emit [1,2,3], doc }

It looks like any object responding to #call will survive.

Couchapp works well with rb files, so use it to manage design files. Just do echo ruby > language inside your app's root directory and you're in.

You may load your own code into the query server context by providing path to a library as an --require LIB option. This way you could deserialize documents right into the instances of the library classes instead of plain hashes.

Actually any tagname for the query server may be set in local.ini instead of ruby so it's possible to run several query servers e.g. per application. Just remember to copy that tagname into couchapp's language file.

Tests

bundle exec rake test. Gem is trying to follow original tests.

Documentation

This README is all i could say in a rush. No other documentation provided at this moment, see the sources.

If you've found a bug or drawback

Don't hesistate to leave a report.

License

MIT for now.