Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rebar Erlang and OTP templates written by Susan Potter of Finsignia. Until Rebar supports global default variable setting, you will probably need to fork this repository and edit the author_name and author_email in the variables section of the .template files.
Erlang
branch: master
Failed to load latest commit information.
finapp Reorganize finapp template files
README.textile README.textile updated with new templates.
ctsuite.erl Convert CT Suite edoc type specs to real specs
ctsuite.template Create consistent 'name' var for all templates
ejabberdmod.erl Fix a few instances where author_name was used instead of author_email.
ejabberdmod.template Added author_name template variable.
escript Convert escript edoc type specs to real type specs
escript.template Create consistent 'name' var for all templates
eunit.erl Fix a few instances where author_name was used instead of author_email.
eunit.template Create consistent 'name' var for all templates
finapp.template Reorganize finapp template files
finevt.erl Move gen_event to finevt Rebar template.
finevt.template Move gen_event to finevt Rebar template.
finsrv.erl Clean up finsrv template for gen_server modules
finsrv.template Add default copyright_year variable for finsrv
finsrv_proper_statem.erl Add PropEr ASM callback template for gen_server
finsrv_proper_statem.template Add PropEr ASM callback template for gen_server
finsup.erl Add finsup template for isolated supervisor
finsup.template Add finsup template for isolated supervisor
nitroaction.erl Fix typo in Nitrogen action template
nitroaction.template Initial Nitrogen action Rebar template
nitroelem.erl Fix syntax error in Nitrogen element template
nitroelem.template Add Nitrogen v2.x element module template
nitropage.erl Create consistent 'name' var for all templates
nitropage.template Create consistent 'name' var for all templates
project.template Create consistent 'name' var for all templates
project_Emakefile Added project template files for rebar.
project_Makefile Add release script targets to project Makefile
project_README Create consistent 'name' var for all templates
project_gitignore Added project template files for rebar.
project_rebar.config Fixed syntax error in project_rebar.config.
rebar_compiler.erl Fix a few instances where author_name was used instead of author_email.
rebar_compiler.template Create consistent 'name' var for all templates
rebar_compiler_SUITE.erl Create consistent 'name' var for all templates
riak_pipe_vnode_worker.erl Add riak_pipe vnode worker template
riak_pipe_vnode_worker.template Add riak_pipe vnode worker template
webmachine_resource.erl Add service_available/2 to WM resource exports
webmachine_resource.template Add Webmachine resource Rebar template files
ztmod.erl Fix a few instances where author_name was used instead of author_email.
ztmod.template Create consistent 'name' var for all templates

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.