Skip to content

Instantly share code, notes, and snippets.

@frsyuki
Created October 28, 2015 06:32
Show Gist options
  • Save frsyuki/53e7e8d0e40cee0d6f4a to your computer and use it in GitHub Desktop.
Save frsyuki/53e7e8d0e40cee0d6f4a to your computer and use it in GitHub Desktop.
included!
paramter: {{ env.EDITOR }}
require 'liquid'
source = %[
{% include 'inc' %}
]
here = File.expand_path(File.dirname(__FILE__))
Liquid::Template.file_system = Liquid::LocalFileSystem.new(here, "%s.liquid")
puts Liquid::Template.parse(source).render({"env" => ENV.to_h})
# result:
#
# included!
# paramter: vim
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment