Luke Kanies <[EMAIL PROTECTED]> writes:
> 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. :)
Fair enough. I am, personally, always wary of any language feature
built on the basis of "someone might" that causes trouble for "someone
does", but ...
[...]
>> What about methods like 'rand', or split?
...these are certainly reasonable and valid objections.
>> Ruby's templating language *is* Ruby - anything that makes it less
>> like Ruby is harmful, in my opinion.
My point of view on this is that we are talking about the *puppet*
scripting language, not the Ruby scripting language. For the later,
Ruby, I completely agree with you.
For puppet I am less decided: a more restrictive language might make
sense, because it is not for general use -- it is for use in a specific,
restricted problem domain.
However...
[...]
>> 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.
... as noted, I will write appropriate testing for my instance variable
branch and resubmit that.[1]
Regards,
Daniel
Footnotes:
[1] ...as noted elsewhere, I will probably also ask for Ruby to develop
a hook to catch access to undefined member variables, so that this
facility can be added back to Puppet with a sufficiently recent
version of the interpreter.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---