summaryrefslogtreecommitdiff
path: root/lib/tapicero.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tapicero.rb')
-rw-r--r--lib/tapicero.rb26
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/tapicero.rb b/lib/tapicero.rb
index e2a8f38..a098287 100644
--- a/lib/tapicero.rb
+++ b/lib/tapicero.rb
@@ -1,9 +1,6 @@
unless defined? BASE_DIR
BASE_DIR = Pathname.new(__FILE__) + '../..'
end
-unless defined? TAPICERO_CONFIG
- TAPICERO_CONFIG = '/etc/leap/tapicero.yaml'
-end
module Tapicero
class <<self
@@ -11,27 +8,24 @@ module Tapicero
attr_accessor :config
end
-
+ # reraise exceptions instead of retrying
+ # used in tests
+ unless defined? RERAISE
+ RERAISE = false
+ end
#
# Load Config
# this must come first, because CouchRest needs the connection
# defined before the models are defined.
#
require 'couchrest/changes'
- configs = ['config/default.yaml', TAPICERO_CONFIG, ARGV.grep(/\.ya?ml$/).first]
- self.config = CouchRest::Changes::Config.load(BASE_DIR, *configs)
+ self.config = CouchRest::Changes::Config.load(BASE_DIR, *CONFIGS)
self.logger = CouchRest::Changes::Config.logger
# hand flags over to CouchRest::Changes
- config.flags = FLAGS
- puts "flags: #{FLAGS}" if FLAGS.any?
-
- #
- # Load Tapicero Parts
- #
- require 'tapicero/user_database'
-
- def self.user_database(id)
- UserDatabase.new(config.couch_host, config.options[:db_prefix] + id)
+ if defined? FLAGS
+ config.flags = FLAGS
+ puts "flags: #{FLAGS}" if FLAGS.any?
end
+
end