lsyncd/mantle/userenv.lua

71 lines
1.5 KiB
Lua
Raw Normal View History

2018-03-15 12:43:02 +00:00
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- userenv.lua
--
--
-- Setups up the global environment for a user script.
--
2018-03-23 16:36:51 +00:00
-- The default sync implementations will add the 'default' global
-- to this. They are loaded in user context, so they can simply set it.
--
2018-03-15 12:43:02 +00:00
--
-- License: GPLv2 (see COPYING) or any later version
-- Authors: Axel Kittenberger <axkibe@gmail.com>
--
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-03-15 16:11:45 +00:00
userENV =
{
-- generic lua stuff to be available
_VERSION = _VERSION,
assert = assert,
bit32 = bit32,
coroutine = coroutine,
dofile = dofile,
error = error,
getmetatable = getmetable,
io = io,
ipairs = ipairs,
load = load,
loadfile = loadfile,
loadstring = loadstring,
math = math,
module = module,
next = next,
os = os,
package = package,
pairs = pairs,
pcall = pcall,
print = print,
rawequal = rawequal,
rawlen = rawlen,
rawget = rawget,
rawset = rawset,
require = require,
select = select,
setmetatable = setmetatable,
string = string,
table = table,
type = type,
unpack = unpack,
2018-03-15 12:43:02 +00:00
2018-03-15 16:11:45 +00:00
-- lsyncd mantle available to user scripts
Array = Array,
Queue = Queue,
settings = settings,
spawn = spawn,
spawnShell = spawnShell,
sync = sync,
2018-03-15 12:43:02 +00:00
2018-03-15 16:11:45 +00:00
-- lsyncd core available to user scripts
2018-03-19 08:02:30 +00:00
log = core.log,
2018-03-15 16:11:45 +00:00
nonobservefs = core.nonobserfd,
now = core.now,
observefd = core.observefd,
readdir = core.readdir,
terminate = core.terminate
}
2018-03-15 12:43:02 +00:00
2018-03-15 16:11:45 +00:00
userENV._G = userENV
2018-03-15 12:43:02 +00:00