aboutsummaryrefslogtreecommitdiff
path: root/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.lua')
-rw-r--r--helpers.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/helpers.lua b/helpers.lua
index ef92bfa..223c5f1 100644
--- a/helpers.lua
+++ b/helpers.lua
@@ -9,6 +9,8 @@
-- {{{ Grab environment
local pairs = pairs
+local rawget = rawget
+local require = require
local tonumber = tonumber
local io = { open = io.open }
local setmetatable = setmetatable
@@ -29,6 +31,13 @@ local scroller = {}
-- }}}
-- {{{ Helper functions
+-- {{{ Loader of vicious modules
+function wrequire(table, key)
+ local module = rawget(table, key)
+ return module or require(table._NAME .. "." .. key)
+end
+-- }}}
+
-- {{{ Expose path as a Lua table
function pathtotable(dir)
return setmetatable({ _path = dir },