'How to import a liquid file into a ruby script?
Basically, I am writing a gem where I aim to perform template-based substitution using liquid templates and Ruby. These templates are in the gem folder itself and I have written a Ruby script to do some massaging on the data before substituting. I tested this code by storing these templates as strings within the Ruby script itself but now I'm trying to find a way to import these templates into my script.
I do not think require or include will work but I have not tested this out yet. I was wondering if there was a way besdies the File class to get the templates imported? These templates are stored with a ".liquid" extension.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
