Created
April 2, 2012 07:57
-
-
Save xuhdev/2281501 to your computer and use it in GitHub Desktop.
A simple command line tool to test liquid files
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
#!/usr/bin/env ruby | |
# test liquid | |
# | |
# Usage: | |
# | |
# ruby test_liquid.rb template | |
# | |
# e.g. | |
# | |
# ruby test_liquid.rb 'Hello {{ name }}' | |
# | |
require 'liquid' | |
@template = Liquid::Template.parse("#{$*[0]}") | |
puts @template.render() # Could have local assignments here: puts @template.render('name' => 'someone') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment