Sha256: 5161028dae193843f887553874b6cab92ab4ab9198bdf20ca358ebda03f7d8fe
Contents?: true
Size: 508 Bytes
Versions: 12
Compression:
Stored size: 508 Bytes
Contents
#!/usr/bin/env ruby require 'sablon' require 'json' if ARGV.size < 1 puts <<-HELP cat <context path> | sablon <template path> [<output path>] HELP exit end template_path = File.expand_path(ARGV[0]) context_json = STDIN.readlines.join context = JSON.parse(context_json) template = Sablon.template(template_path) if !ARGV[1].nil? && !ARGV[1].empty? output_path = File.expand_path(ARGV[1]) template.render_to_file(output_path, context) else $stdout.print template.render_to_string(context) end
Version data entries
12 entries across 12 versions & 1 rubygems