Skip to content

Commit

Permalink
fix for nested bot config keys
Browse files Browse the repository at this point in the history
  • Loading branch information
netfeed committed Aug 2, 2012
1 parent 72bbb09 commit e188baa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/cinchize.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e188baa

Please sign in to comment.