lib/makura/database.rb in makura-2011.01.21 vs lib/makura/database.rb in makura-2012.01

- old
+ new

@@ -113,15 +113,41 @@ def info get('/') end + def compact(design_name = nil) + if design_name + post("/_compact/#{design_name}") + else + post("/_compact") + end + end + + def view_cleanup + post("/_view_cleanup") + end + + def ensure_full_commit + post('/_ensure_full_commit') + end + def all_docs(params = {}) - get('_all_docs') + get('_all_docs', params) end alias documents all_docs + def design_docs(params = {}) + pass = { + startkey: '_design0', + endkey: '_design', + descending: true, + }.merge(params) + + all_docs(pass) + end + def [](id, rev = nil) id = Makura.escape(id) if rev get(id, :rev => rev) else @@ -192,10 +218,10 @@ return doc end def request(method, path, params = {}) - @server.send(:request, method, "/#{name}/#{path}", params) + @server.request(method, "/#{name}/#{path}", params) end def encode_attachments(attachments) attachments.each do |key, value| next if value['stub']