- provide cli command to render erb template
- template params (bindings) to be provided using json format
- use inputs from file (template.erb, params.json)
- use inputs from cli options / parameters
- render output to stdout OR to file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dump_str(o) | |
-- transform a table into a string for the printing. | |
-- found it on google | |
-- better to use print_r from here http://www.arpalert.org/haproxy-scripts.html | |
if type(o) == 'table' then | |
local s = '{ ' | |
for k,v in pairs(o) do | |
if type(k) ~= 'number' then k = '"'..k..'"' end | |
s = s .. '['..k..'] = ' .. dump_str(v) .. ',' |