Skip to content
Snippets Groups Projects
Commit ee307ec1 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: make Lua files proper modules

parent bf7a2c97
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,16 @@ local function loader()
end
-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
return setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})()
local site_config = setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})()
local setmetatable = setmetatable
module 'gluon.site_config'
setmetatable(_M,
{
__index = site_config,
}
)
return _M
......@@ -17,11 +17,15 @@ local function set(_, name, val)
f:close()
end
local sysconfig = {}
local mt = {
__index = get,
__newindex = set,
}
local setmetatable = setmetatable
setmetatable(sysconfig, mt)
return sysconfig
module 'gluon.sysconfig'
setmetatable(_M,
{
__index = get,
__newindex = set,
}
)
return _M
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment