On Jul 21, 2008, at 1:24 PM, Adam Jacob wrote: > On Sun, Jul 20, 2008 at 5:02 PM, Daniel Pittman > <[EMAIL PROTECTED]> wrote: > OK. I don't quite understand the basis of your objection here; it > would > help me if you could explain why you object. > > As far as I can see there is no sensible definition of, for example, > "puts", "fork" or "raise" during the template expansion process. > > Is your objection that you can see a meaningful use of those > functions, > or simply that you don't like the (relatively) ugly steps required to > provide a clean evaluation environment in Ruby? > > It's both - I think that if I could forsee why someone wants to use > those functions in the template, I would be Psychic. :) That > doesn't mean that there isn't a use-case where it makes sense to > utilize them... for example, we make calls out to iClassify in > templates all the time, since we want access to cross-component > metadata and prefer to not use Export/Collect. While your patch > wouldn't neccessarily make this impossible, it certainly makes it > more difficult. > > What about methods like 'rand', or split? > > Ruby's templating language *is* Ruby - anything that makes it less > like Ruby is harmful, in my opinion. (Unless you want to replace the > templating language with something other than Erb, at which point > it's not Ruby, and you can make it behave however you like) > > Essentially, the behavior I would like to see is the equivilant of > Erubis' context object support, with the context populated with all > the available variables. That would get you everything you're > looking for, with the exception of throwing an exception if a > variable is missing/undefined.
I concur -- if there's a change, I think this should be the change. -- Criminal: A person with predatory instincts who has not sufficient capital to form a corporation. --Howard Scott --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
