Skip to content

Instantly share code, notes, and snippets.

@xuhdev
Created April 2, 2012 07:57
Show Gist options
  • Save xuhdev/2281501 to your computer and use it in GitHub Desktop.
Save xuhdev/2281501 to your computer and use it in GitHub Desktop.
A simple command line tool to test liquid files
#!/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