lib/odania/plugin.rb in odania-0.0.9 vs lib/odania/plugin.rb in odania-0.0.11

- old
+ new

@@ -1,21 +1,18 @@ module Odania class Plugin < Odania::Consul def plugins_config configs = retrieve_value 'plugins' - puts - puts 'Configs' - puts configs.inspect - puts - puts - result = {} + result = [] configs.each do |json_data| - config = JSON.parse json_data[:value] - # TODO merge - puts config.inspect - result = config + begin + result << JSON.parse(json_data[:value]) + rescue => e + puts "Can not parse config: #{e} \n\n #{json_data.inspect}" + end end + result end def add_plugin(plugin_config) plugin_name = plugin_config['name']