summaryrefslogtreecommitdiff
path: root/lib/tapicero_daemon.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tapicero_daemon.rb')
-rw-r--r--lib/tapicero_daemon.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/tapicero_daemon.rb b/lib/tapicero_daemon.rb
index 9223acb..9020fa2 100644
--- a/lib/tapicero_daemon.rb
+++ b/lib/tapicero_daemon.rb
@@ -8,22 +8,18 @@
require 'tapicero'
module Tapicero
- Tapicero.logger.info "Observing #{Config.couch_host_without_password}"
- Tapicero.logger.info "Tracking #{Config.users_db_name}"
- # stream = CouchStream.new(Config.couch_host + '/' + Config.users_db_name)
- db = CouchRest.new(Config.couch_host).database(Config.users_db_name)
- users = CouchChanges.new(db, Config.seq_file)
+ users = CouchRest::Changes.new('users')
users.created do |hash|
- Tapicero.logger.debug "Created user " + hash['id']
- db = UserDatabase.new(Config.couch_host, Config.db_prefix + hash['id'])
+ logger.debug "Created user " + hash['id']
+ db = user_database(hash['id'])
db.create
- db.secure(Config.security)
+ db.secure(config.options[:security])
end
users.deleted do |hash|
- Tapicero.logger.debug "Deleted user " + hash['id']
- db = UserDatabase.new(Config.couch_host, Config.db_prefix + hash['id'])
+ logger.debug "Deleted user " + hash['id']
+ db = user_database(hash['id'])
db.destroy
end