-
Notifications
You must be signed in to change notification settings - Fork 4
Dump module helpers
Argonaut module helpers created with option aliases while decoding can be dumped on disk.
jason:dump/1
jason:dump(list()) -> ok.jason:dump/2
jason:dump(list(), atom()) -> ok | {error, Module, Reason}.jason:dump/1 expect an existing directory name as argument.
jason:dump/2 expect an existing directory name as 1st argument and a module name as 2nd argument.
jason will try to dump all modules listed in current process registry jason_adhoc into a valid OTP directory structure under the root directory given as 1st argument. If jason_adhoc is empty, jason will check all loaded modules on the system and dump only argonaut modules created by option aliases. Those ones have a jason attribute, but are also temporary created on disk in jason priv_dir under a directory called dump, and code path set to it.
Other argonaut modules are loaded in VM but are considered removed by code:module_status/1 because no Beam file is found in path. They can be used like any other module anyway.
Once dumped on disk, aliases modules code path is set to new path and temporary module in jason priv_dir is removed.
See example.