Whenever I experiment CouchDB, especially design documents, always I feel unhandy to upload the document.
For simple experiments, Futon (CouchDB web interface) is the easiest solution. However, if you want to keep the changes systemically, or if you want to use any version control system, you're on your own.
Worse, if your function is not valid, you'll realize after the design document is uploaded.
Precisely, I want a tool that:
- can add/update the design document from the sources that I provided,
- can upload attachment files.
First, I tried to use CouchApp, but lack of the detailed guide makes me gave up. Sorry CouchApp folks. :(
Second, I wrote simple bash shell scripts to interact with CouchDB
curl(1), to upload the document after escaping the function to
build JSON document. It was not simple to implement all the features
that I need, so I stopped.
Third, I try to write the tool in Ruby, and try to use httpclient, but I couldn't make httpclient works for HTTP client features like multipart/form-data. (Mayhaps I didn't know how to use httpclient fluently.) So I stopped again.
Fourth, I realized that I spent too much time to write this
script. I don't want to dig the source of the httpclient, so I just
write small Ruby wrapper of
curl(1), and made the tool, finally.
If you have interest, visit couch-register-design and experiment.