Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add allows_script? method to Template #143

Merged
merged 1 commit into from Aug 5, 2012

Conversation

Projects
None yet
2 participants
Contributor

bhollis commented Apr 7, 2012

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.

@bhollis bhollis Add a method to all Template classes that states whether the template…
… sllows 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.
01e18dd

@bhollis bhollis referenced this pull request in haml/haml Apr 29, 2012

Closed

Use Tilt for inline filters #469

Contributor

bhollis commented May 5, 2012

Would anybody be available to take a look at this?

Owner

rtomayko commented Aug 5, 2012

I like this change. Merging. Thanks!

@rtomayko rtomayko added a commit that referenced this pull request Aug 5, 2012

@rtomayko rtomayko Merge pull request #143 from bhollis/master
Add allows_script? method to Template
2f269cb

@rtomayko rtomayko merged commit 2f269cb into rtomayko:master Aug 5, 2012

Contributor

bhollis commented Aug 6, 2012

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment