Prepare to autoload any rigs located in the specified directory, as well as one level below in sub-directories. If a repository url is specified, use that to auto-download new rigs.
Auto-loading and auto-downloading use Tcl's auto_index mechanism to load rigs on demand.
Used as default for the global "bgerror" command if it has not been defined elsewhere. This implementation will log a bit of information using "Rig log".
Evaluate the arguments, ignoring any errors but logging them for reference.
Assert the specified condition to be true. If not, the condition as well as its expanded form with actual values is logged. Aliased by default as global "Chk:".
This is a simple configuration settings system. The "config" command retrieves the current value of the named parameter. If the parameter is absent or an empty string, a specified default can be returned instead.
Convert a unix seconds-since-1970 time to a printable date, in one of several formats:
- (empty) - use Tcl's default from "clock format"
- http - return an HTTP-formatted date
- iso - return an ISO8601-formatted date, local time
- isoUTC - return an ISO8601-formatted date, UTC time
If the type contains a percent sign, then it is used as format specifier for "clock format" instead.
Returns true if the given Tcl command exists.
Rig documentation details, for use at the start of each source file.
Return the contents of the specified variable, or the given default if the variable does not exist or contains an empty string.
Return the application home directory.
Define a notification hook for the specified event name. The priority defaults to 5, but you can specify a different value to make this hook run before or after other hooks for this event.
Load a rig from file. Sets up a namespace and ensemble, using "rig conventions".
Generate a log message. The argument can contain $'s and \'s and will be substituted before getting logged. Aliased by default as global "Log:".
Shorthand for access to Tcl's "msgcat" package used for internationalization. Also does a "package require msgcat" to make sure the code is loaded.
Utility to process message catalogs using a slightly more compact notation. This is a thin wrapper around "msgcat::mcmset".
Trigger a notification for the specified event. This will run any hooks defined for this event, in order of priority. The remaining arguments are passed on to each hook.
Hooks which generate errors will be unhooked to prevent further errors.
This fills in configuration settings for use by "Rig config".
Read the contents of a textfile and return it as string. Returns the empty string for files which could not be opened.
A thin wrapper around Tcl's http::geturl.
Reload any changed source files next to the Rig.tcl file itself. Uses "Rig loader" to load/re-load such sources using rig conventions.
Return the current time in milliseconds, formatted for use in logs. Example: "18:40:23.120".
Return text with comments removed, i.e. all lines starting with "#". Comments may be preceded by spaces, but a line such as "abc # def" is not considered to contain a comment.
Remove a previously defined hook from the notification system.
Save the specified content to a text file of the given name. This does not add an extra newline to what is passed in as content.