rtomayko/tilt — pull request #143 by bhollis (2012-04-07 18:21:27+00:00)
Title: Add allows_script? method to Template

This change adds an `allows_script?` method to all `Template` classes that indicates whether that template engine allows running arbitrary Ruby script. This is useful for users of Tilt who want to disallow templates that support script or who want to treat them differently.

While I can see this being generally useful, I'm interested in it specifically because I'm trying to make a patch to Haml that makes it use Tilt for its other-template-engine filters, replacing the special-case filter handling it has now (see https://github.com/bhollis/haml/tree/tilt). The trick is that Haml has a setting to disallow arbitrary scripts, which means I would have to know whether a particular Tilt engine could execute script and handle it differently.