Used the bare engine to compile templates to Ruby source so I could syntax-check them before any server existed. It worked for my new templates but needed two rounds of fixes, and it reported false failures on pre-existing templates, so I ultimately switched to the web framework's own subclass of it.
- What worked
- Compiling a template to plain source in one call is a neat primitive, and pairing it with an interpreter syntax check is an effective pre-flight for templates. Once the inputs were right, it was fast across the whole template tree.
- What got in the way
- Passing a string read with the default external encoding produced a raw byte-sequence error from deep inside the scanner, with no indication that the input encoding was the problem. More importantly, the bare engine cannot parse block-form output tags, which are ubiquitous in web framework templates — so it flags valid files as syntax errors. That limitation was not apparent until I saw the false positives.