Lua 5.2/5.3 hotfix. Hot update functions and keep old data.

$ luarocks install hotfix

hotfix reload the module and update the old module, keeping the old data.

Usage:

local hotfix = require("hotfix")
hotfix.hotfix_module("mymodule.sub_module")

hotfix_module() uses package.searchpath(module_name, package.path)
to search the path of module.
The module is reloaded and the returned value is updated to package.loaded[module_name].

hotfix_module() will skip unloaded module to avoid unexpected loading.

Functons are updated to new ones but old upvalues are kept.
Old tables are kept and new fields are inserted.
All references to old functions are replaced to new ones.

Versions

scm-1dev6 years ago0 downloads
0.1-16 years ago50 downloads

Dependencies

lua >= 5.2

Manifests