diff options
author | Kim Alvefur <zash@zash.se> | 2015-08-20 13:05:22 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-08-20 13:05:22 +0200 |
commit | 6ef7c4d80892f486d71e660b054bdfdb993c8528 (patch) | |
tree | 103fd7d9396b60b9f76071a009c54d3ca9d35744 /util/pluginloader.lua | |
parent | a9029bd099734436154fc4e794d3b958e54d1943 (diff) | |
parent | d32f36b2817739d7f8d5f1208a3009b7be379562 (diff) | |
download | prosody-6ef7c4d80892f486d71e660b054bdfdb993c8528.tar.gz prosody-6ef7c4d80892f486d71e660b054bdfdb993c8528.zip |
Merge 0.10->trunk
Diffstat (limited to 'util/pluginloader.lua')
-rw-r--r-- | util/pluginloader.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/util/pluginloader.lua b/util/pluginloader.lua index b9b3e207..0d7eafa7 100644 --- a/util/pluginloader.lua +++ b/util/pluginloader.lua @@ -17,9 +17,7 @@ end local io_open = io.open; local envload = require "util.envload".envload; -module "pluginloader" - -function load_file(names) +local function load_file(names) local file, err, path; for i=1,#plugin_dir do for j=1,#names do @@ -35,7 +33,7 @@ function load_file(names) return file, err; end -function load_resource(plugin, resource) +local function load_resource(plugin, resource) resource = resource or "mod_"..plugin..".lua"; local names = { @@ -48,7 +46,7 @@ function load_resource(plugin, resource) return load_file(names); end -function load_code(plugin, resource, env) +local function load_code(plugin, resource, env) local content, err = load_resource(plugin, resource); if not content then return content, err; end local path = err; @@ -57,4 +55,8 @@ function load_code(plugin, resource, env) return f, path; end -return _M; +return { + load_file = load_file; + load_resource = load_resource; + load_code = load_code; +}; |