summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tapicero/user_database.rb5
-rw-r--r--lib/tapicero_daemon.rb4
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/tapicero/user_database.rb b/lib/tapicero/user_database.rb
index 84ed300..ec2694a 100644
--- a/lib/tapicero/user_database.rb
+++ b/lib/tapicero/user_database.rb
@@ -24,6 +24,11 @@ module Tapicero
CouchRest.put security_url, security
end
+ def destroy
+ db = CouchRest.new(host).database(name)
+ db.delete! if db
+ end
+
protected
def secured?
diff --git a/lib/tapicero_daemon.rb b/lib/tapicero_daemon.rb
index bb1a818..3a26296 100644
--- a/lib/tapicero_daemon.rb
+++ b/lib/tapicero_daemon.rb
@@ -22,7 +22,9 @@ module Tapicero
end
users.deleted do |hash|
- Tapicero.logger.debug "Deleted user " + hash.to_json
+ puts "Deleted user " + hash['id']
+ db = UserDatabase.new(Config.couch_host, Config.db_prefix + hash['id'])
+ db.destroy
end
users.listen