Markus Roberts <[email protected]> writes:
> On Thu, Apr 8, 2010 at 7:06 AM, Daniel Pittman <[email protected]> wrote:

>> Further to my previous patch on the topic, here is a proof-of-concept patch
>> series that implements a 'replace_file' API, then uses that through the code.

[...]

> I've read through it once and will want to go through it again with more
> coffee in me, but as a proof-of-concept I'd give it a +1 and it appears to
> be pretty much in line with our discussion.

Great.  In line with our discussion I also took a look at the file streaming
stuff, and I /think/ it can work with an unchanged 'replace_file' API as
defined.

> We probably want to either do some rescue/ensure cleanup in replace_file (in
> case they raise an exception in the block) but it's still a net improvement
> (leaving clutter rather than corrupting the files).

Good point.  I will take a look at adding that shortly.

The bit I was the most unhappy with was the need to use a lambda for the
"verify before commit" part of the API, which supports one caller, and is kind
of ugly.

If anyone has suggestions for a more Ruby way to do that, such as using
syntax-sugar functions that return blocks or whatever, I am very happy to
rework this to the style.  I just don't know what best practice is. :)

        Daniel

-- 
✣ Daniel Pittman            ✉ [email protected]            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

-- 
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.

Reply via email to