瀏覽代碼

Bump bbmustache and fix templates (#1862)

* bump bbmustache to version 1.6.0

* Use alternative bbmustache brackets in templates

This fixes the problems where literal nested tuples (`{{a,b},c}` or
`{{a,b}}`) would blow up and spaces needed to be inserted.
pull/1903/head
Fred Hebert 6 年之前
committed by Tristan Sloughter
父節點
當前提交
d538be3481
共有 7 個文件被更改,包括 23 次插入18 次删除
  1. +4
    -3
      priv/templates/otp_app.app.src
  2. +7
    -6
      priv/templates/plugin_README.md
  3. +3
    -2
      priv/templates/relx_rebar.config
  4. +4
    -3
      priv/templates/sup.erl
  5. +2
    -1
      priv/templates/sys.config
  6. +1
    -1
      rebar.config
  7. +2
    -2
      rebar.lock

+ 4
- 3
priv/templates/otp_app.app.src 查看文件

@ -1,8 +1,9 @@
{application, {{name}},
[{description, "{{desc}}"},
{{=@@ @@=}}
{application, @@name@@,
[{description, "@@desc@@"},
{vsn, "0.1.0"},
{registered, []},
{mod, { {{name}}_app, []}},
{mod, {@@name@@_app, []}},
{applications,
[kernel,
stdlib

+ 7
- 6
priv/templates/plugin_README.md 查看文件

@ -1,7 +1,8 @@
{{name}}
{{=@@ @@=}}
@@name@@
=====
{{desc}}
@@desc@@
Build
-----
@ -14,13 +15,13 @@ Use
Add the plugin to your rebar config:
{plugins, [
{ {{name}}, ".*", {git, "git@host:user/{{name}}.git", {tag, "0.1.0"}}}
{@@name@@, {git, "https://host/user/@@name@@.git", {tag, "0.1.0"}}}
]}.
Then just call your plugin directly in an existing application:
$ rebar3 {{name}}
===> Fetching {{name}}
===> Compiling {{name}}
$ rebar3 @@name@@
===> Fetching @@name@@
===> Compiling @@name@@
<Plugin Output>

+ 3
- 2
priv/templates/relx_rebar.config 查看文件

@ -1,8 +1,9 @@
{{=@@ @@=}}
{erl_opts, [debug_info]}.
{deps, []}.
{relx, [{release, { {{name}}, "0.1.0" },
[{{name}},
{relx, [{release, {@@name@@, "0.1.0"},
[@@name@@,
sasl]},
{sys_config, "./config/sys.config"},

+ 4
- 3
priv/templates/sup.erl 查看文件

@ -1,9 +1,10 @@
{{=@@ @@=}}
%%%-------------------------------------------------------------------
%% @doc {{name}} top level supervisor.
%% @doc @@name@@ top level supervisor.
%% @end
%%%-------------------------------------------------------------------
-module({{name}}_sup).
-module(@@name@@_sup).
-behaviour(supervisor).
@ -31,7 +32,7 @@ start_link() ->
%% Before OTP 18 tuples must be used to specify a child. e.g.
%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules}
init([]) ->
{ok, { {one_for_all, 0, 1}, []} }.
{ok, {{one_for_all, 0, 1}, []}}.
%%====================================================================
%% Internal functions

+ 2
- 1
priv/templates/sys.config 查看文件

@ -1,3 +1,4 @@
{{=@@ @@=}}
[
{ {{name}}, []}
{@@name@@, []}
].

+ 1
- 1
rebar.config 查看文件

@ -7,7 +7,7 @@
{parse_trans, "3.3.0"}, % force otp-21 compat
{providers, "1.7.0"},
{getopt, "1.0.1"},
{bbmustache, "1.5.0"},
{bbmustache, "1.6.0"},
{relx, "3.27.0"},
{cf, "0.2.2"},
{cth_readable, "1.4.2"},

+ 2
- 2
rebar.lock 查看文件

@ -1,5 +1,5 @@
{"1.1.0",
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.5.0">>},0},
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.6.0">>},0},
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.3.1">>},0},
{<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},0},
{<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.4.2">>},0},
@ -13,7 +13,7 @@
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.3">>},0}]}.
[
{pkg_hash,[
{<<"bbmustache">>, <<"8CFDE0602E90A4057E161BF5288ADE854B4E511E2E8924966A8438730E958381">>},
{<<"bbmustache">>, <<"7AC372AEC621A69C369DF237FBD9986CAABCDD6341089FE5F42E5A7A4AC706B8">>},
{<<"certifi">>, <<"D0F424232390BF47D82DA8478022301C561CF6445B5B5FB6A84D49A9E76D2639">>},
{<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>},
{<<"cth_readable">>, <<"0F57B4EB7DA7F5438F422312245F9143A1B3118C11B6BAE5C3D1391C9EE88322">>},

Loading…
取消
儲存