Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Replace template project with an example project
Since rebar3 expects templates to be in `~/.config/rebar3/templates/` [1], opt to instead having just an example project users can copy and update on their own. [1] https://www.rebar3.org/docs/tutorials/templates
- Loading branch information
Showing
19 changed files
with
121 additions
and
122 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
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
@@ -0,0 +1,14 @@ | ||
/ebin | ||
/doc | ||
/_test | ||
/.eunit | ||
/docs | ||
.DS_Store | ||
/TEST-*.xml | ||
/deps | ||
/.rebar | ||
*.swp | ||
*.beam | ||
*.dump | ||
_build/ | ||
rebar.lock |
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
@@ -0,0 +1,16 @@ | ||
REBAR?=rebar3 | ||
|
||
.PHONY: all edoc test clean app | ||
|
||
build: | ||
@$(REBAR) get-deps # rebar2 compatibility, it's no-op on rebar3 | ||
@$(REBAR) compile | ||
|
||
test: | ||
@$(REBAR) eunit | ||
|
||
edoc: | ||
@$(REBAR) edoc | ||
|
||
clean: | ||
@$(REBAR) clean |
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
@@ -1,7 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# workaround for rebar mustache template bug | ||
DEFAULT_PORT={{port}} | ||
DEFAULT_PORT=8080 | ||
HOST=${HOST:-127.0.0.1} | ||
PORT=${PORT:-${DEFAULT_PORT}} | ||
|
||
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
@@ -3,6 +3,6 @@ | ||
<title>It Worked</title> | ||
</head> | ||
<body> | ||
{{appid}} running. | ||
example_project running. | ||
</body> | ||
</html> |
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
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
@@ -0,0 +1,9 @@ | ||
%% -*- erlang -*- | ||
{application, example_project, | ||
[{description, "example_project"}, | ||
{vsn, "0.1"}, | ||
{modules, []}, | ||
{registered, []}, | ||
{mod, {'example_project_app', []}}, | ||
{env, []}, | ||
{applications, [kernel, stdlib, crypto]}]}. |
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
@@ -0,0 +1,30 @@ | ||
%% @author Mochi Media <dev@mochimedia.com> | ||
%% @copyright 2010 Mochi Media <dev@mochimedia.com> | ||
|
||
%% @doc example_project. | ||
|
||
-module(example_project). | ||
-author("Mochi Media <dev@mochimedia.com>"). | ||
-export([start/0, stop/0]). | ||
|
||
ensure_started(App) -> | ||
case application:start(App) of | ||
ok -> | ||
ok; | ||
{error, {already_started, App}} -> | ||
ok | ||
end. | ||
|
||
|
||
%% @spec start() -> ok | ||
%% @doc Start the example_project server. | ||
start() -> | ||
example_project_deps:ensure(), | ||
ensure_started(crypto), | ||
application:start(example_project). | ||
|
||
|
||
%% @spec stop() -> ok | ||
%% @doc Stop the example_project server. | ||
stop() -> | ||
application:stop(example_project). |
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
@@ -0,0 +1,22 @@ | ||
%% @author Mochi Media <dev@mochimedia.com> | ||
%% @copyright example_project Mochi Media <dev@mochimedia.com> | ||
|
||
%% @doc Callbacks for the example_project application. | ||
|
||
-module(example_project_app). | ||
-author("Mochi Media <dev@mochimedia.com>"). | ||
|
||
-behaviour(application). | ||
-export([start/2,stop/1]). | ||
|
||
|
||
%% @spec start(_Type, _StartArgs) -> ServerRet | ||
%% @doc application start callback for example_project. | ||
start(_Type, _StartArgs) -> | ||
example_project_deps:ensure(), | ||
example_project_sup:start_link(). | ||
|
||
%% @spec stop(_State) -> ServerRet | ||
%% @doc application stop callback for example_project. | ||
stop(_State) -> | ||
ok. |
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
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
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
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
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
exec erl \ | ||
-pa _build/default/lib/example_project/ebin \ | ||
-pa _build/default/lib/mochiweb/ebin \ | ||
-pa ebin deps/*/ebin \ | ||
-boot start_sasl \ | ||
-sname example_project_dev \ | ||
-s example_project \ | ||
-s reloader |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.