forked from mbbx6spp/rebar-templates
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new template and variables: finapp.
Finapp will generate an app.src, application behavior callback module and a supervisor behavior callback module set of files in the layout that Finsignia LLC prefers for internal Erlang/OTP codebases.
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
%%-*- mode: erlang -*- | ||
{application, {{app_name}}, | ||
[ | ||
{description, "{{description}}"}, | ||
{vsn, "0.1.0"}, | ||
{registered, []}, | ||
{applications, [ | ||
kernel, | ||
stdlib | ||
]}, | ||
{mod, { {{app_name}}_app, []}}, | ||
{env, []} | ||
]}. | ||
%% vim: set filetype=erlang tabstop=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{variables, [ | ||
{app_name, "appname"}, | ||
{app_dir, "."}, | ||
{copyright_year, "2011"}, | ||
{author_name, "Susan Potter"}, | ||
{author_email,"me@susanpotter.net"} | ||
]}. | ||
{dir, "{{app_dir}}/src"}. | ||
{template, "finapp.app.src", "{{app_dir}}/src/{{app_name}}.app.src"}. | ||
{template, "finapp_app.erl", "{{app_dir}}/src/{{app_name}}_app.erl"}. | ||
{template, "finapp_sup.erl", "{{app_dir}}/src/{{app_name}}_sup.erl"}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%%%' HEADER | ||
%%% @author {{author_name}} <{{author_email}}> | ||
%%% @since {{date}} | ||
%%% @copyright {{copyright_year}} {{author_name}} | ||
%%% @doc {{description}} | ||
%%% @end | ||
|
||
-module({{app_name}}_app). | ||
-behaviour(application). | ||
|
||
-export([start/2, stop/1]). | ||
%%%. | ||
%%%' CALLBACKS | ||
start(_StartType, _StartArgs) -> | ||
{{app_name}}_sup:start_link(). | ||
|
||
stop(_State) -> | ||
ok. | ||
%%%. | ||
%%%' PRIVATE FUNCTIONS | ||
|
||
%%%. | ||
%%% vim: set filetype=erlang tabstop=2 foldmarker=%%%',%%%. foldmethod=marker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%%%' HEADER | ||
%%% @author {{author_name}} <{{author_email}}> | ||
%%% @since {{date}} | ||
%%% @copyright {{copyright_year}} {{author_name}} | ||
%%% @doc {{description}} | ||
%%% @end | ||
-module(tint_sup). | ||
|
||
-behaviour(supervisor). | ||
-export([start_link/0]). | ||
-export([init/1]). | ||
%%%. | ||
%%%' PUBLIC API | ||
start_link() -> | ||
supervisor:start_link({local, ?MODULE}, ?MODULE, []). | ||
|
||
%%%. | ||
%%%' CALLBACKS | ||
init([]) -> | ||
{ok, { {one_for_one, 5, 10}, []} }. | ||
|
||
%%%. | ||
%%% vim: set filetype=erlang tabstop=2 foldmarker=%%%',%%%. foldmethod=marker: |