Fresh from the stills: moonshine_couchdb

Written By : Josh Nichols

Thanks to our friends at PeepCode, I’m happy to announce moonshine_couchdb, the moonshine way of managing couchdb.

Combine it with PeepCode’s excellent CouchDB with Rails screencast, you will be relaxing with couch in no time.

Usage

moonshine_couchdb is pretty straightforward as far as things go. Install it as a Rails plugin:

# Rails 2.x.x
script/plugin install git://github.com/railsmachine/moonshine_couchdb.git
# Rails 3.x.x
script/rails plugin install git://github.com/railsmachine/moonshine_couchdb.git

Update your application_manifest.rb to use the couchdb recipe:

# app/manifests/application_manifest.rb
class ApplicationManifest < Moonshine::Manifest:Rails
  # other configuration ommitted for brevity
  recipe :couchdb
end

Commit and push it:

git add vendor/plugins/moonshine_couchdb
git add app/manifests/application_manifest.rb
git commit -m "Add moonshine_couchdb"
git push origin master

Now deploy. Make sure to use staging if you have it!

cap staging deploy

Other things of note

Usage aside, there’s some interesting things that went on the development side. First, this plugin was generated using the recent additions to the moonshine_plugin generator. Specifically:

  • plugin code is namespaced under Moonshine
  • more thorough README
    • uses markdown
    • including default links to homepage, source, issues, wiki, mailing list, etc
    • better usage notes and explanation of options

In addition, it’s been documented using rocco for some so called literate programming documentation. wfarr and I started experimenting with this for moonshine_pdfkit, and this is more of the same. I like to think that moonshine is excutable documentation for how your infrastructure is managed, with rocco being a perfect addition to make it easy to generate pretty, human readable documentation from it. See it in action.