From e188baa9e342bfe0748bbb2e3dc679e6034369a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Berg=C3=B6=C3=B6?= Date: Thu, 2 Aug 2012 23:46:57 +0200 Subject: [PATCH] fix for nested bot config keys --- lib/cinchize.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/cinchize.rb b/lib/cinchize.rb index 548c09c..52ee931 100644 --- a/lib/cinchize.rb +++ b/lib/cinchize.rb @@ -102,7 +102,7 @@ def start app = daemon.new_application :mode => :none, :log_output => options[:log_output] app.start - network = @network.keys.inject({}) { |memo, key| memo[key.to_sym] = @network[key]; memo } + network = _sym_hash(@network) plugins = @plugins plugin_options = @plugin_options @@ -148,6 +148,17 @@ def running? rescue Errno::ESRCH => e return false end + + def _sym_hash hsh + hsh.keys.inject({}) do |memo, key| + if hsh[key].is_a? Hash + memo[key.to_sym] = _sym_hash(hsh[key]) + else + memo[key.to_sym] = hsh[key] + end + memo + end + end end end