[Rg 96] Re: [PATCH] Gestalt improvements

gabriele renzi rff_rff at yahoo.it
Thu Sep 20 16:27:16 EDT 2007


On Thu, 20 Sep 2007 20:18:09 +0200, Stephan Maka wrote:

> Hi there,
> 
> I'm working on XSLT templates and Gestalt came handy for bringing
> controller instance data to XML, which is needed as template input.
> 
> The attached patch extends the parameters to be not only the attributes
> but also text children. Both are being properly escaped now. Two specs
> are added.
> 
> I hope the patch is in proper form, I've never used Darcs before.

FWIW, the patch is well formed, and once applied it also seems to work
correctly. But this message is just to point out how happy I am that the
nitro community is keen on writing specs when implementing features :)

I just have a small doubt:
        if block_given?
          text = yield
          @out << text.to_str if text != @out and text.respond_to?(:to_str)
        end

if the result of the block does not respond to to_str and/or is not @out,
nothing happens, which could hide errors, I think.

Wouldn't it be better to just have:

        if block_given?
          text = yield
          @out << text.to_str if text != @out
        end
so that the behaviour is more fail-early?

-- 
goto 10: http://www.goto10.it
blog it: http://riffraff.blogsome.com
blog en: http://www.riffraff.info



More information about the Ramaze-general mailing list