With directory watcher successfully watching for changes, I am ready to publish couch_docs version 1.1!
The couch_docs gem provides a mechanism for dumping CouchDB documents and design documents to the file system and pushing them from the file system to the CouchDB server. Regular documents are stored on the file system as
.jsondocuments. Design documents are mapped onto the file system as directories (keys) and
.jsfiles (values)—for example:
New in 1.1 is the ability to use
!codemacros (just like in couchapp) in the design documents stored on the file system. This is a nice way of keeping design documents DRY.
There are more options supported by the
couch-docsscript that comes with the couch_docs gem:
cstrom@whitefall:~/repos/couch_docs$ couch-docs --helpThe other big new features in 1.1 was a last minute addition—the previously mentioned directory watcher. This will let me test out changes quickly without needing to copy & paste changes in Futon temporary design documents.
Usage: couch-docs push|dump [OPTIONS] couchdb_url [target_dir]
If a target_dir is not specified, the current working directory will be used.
-R, --destructive Drop the couchdb_uri (if it exists) and create a new database
-w, --watch Watch the directory for changes, uploading when detected
-d, --design Only dump design documents
-D, --data Only dump data documents
-v, --version Show version
-h, --help Show this message
I document the complete list of changes that I have made in
== 1.1.0 / 2010-03-13I also update the RDoc for the project.
* Better command line experience.
* Default to current directory.
* Print help without args / better format (optparse).
* Support the !code macro from couchapp.
* Support a flag (-d) to only work on design docs.
* Can create the DB if it doesn't already exist
* Command line can be used to watch for local changes to be pushed immediately to the CouchDB server.
With that, it is time to push to gemcutter / rubygems. First I need gemcutter on this machine:
cstrom@whitefall:~/repos/couch_docs$ gem install gemcutterThen I build the gem:
WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and
/var/lib/gems/1.8/bin aren't both writable.
Thanks for installing Gemcutter! You can now run:
gem push merged into RubyGems 1.3.6
gem owner merged into RubyGems 1.3.6
gem webhook register urls to be pinged when gems are pushed
gem yank remove a specific version of a gem from RubyGems.org
Successfully installed gemcutter-0.5.0
1 gem installed
cstrom@whitefall:~/repos/couch_docs$ gem build couch_docs.gemspecAnd, finally, push the gem to gemcutter (now rubygems):
Successfully built RubyGem
cstrom@whitefall:~/repos/couch_docs$ gem push couch_docs-1.1.0.gemJust like that I have an updated gem: http://rubygems.org/gems/couch_docs.
Enter your Gemcutter credentials. Don't have an account yet? Create one at http://gemcutter.org/sign_up
Signed in. Your api key has been stored in ~/.gem/credentials
Pushing gem to Gemcutter...
Successfully registered gem: couch_docs (1.1.0)
That was easy.