implement modules:path for config.lua
authorTero Marttila <terom@fixme.fi>
Thu, 02 Apr 2009 03:02:54 +0300
changeset 115 2d74b38b56de
parent 114 6de0490408f4
child 116 92e71129074d
implement modules:path for config.lua
config.lua
--- a/config.lua	Thu Apr 02 02:59:52 2009 +0300
+++ b/config.lua	Thu Apr 02 03:02:54 2009 +0300
@@ -17,10 +17,10 @@
         },
     },
 
+    modules_path    = "src/modules",
+
     modules = {
         irc_log     = {
-            path        = "src/modules/mod_irc_log.so",
-
             conf        = {
                 db_info     = "dbname=spbot",
                 channel     = "PVLNet/#test",
@@ -32,10 +32,10 @@
 -- apply general
 log_level(conf.log_level)
 
--- apply conf_name
+-- apply conf.name
 client:set_defaults(conf.name.nickname, conf.name.username, conf.name.realname)
 
--- apply conf_networks
+-- apply conf.networks
 for network, settings in pairs(conf.networks) do
     -- establish the irc_net
     net = client:connect(network, settings.hostname)
@@ -46,7 +46,12 @@
     end
 end
 
--- apply conf_modules
+-- apply conf.modules_path
+if conf.modules_path then
+    modules:path(conf.modules_path)
+end
+
+-- apply conf.modules
 for name, settings in pairs(conf.modules) do
     -- load the module
     module = modules:load(name, settings.path)