require 'rid/actions/base' require 'rid/design_document' require "rest_client" module Rid module Actions class Pull < Base add_runtime_options! def pull doc = DesignDocument.new say "Pulling %s" % doc.url resp = RestClient.get doc.url(:attachments => true) doc.json = resp.body doc.write do |filename, content| create_file filename, content end say "Checked out %s" % doc.rev rescue RestClient::ResourceNotFound say "Error: Document %s does not exist!" % doc.id end end end end