Pipette

Installation

def deps do
[{:pipette, "~> 0.0.1"}]
end

Usage

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"
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"
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.