On Fri, Jul 1, 2011 at 11:54,  <[email protected]> wrote:
> In looking at the code, though, all you really need to do is a small amount
> of special-casing of json. Something like changing this:
>
>   def render(result)
>     # Invoke the rendering hook supplied by the user, if appropriate.
>     if hook = action.when_rendering(render_as.name)
>       result = hook.call(result)
>     end
>
>     render_as.render(result)
>   end
>
> to this:
>
>   def render(result)
>     # Invoke the rendering hook supplied by the user, if appropriate.
>     if hook = action.when_rendering(render_as.name)
>       result = hook.call(result)
>     end
>
>     if render_as.name == :pson
>       jj result
>     else
>       render_as.render(result)
>     end
>   end

`jj` prints directly, which is not how the rest of the render methods
behave; that said, this would be possible, and would work, right up
until the network format for pson changed in any way.  Overall, I
would much rather avoid having all sorts of special cases scattered
all over the code to render machine formats in human-friendly ways.
If we can do this in a uniform way, great, but going down the path of
special-casing our PSON format everywhere that we use it makes for a
lot more scope for failure.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to