On Fri, Aug 22, 2008 at 7:54 AM, Francois Deppierraz <[EMAIL PROTECTED]> wrote: > > I'm trying to implement an eval function in Puppet but couldn't figure > out a way to get code evaluated from a string. > > > module Puppet::Parser::Functions > newfunction(:eval, :doc => "Evaluate Puppet code") do |args| > code = args[0] > debug "Evaluating %s" % code > > # How can I get this code evaluated ? > end > end
I don't really understand what you're up to here, Francois. Can you give us a use case, or even better, a recipe sample? If what you are trying to do is eval some puppet code, literally, I'm totally unclear as to what the purpose of that would be. If you're trying to eval some random bit of ruby, that's easy: eval(code) Adam -- HJK Solutions - We Launch Startups - http://www.hjksolutions.com Adam Jacob, Senior Partner T: (206) 508-4759 E: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
