buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@realityforge.org>
Subject Re: alias :project :define
Date Mon, 22 Nov 2010 23:41:58 GMT
> After mulling over this (and writing but not sending a long email about the
> finer semantics I was originally thinking about), I think I'll simplify my
> proposal down to,
>
> task.after [:foo, :bar] do
>  # ...
> end
>
> which would be exactly like task.enhance, except it would also accept a
> single task (i.e., non-array argument.)  The block remains optional.
>
> And secondly,
>
> task.before [:foo, :bar] do
>  # ...
> end
>
> would be equivalent to:
>
> task.enhance do
>  # ...
> end
>
> task(:foo).enhance [task]
> task(:bar).enhance [task]
>
> Hopefully this is clearer than my previous proposal and promotes better
> design.  (And I think that what some of you expected the first time around.)
>
> Makes sense?

I think I now understand your intention. Mainly a simple way to
enhance multiple tasks at the same time? I thought it was about
providinga more fluent API. Have you considered something like the
following that would fit more inline with rake terminology?

decorate(:foo, :bar).enhance ["myprereq"] do
  # my after actions
end

or

multi_enhance([:foo, :bar],["myprereq"]) do
  # my after actions
end


-- 
Cheers,

Peter Donald

Mime
View raw message