Rebar3 Erlang Templates for common OTP behaviors.
Do this only once:
mkdir -p ~/.config/rebar3/templates
git clone git@github.com:marianoguerra/rebar3_otp_templates.git ~/.config/rebar3/templates/rebar3_otp_templates
If there are updates in the repo with new templates you can update them locally with:
cd ~/.config/rebar3/templates/rebar3_otp_templates
git pull origin master
Modules are created in the current directory.
$ rebar3 new gen_server name=foo
===> Writing foo.erl
$ rebar3 new gen_statem name=foo
===> Writing foo.erl
$ rebar3 new supervisor name=sup child_name=sup_child
===> Writing sup.erl
- gen_server template based on https://gist.github.com/sergium/e65a41d7e6956c436177
- gen_statem template based on https://gist.github.com/eproxus/28fd864e2ba607d13ed4f5abc89ca27a
- supervisor based on https://gist.github.com/eproxus/28fd864e2ba607d13ed4f5abc89ca27a and snippet from tsloughter