|
|
activecouch
Time.to.Relax.in.Ruby
ActiveCouch wants to be a simple, convenient, Ruby-idiomatic wrapper for the hot new kid on the block - CouchDB. CouchDB (simplistically speaking) is a document store, which essentially means that objects can be stored in a schema-less environment. Couch officially stands for Cluster Of Unreliable Commodity Hardware. The CouchDB wiki is here. The CouchDB source can be obtained from here.
News
- Version 0.1.1 released! Features include: (03/Feb/2008)
- Passing of blocks to constructors (E.g. Person.new {|p| p.name = "McLovin"}
- Fixed bug with ActiveCouch::Base not playing nice with Memcache (Added custom marshaling methods)
- Added find(id) method. Person.find('123') will not use the permanent view and instead directly get the document.
- Added ActiveCouch::Base#count method. To count the number of objects based on a certain condition. (E.g. Person.count(:params => {:last_name => 'McLovin'}) )
- Breaking News: The gem is now available on Rubyforge, simply run the command gem install activecouch from your favourite terminal and you'll be on your way! (24/Jan/2008)
- Version 0.1.0 released! Download the gem and then issue this command gem install activecouch-0.1.0.gem (23/Jan/2008)
- Callback support is fully complete - supports method names, blocks and external objects as possible parameters (the same as ActiveRecord) Refer specs for examples (23/Jan/2008)
- Support for callback before/after save/delete have been added. Code borrowed from ActiveRecord with some modifications. Passes all specs. Need to support specs for executing blocks and procs. (22/Jan/2008)
- Thorough specs for ActiveCouch::Base#find. Support for CouchDB reserved attributes such as _id and _rev. Basic commit of ActiveCouch::Base#delete method added. (22/Jan/2008)
- As promised, ActiveCouch::Base#find and ActiveCouch::Base#save methods have been implemented. More thorough specs are required (16/Jan/2008).
- Holidays, general laziness and work commitments have somewhat impeded progress, but good news, find and save methods are almost there. Expect a check-in soon enough! (16/Jan/2008)
- Proposal for ActiveCouch Migrations added. (13/Dec/2007)
- Wiki page updated to reflect the author's understanding of Couch Views. (13/Dec/2007)
What is it?
With ActiveCouch, you can easily save, query, delete documents to/from a CouchDB database in your favourite language - Ruby. ActiveCouch derives a lot of its principles (and some code) from both ActiveRecord and ActiveResource, two libraries made popular by the other hot pubescent on the block - Ruby on Rails.
Why?
As they say, necessity is the mother of invention. And as they also say, death before inconvenience. Our company, Bezurk (http://www.bezurk.com) is experimenting with CouchDB as we have a need for a document-model to store vast amounts of information, and we needed a convenience mapper in our favourite language, in order to use CouchDB elegantly. Since, the Rubyists here at Bezurk are already very familiar with ActiveRecord semantics, care has been taken to ensure that ActiveCouch resembled it in many ways.
Requirements
- Ruby v1.8.5 or above
- rubygems v0.9.4 or above
- JSON gem v1.1.2 (Used for JSON encoding/decoding)
- RSpec gem v1.0.8 or above (Used to run specs)
- CouchDB v0.7.2 (Some specs require running CouchDB at localhost:5984)
We would also recommend installing ZenTest which provides a very convenient way to run specs.
Show me the docs
We have some pretty basic RDoc bundled along with the source code. But the best source of documentation and sample code at this point will be the specs. The layout for specs has been inspired from the very inspiring and uber-cool Rubinius project where each class has its own directory, and each method has its own spec file, thus making it very readable.
Show me the code
ActiveCouch is now on Github: http://github.com/arunthampi/activecouch/tree/master
Bugs and Feature Requests
If and when you find bugs/feature requests, please raise a ticket here. If we find that feature requests are crucial for our internal use, we will definitely integrate it into ActiveCouch as soon as possible. But otherwise, we unfortunately cannot guarantee any deadlines on integration of feature requests.
This is DHH's point of view on this situation.
So, if you find bugs/feature requests, we'd greatly appreciate patches (which include specs), but otherwise please bear with us. We will have a guideline on how to contribute code (including coding conventions), soon.
Looking Forward
Obviously, we are very excited about developments in CouchDB land and we will be closely monitoring the CouchDB project, in order to further improve ActiveCouch. Since we are using ActiveCouch internally, we are expecting heavy development in ActiveCouch in the months to come.
"The Journey is the Reward"
