Skip to content

Commit

Permalink
Added new template and variables: finapp.
Browse files Browse the repository at this point in the history
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
mbbx6spp committed Jan 30, 2011
1 parent 6ce7885 commit 06496ee
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
14 changes: 14 additions & 0 deletions finapp.app.src
@@ -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
11 changes: 11 additions & 0 deletions finapp.template
@@ -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"}.
23 changes: 23 additions & 0 deletions finapp_app.erl
@@ -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:
23 changes: 23 additions & 0 deletions finapp_sup.erl
@@ -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:

0 comments on commit 06496ee

Please sign in to comment.