summaryrefslogtreecommitdiff
path: root/lib/tapicero/couch_database_creator.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-09-12 09:57:45 +0200
committerAzul <azul@riseup.net>2013-09-12 09:57:45 +0200
commit37f87300c9804bdad66d730b676715e242b9ca42 (patch)
tree7fa746846c2a127812d28d58cc5f0abd04cf180d /lib/tapicero/couch_database_creator.rb
parent929fcdea37f92f6b175482c6e0d1b8ff3229854f (diff)
use CouchRest::Database#changes, store and retrieve seq
This commit bundles a few different changes: * we now use the CouchRest::Database#changes stream instead of our own * we store and read the last sequence number so on a restart we can start where we left * we now have a UserDatabase class rather than the CouchDatabaseCreator. It also knows about it's name and we create an instance of it per database we want to create. It's also more flexible when the databases already exist.
Diffstat (limited to 'lib/tapicero/couch_database_creator.rb')
-rw-r--r--lib/tapicero/couch_database_creator.rb19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/tapicero/couch_database_creator.rb b/lib/tapicero/couch_database_creator.rb
deleted file mode 100644
index 4d39c1b..0000000
--- a/lib/tapicero/couch_database_creator.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'couchrest'
-require 'json'
-
-module Tapicero
- class CouchDatabaseCreator
-
- def initialize(host)
- @host = host
- @couch = CouchRest.new(host)
- end
-
- def create(name, security = {})
- db = @couch.create_db(name)
- puts security.to_json
- puts "-> #{@host}/#{name}/_security"
- CouchRest.put "#{@host}/#{name}/_security", security
- end
- end
-end