This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Undelete a document from a CouchDB database. | |
# | |
# Recovers a previously deleted document by looking at the _changes | |
# feed, putting a new empty document preserving the revisions chain, | |
# retrieves the revs_info for the document, asks the user which one | |
# to recover, and puts back the old revision into place. | |
# | |
# For this to work, GETting the document must return error: "not_found", |