Erubis template improper implementation in CHEF?


#1

Hello chefs,

I’ve just run into an issue with Erubis enhancers. This capability
doesn’t completely work with chef.
The chef’s method of extending Erubis::Context seems a bit strange for
me now.

So far I want to enhance Eruby with Erubis::PrintEnabledEnhancer, it
should work like this

Erubis::Eruby.send(:include, Erubis::PrintEnabledEnhancer)

How ever if I do this the chef templating code completely breaks… If
opscode guys inherited Eruby and extended it with all node and chef
stuff. The Erubis functionality should work fine.

Does anybody noticed this, maybe there should be a ticket open for this?

Regards,
Denis


#2

On Monday, June 24, 2013 at 4:15 AM, Denis Barishev wrote:

Hello chefs,

I’ve just run into an issue with Erubis enhancers. This capability
doesn’t completely work with chef.
The chef’s method of extending Erubis::Context seems a bit strange for
me now.

So far I want to enhance Eruby with Erubis::PrintEnabledEnhancer, it
should work like this

Erubis::Eruby.send(:include, Erubis::PrintEnabledEnhancer)

How ever if I do this the chef templating code completely breaks… If
opscode guys inherited Eruby and extended it with all node and chef
stuff. The Erubis functionality should work fine.

Does anybody noticed this, maybe there should be a ticket open for this?

Regards,
Denis

Check the code in master. There’s a new feature in 11.6 (next release) that allows per-template extensions, the template code in Chef was slightly modified to handle this.


Daniel DeLeo