Florent Gallaire
0e39dc4149
Support switch template instructions
pirms 11 gadiem
Evax Software
2970fab4b7
Support conditional template instructions
pirms 11 gadiem
Andrew Thompson
ee8919420d
Support reading mustache 'lists' from files
This commit add support for reading mustache 'lists' from files, so you
can use the list section functionality when templating things.
An example of the list syntax is as follows:
{package_commands, {list, [[{name, "riak"}], [{name, "riak-admin"}], [{name, "search-cmd"}]]}}.
Then you can, for each of the list elements, render some text:
{{#package_commands}}
chmod +x bin/{{name}}
{{/package_commands}}
pirms 12 gadiem
Tuncer Ayaz
4b8c81fb53
Implement 'rebar help CMD1 CMD2' and extend common 'rebar help' msg
* allow plugins to print help message for implemented commands
* append core rebar.config options to common 'rebar help' message
pirms 12 gadiem
Tuncer Ayaz
252757c753
Do not use application:set_env
pirms 13 gadiem
Tuncer Ayaz
e1c9d69d1d
Do not use rebar_config:set_global in rebar_templater
pirms 13 gadiem
Tuncer Ayaz
d9e6cc3d90
Do not use process dict in rebar_templater
pirms 13 gadiem
Tuncer Ayaz
fd0697239d
Use lists:foreach because result is ignored
pirms 13 gadiem
Tuncer Ayaz
385e3f09ba
Decrease indentation in list-templates printout
pirms 13 gadiem
Tuncer Ayaz
49f3cc4108
Fix crash introduced in 4414f65
via pull/245
pirms 13 gadiem
Tuncer Ayaz
0c27fd4f7f
rebar_templater: fix comment
pirms 13 gadiem
Tuncer Ayaz
8d81b322ed
Fix whitespace errors
pirms 13 gadiem
hirschen
4414f6548a
List substitution variable names in 'list-templates' command.
pirms 13 gadiem
Jesse Gumm
4f6f41cabb
Fix typos in rebar_templater
pirms 13 gadiem
Tuncer Ayaz
74ca540939
Use same variable names as file:make_link/2
pirms 13 gadiem
Przemysław Dąbek
eb23571b8b
Add possibility to make symbolic links
Simple feature, useful to make link to something without copying it.
pirms 13 gadiem
Tuncer Ayaz
edf4bbc370
Fix error handling bug in {copy,In,Out} template
pirms 14 gadiem
Tuncer Ayaz
a4ffe1ce62
Use filename:join/1
pirms 14 gadiem
cloudhead
dd9adac8c4
Add support for {copy, src, dst} to templater
pirms 14 gadiem
Dave Smith
bda6ee0e48
Centralize variable resolution; add target_dir variable
pirms 14 gadiem
Dave Smith
c4907b6297
Add support for loading template vars from external file
pirms 14 gadiem
Tuncer Ayaz
63de05d914
Clean up code
pirms 14 gadiem
Tuncer Ayaz
c466076ffb
Clean up emacs file local variables
pirms 14 gadiem
Tuncer Ayaz
3b0568ebb7
Simplify and cleanup rebar_templater
pirms 14 gadiem
Tuncer Ayaz
58fd80917a
Fix file existence checks
pirms 14 gadiem
Tuncer Ayaz
a8870807fc
Fix code clarity
pirms 14 gadiem
David Reid
63d5ceb61d
Support single level of nested template variables
Add support for defining template variables of the following form:
{variables, [{appid, "mochiwebapp"},
{author, "Mochi Media <dev@mochimedia.com>"},
{year, "2010"},
{version, "0.1"},
{port, 8080},
{dest, "{{appid}}"}]}.
Where dest may be overridden on the commandline but will default to
being the appid. Mochiweb uses this so that we can create new
projects from the template in a configurable directory.
So
$ rebar create template=mochiwebapp dest=foo appid=bar
I thought about special casing dest but figured it might be generally
useful to be able to nest template vars.
However this patch only does one level of resolution. So if
{variables, [{foo, "{{bar}}"},
{bar, "{{foo}}"}]}.
then bar will end up being the literal string {{bar}} and foo the
literal string {{foo}}.
pirms 14 gadiem
Kostis Sagonas
7dc76d578e
Tidier improvements
pirms 14 gadiem
Kostis Sagonas
e024778599
Dialyzer related cleanups
pirms 14 gadiem
Dave Smith
b32eeeafb7
Add support for specifying template directory on the command line
pirms 14 gadiem
Dave Smith
b063d3b8df
Fix bug 438; add support for listing available templates
pirms 14 gadiem
Tuncer Ayaz
dfb5af4049
Add forward-compatible escript_foldl function
escript:foldl/3 was undocumented and has been replaced with
better APIs post-R13B04. The new exported funs are officially
documented.
pirms 15 gadiem
Dave Smith
28d3b75641
Fix bug in templater where escript was not found in subdirs were specified in rebar.config; minor formatting cleanups
pirms 15 gadiem
Bryan Fink
f6feac493d
provide separate 'file' and 'template' directives, instead of one 'file' directive with a boolean Render flag
pirms 15 gadiem
Bryan Fink
60629e8516
add chmod template directive for changing file file permission
usage: {chmod, Mode, File}
where: Mode is an integer, as specified by the 'mode' field of the file_info record
(see docs for file:write_file_info/2)
pirms 15 gadiem
Bryan Fink
4c2dade0f4
add Render flag to 'file' template directive
{file,In,Out,true} = render with mustache
{file,In,Out,false} = do not render with mustache (leave as-is)
old-form {file,In,Out} is equivalent to {file,In,Out,true}
pirms 15 gadiem
Bryan Fink
4e01b32d5d
look for templates in local directory as well
pirms 15 gadiem
Dave Smith
47e70f308a
Add support for forcibly overwriting output files; courtesy of OJ Reeves
pirms 15 gadiem
Dave Smith
ec4e805898
Adding sketch of functionality for creating a reltool node from template
pirms 15 gadiem
Dave Smith
8c4f35a294
Basic implementation of templater is complete
pirms 15 gadiem
Dave Smith
2d9af6cf48
Sketching out templating system
pirms 15 gadiem
Dave Smith
a46be8cec1
Use new rebar_config API to avoid having to actually delete/change the config any
pirms 15 gadiem
Tuncer Ayaz
9a8015f2d7
Added vi modeline/emacs local variables to file headers
pirms 15 gadiem
Dave Smith
2f64f0e6b2
Refactoring core logic in preparation for dependency mgmt; breaking out sub_dir determination into dedicated module
pirms 15 gadiem
Dave Smith
a01e7dcd30
Adding first crack at reltool support
pirms 15 gadiem
Dave Smith
b7e2088c27
Initial commit
pirms 15 gadiem