lib/mad_chatter/config.rb in mad_chatter-0.3.2 vs lib/mad_chatter/config.rb in mad_chatter-0.3.3

- old
+ new

@@ -15,11 +15,10 @@ config_file = File.join(Dir.pwd, 'config.yml') abort 'Could not find Mad Chatter config.yml file' unless File.exist?(config_file) config = YAML::load(File.open(config_file)) defaults = { - 'websocket_backend' => 'websocket-rack', 'websocket_port' => 8100, } @config = defaults.merge!(config) end @@ -28,18 +27,20 @@ MadChatter.message_listeners << Object.const_get('MadChatter').const_get('MessageListeners').const_get(listener).new end end def init_extensions - simple_extensions_file = File.join(Dir.pwd, 'extensions.rb') - if File.exist?(simple_extensions_file) - file_contents = File.read(simple_extensions_file) - # MadChatter::Extensions.module_eval file_contents - end - - # Dir[Dir.pwd + '/extensions/*.rb'].each do |file| - # require file + # simple_extensions_file = File.join(Dir.pwd, 'extensions.rb') + # if File.exist?(simple_extensions_file) + # file_contents = File.read(simple_extensions_file) + # MadChatter::Extensions.class_eval file_contents # end + + # Auto-require User Defined Extension Classes + Dir[Dir.pwd + '/extensions/*.rb'].each do |file| + require file + # MadChatter.message_listeners << Object.const_get('MadChatter').const_get('Extensions').const_get(file).new + end end def init_default_channels MadChatter.channels << MadChatter::Channel.new('default') end