util/import.lua

Thu, 02 Sep 2010 23:09:49 +0200

author
Florian Zeitz <florob@babelmonkeys.de>
date
Thu, 02 Sep 2010 23:09:49 +0200
changeset 3487
b5c92275910b
parent 2923
b7049746bd29
permissions
-rw-r--r--

mod_admin_adhoc: New module with merged functonality of mod_adhoc_cmd_admin and mod_adhoc_cmd_modules (of prosody-modules fame)

-- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
-- 
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--



local t_insert = table.insert;
function import(module, ...)
	local m = package.loaded[module] or require(module);
	if type(m) == "table" and ... then
		local ret = {};
		for _, f in ipairs{...} do
			t_insert(ret, m[f]);
		end
		return unpack(ret);
	end
	return m;
end

mercurial