Pipette
Installation
- mix.exs
def deps do
[{:pipette, "~> 0.0.1"}]
end
Usage
- build
iex> File.read!("hello.txt")
"hello, <%= msg %>\n"
iex> Pipette.build(%{template: "hello.txt", destination: "world.txt", msg: "world"})
:ok
iex> File.read!("world.txt")
"hello, world"
- pre hook
iex> data = %{template: "hello.txt", destination: "world.txt", msg: "world"}
iex> Pipette.build(data, pre: &Dict.put(&1, :msg, "pipette"))
:ok
iex> File.read!("world.txt")
"hello, pipette"
- post hook
iex> data = %{template: "hello.txt", destination: "world.txt", msg: "world"}
iex> Pipette.build(data, post: &("[#{&1}]")
:ok
iex> File.read!("world.txt")
"[hello, world]"
License
Copyright (C) 2015 Masashi Iizuka(@uochan)
Distributed under the MIT License.