diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-11-10 16:58:02 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-11-10 16:58:02 +0000 |
commit | 139fc8ae74c5019003e1b4fa350240f8e9fedebc (patch) | |
tree | 105f82ae90082dfa16b94a4b200e37570e712453 /bin | |
parent | e272804ec875ab1562a5ecc3f58bcaf135fe6fbb (diff) |
Changed mauve config to allow including directory and filenames.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/mauveconsole | 5 | ||||
-rw-r--r-- | bin/mauveserver | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/bin/mauveconsole b/bin/mauveconsole index 169ca54..211eaab 100644 --- a/bin/mauveconsole +++ b/bin/mauveconsole @@ -89,7 +89,6 @@ require 'pp' def error(msg) logger = Log4r::Logger['Mauve'] - logger.error logger.error "*** Error: #{msg}" logger.error "*** For help, type: #{$0} -h" @@ -139,7 +138,9 @@ module Mauve end begin - Mauve::Configuration.current = Mauve::ConfigurationBuilder.load(configuration_file) + builder = Mauve::ConfigurationBuilder.new + builder.include_file(configuration_file) + Mauve::Configuration.current = builder.result Mauve::Server.instance.setup rescue StandardError => ex error ex diff --git a/bin/mauveserver b/bin/mauveserver index 77b372d..b0c3573 100644 --- a/bin/mauveserver +++ b/bin/mauveserver @@ -130,7 +130,9 @@ require 'mauve/configuration_builder' require 'mauve/configuration_builders' begin - Mauve::Configuration.current = Mauve::ConfigurationBuilder.load(configuration_file) + builder = Mauve::ConfigurationBuilder.new + builder.include_file(configuration_file) + Mauve::Configuration.current = builder.result rescue StandardError => ex error ex end @@ -149,8 +151,9 @@ end # Reload configuration # begin - new_config = Mauve::ConfigurationBuilder.load(configuration_file) - Mauve::Configuration.current = new_config + builder = Mauve::ConfigurationBuilder.new + builder.include_file(configuration_file) + Mauve::Configuration.current = builder.result rescue BuildException => ex Mauve::Server.instance.logger.error "Reconfiguration failed: #{ex.to_s}. Sticking with old one." end |