Skip to content
Rebar Erlang, OTP and other project templates. Use rebar3 for rebar3 templates and updates.
Erlang
Find file
Pull request Compare This branch is 9 commits behind rebar3.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
finapp
README.textile
ctsuite.erl
ctsuite.template
ejabberdmod.erl
ejabberdmod.template
escript
escript.template
eunit.erl
eunit.template
finapp.template
finevt.erl
finevt.template
finsrv.erl
finsrv.template
finsrv_proper_statem.erl
finsrv_proper_statem.template
finsup.erl
finsup.template
nitroaction.erl
nitroaction.template
nitroelem.erl
nitroelem.template
nitropage.erl
nitropage.template
project.template
project_Emakefile
project_Makefile
project_README
project_gitignore
project_rebar.config
rebar_compiler.erl
rebar_compiler.template
rebar_compiler_SUITE.erl
riak_pipe_vnode_worker.erl
riak_pipe_vnode_worker.template
webmachine_resource.erl
webmachine_resource.template
ztmod.erl
ztmod.template

README.textile

Rebar Templates

Overview

This might really only be useful for me, but I thought I would share the
Rebar templates that I have written to streamline my Erlang development.

So far it only consists of templates for the following:

  • ejabberd module
  • OTP gen_server callback modules
  • OTP gen_event callback modules
  • simple rebar project layout
  • escript starter script
  • OTP application and supervisor callback modules
  • Nitrogen page handler (for Nitrogen v2+)

Notes

If you don’t already you can clone this Git repository in your ${HOME}/.rebar/templates directory, i.e.:


 $ git clone git://github.com/mbbx6spp/rebar-templates.git ~/.rebar/templates

(Thanks @dizzyd for the pointer.)

Alternatively you can add this as a submodule under ${PROJECT_ROOT}/priv/templates if you want to use
these templates just for a particular project.

Developer(s)

Contributor(s)

  • Ahmed D. Omar – bug fix in ejabberdmod template (s/init\/7/init\/2/ in exports).

Examples

Rebar Project Layout

If you want to create a new rebar directory layout for your new project you can do the following:


 $ mkdir project_name
 $ cd project_name
 $ rebar create template=project project_name=project_name description="Describe your project here."

This will generate 6 directories and 4 files by default that are organized like the following:


. ├── deps/ ├── ebin/ ├── Emakefile ├── include/ ├── Makefile ├── priv/ ├── README ├── rebar.config ├── src/ └── tests/

ejabberd Module

To generate a stub of an ejabberd extension module that intercepts sent and received packets you can do the following:


%% inside your rebar based project directory $ rebar create template=ejabberdmod name=mod_name_here

HTH
@SusanPotter

Something went wrong with that request. Please try again.