Module unicorn.util¶
Index¶
Module
Data
A table containing "safe" functions that have no side effects outside of where they are used. @doctype const |
Function
Load some Lua code in a sandboxed environment. Scripts have access to any variable defined in unicorn.util.sandbox_env. |
|
Run string.gsub on a particular file |
Api reference¶
-
unicorn.util.smartHttp(url:
string): (The:string)¶ - Parameters:
url (
string) – A valid HTTP or HTTPS URL.- Returns:
The (
string) – content from the request
-
unicorn.util.fileWrite(content:
string, path:string):boolean¶ - Parameters:
content (
string) – The contents of the file to be written.path (
string) – The full path of the file to be written.
-
unicorn.util.sandbox_env:
table¶ A table containing “safe” functions that have no side effects outside of where they are used. @doctype const
-
unicorn.util.evaluateInSandbox(input:
string):function¶ Load some Lua code in a sandboxed environment. Scripts have access to any variable defined in unicorn.util.sandbox_env.
See
load- Parameters:
input (
string) – Lua code to evaluate
-
unicorn.util.substituteInPlace(file:
string, ...:The)¶ Run string.gsub on a particular file
See
string.gsub- Parameters:
file (
string) – The path to the file to operate on... (
The) – parameters to pass to string.gsub