SYNOPSIS
MAD is a small and fast rebar replacement.
INTALL
Place MAD binary into
$PATH or
/usr/local/bin:
$ curl -fsSL \
https://raw.github.com/synrc/mad/master/mad > mad \
&& chmod +x mad \
&& sudo cp /usr/local/bin
HELP
MAD accepts a list of words. This list of words contains special words,
delimiters or commands.
Words between commands are arguments for the nearest command from left.
$ mad
MAD Manage Dependencies ad426a
invoke = mad | mad params
params = [] | command [options] params
command = app [web|mqtt] <name> | deps | clean | compile | strip
| bundle [beam|script] <name> | get <repo> | up [name]
| start | stop | attach | repl | static [watch|min]
APP
Create predefined sample application.
MAD has built-in two sample applications: web and mqtt.
$ mad app web sample
Created: "sample/sys.config"
Created: "sample/apps/sample/priv/static/spa/index.htm"
Created: "sample/apps/sample/rebar.config"
Created: "sample/apps/sample/priv/templates/index.html"
Created: "sample/apps/sample/src/sample.erl"
Created: "sample/rebar.config"
Created: "sample/apps/sample/src/index.erl"
Created: "sample/apps/rebar.config"
Created: "sample/vm.args"
Created: "sample/apps/sample/src/sample.app.src"
Created: "sample/apps/sample/priv/static/synrc.css"
Created: "sample/apps/sample/src/routes.erl"
OK
DEPS
$ cat rebar.config
{sub_dirs,["apps"]}.
{deps_dir,"deps"}.
{deps, [
{erlydtl,".*", {git, "git://github.com/voxoz/erlydtl", [] }},
{cowboy, ".*", {git, "git://github.com/voxoz/cowboy", [] }},
{gproc, ".*", {git, "git://github.com/voxoz/gproc", [] }},
{fs, ".*", {git, "git://github.com/synrc/fs", {tag, "4.10"} }},
{sh, ".*", {git, "git://github.com/synrc/sh", {tag, "2.10"} }},
{mad, ".*", {git, "git://github.com/synrc/mad", {tag, "4.10"} }},
{active, ".*", {git, "git://github.com/synrc/active", {tag, "4.10"} }},
{nitro, ".*", {git, "git://github.com/synrc/nitro", {tag, "3.10"} }},
{n2o, ".*", {git, "git://github.com/synrc/n2o", {tag, "5.10"} }}
]}
$ mad deps
==> dependency: "git://github.com/voxoz/erlydtl" tag: []
==> dependency: "git://github.com/voxoz/cowlib" tag: []
==> dependency: "git://github.com/voxoz/ranch" tag: []
==> dependency: "git://github.com/voxoz/gproc" tag: []
==> dependency: "git://github.com/synrc/fs" tag: {tag,"4.10"}
==> dependency: "git://github.com/synrc/sh" tag: {tag,"2.10"}
==> dependency: "git://github.com/synrc/mad" tag: {tag,"4.10"}
==> dependency: "git://github.com/synrc/active" tag: {tag,"4.10"}
==> dependency: "git://github.com/synrc/nitro" tag: {tag,"3.10"}
==> dependency: "git://github.com/synrc/n2o" tag: {tag,"5.10"}
OK
GET
$ mad get kvx
==> dependency: "https://github.com/synrc/kvx" tag: []
OK
UP
$ mad up
OK
CLEAN
$ mad clean
OK
START
$ mad start
Scripting: "/Users/maxim/depot/synrc/mad/mad"
OK
ATTACH
$ $(mad attach)
Attaching to . (^D to exit)
1>
STOP
COMPILE
$ mad compile
Writing /apps/sample/ebin/sample.app
OK
PLAN
$ mad plan
Generated [kernel,stdlib,fs,ranch,crypto,compiler,syntax_tools,inets,cowlib,
cowboy,n2o,sample,active,erlydtl,gproc,mad,nitro,sh]
OK
BUNDLE
$ mad bundle script sample
Generated [kernel,stdlib,fs,ranch,crypto,compiler,syntax_tools,inets,cowlib,
cowboy,n2o,sample,active,erlydtl,gproc,mad,nitro,sh]
OK
REPL
$ mad repl
$ open http://127.0.0.1:8001