Rebar Erlang, OTP and other project templates. Use rebar3 for rebar3 templates and updates.
Erlang
Permalink
Failed to load latest commit information.
cowboy Fix cowboyapp, finapp, finsup rebar templates Feb 8, 2016
finapp Reorganize finapp template files Jun 9, 2013
README.adoc Minor README update Oct 7, 2015
cowboyapp.template Fix cowboyapp, finapp, finsup rebar templates Feb 8, 2016
ctsuite.erl Convert CT Suite edoc type specs to real specs Jun 13, 2011
ctsuite.template Update templates for rebar3 incl. globals Oct 7, 2015
ejabberdmod.erl Remove incomplete documentation from ejabberdmod.erl Oct 7, 2015
ejabberdmod.template Update templates for rebar3 incl. globals Oct 7, 2015
escript Convert escript edoc type specs to real type specs Jun 13, 2011
escript.template Update templates for rebar3 incl. globals Oct 7, 2015
eunit.erl Fix a few instances where author_name was used instead of author_email. May 23, 2011
eunit.template Update templates for rebar3 incl. globals Oct 7, 2015
finapp.template Fix cowboyapp, finapp, finsup rebar templates Feb 8, 2016
finevt.erl Fix signatures in finevt and finsrv .erl templates Feb 8, 2016
finevt.template Update templates for rebar3 incl. globals Oct 7, 2015
finsrv.erl Fix signatures in finevt and finsrv .erl templates Feb 8, 2016
finsrv.template Update templates for rebar3 incl. globals Oct 7, 2015
finsrv_proper_statem.erl Add PropEr ASM callback template for gen_server Jun 13, 2011
finsrv_proper_statem.template Update templates for rebar3 incl. globals Oct 7, 2015
finsup.erl Add finsup template for isolated supervisor Feb 15, 2011
finsup.template Fix cowboyapp, finapp, finsup rebar templates Feb 8, 2016
globals Fix cowboyapp, finapp, finsup rebar templates Feb 8, 2016
project.template Fix to erlterm syntax in project.template Oct 10, 2015
project_Emakefile Added project template files for rebar. Dec 10, 2010
project_Makefile Add release script targets to project Makefile Jul 1, 2011
project_README Create consistent 'name' var for all templates Feb 9, 2011
project_gitignore Added project template files for rebar. Dec 10, 2010
project_rebar.config Fixed syntax error in project_rebar.config. Jan 5, 2011
rebar_compiler.erl Fix a few instances where author_name was used instead of author_email. May 23, 2011
rebar_compiler.template Update templates for rebar3 incl. globals Oct 7, 2015
rebar_compiler_SUITE.erl Create consistent 'name' var for all templates Feb 9, 2011
riak_pipe_vnode_worker.erl Add riak_pipe vnode worker template Mar 3, 2013
riak_pipe_vnode_worker.template Update templates for rebar3 incl. globals Oct 7, 2015
webmachine_resource.erl Add service_available/2 to WM resource exports Apr 9, 2011
webmachine_resource.template Update templates for rebar3 incl. globals Oct 7, 2015

README.adoc

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+)

Status

Many of these templates are from a past life in Erlang which are no longer maintained. I am in the process of culling/curating these templates while I upgrade to rebar3 and return to more active Erlang development.

Please be patient during this transition period.

rebar3

If you don’t already you can clone this Git repository in your ${HOME}/.config/rebar3/templates directory, like so:

 $ git clone git://github.com/mbbx6spp/rebar-templates.git \
  "${HOME}/.config/rebar3/templates"

Be sure to update the globals file with your preferred global values.

pre-rebar3

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

 $ git clone git://github.com/mbbx6spp/rebar-templates.git \
  "${HOME}/.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