summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2014-02-04 09:16:19 +0100
committerAzul <azul@riseup.net>2014-02-04 11:46:57 +0100
commitee4f24abf2a7848a015cfb02bfbdebf7b0874d8e (patch)
tree5ec140a864562ecf789fdc9faebbe0cff9f96ce6
parentcbf35664160a57da4c96796e99911b982afacba2 (diff)
hand config files on the command line to the daemon
-rwxr-xr-xbin/tapicero3
-rw-r--r--lib/tapicero.rb6
-rw-r--r--lib/tapicero/version.rb1
3 files changed, 4 insertions, 6 deletions
diff --git a/bin/tapicero b/bin/tapicero
index 32cc228..72f974b 100755
--- a/bin/tapicero
+++ b/bin/tapicero
@@ -46,7 +46,8 @@ end
# --overwrite-security overwrite existing couch security settings
# TODO: not implemented yet:
# --overwrite-designs overwrite existing design documents
-Tapicero::FLAGS.concat ARGV.grep(/--.*/)
+Tapicero::FLAGS.concat ARGV.grep(/--.*/)
+Tapicero::CONFIGS.concat ARGV.grep(/\.ya?ml$/)
# if flags have been set but an action is missing we assume
# tapicero should run in foreground.
diff --git a/lib/tapicero.rb b/lib/tapicero.rb
index 0c7007f..390257d 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
@@ -18,8 +15,7 @@ module Tapicero
# 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
diff --git a/lib/tapicero/version.rb b/lib/tapicero/version.rb
index 1d372e5..9841437 100644
--- a/lib/tapicero/version.rb
+++ b/lib/tapicero/version.rb
@@ -2,4 +2,5 @@ module Tapicero
VERSION = "0.3.2"
REQUIRE_PATHS = ['lib']
FLAGS = []
+ CONFIGS = ['config/default.yaml', '/etc/leap/tapicero.yaml']
end