Diff

init.lua @ 257:816b8ccb3082

verse: Add init(...) method to load connection modules (client, component, bosh, etc.)
author Matthew Wild <mwild1@gmail.com>
date Mon, 05 Dec 2011 15:38:18 +0000
parent 247:7c58c16efa3e
child 259:05acf08d2e98
line wrap: on
line diff
--- a/init.lua	Mon Dec 05 15:36:53 2011 +0000
+++ b/init.lua	Mon Dec 05 15:38:18 2011 +0000
@@ -19,6 +19,17 @@
 
 verse.plugins = {};
 
+function verse.init(...)
+	for i=1,select("#", ...) do
+		local ok = pcall(require, "verse."..select(i,...));
+		if not ok then
+			error("Verse connection module not found: verse."..select(i,...));
+		end
+	end
+	return verse;
+end
+
+
 local max_id = 0;
 
 function verse.new(logger, base)