[Rake-devel] minor issue with task invoke

Jim Weirich jim.weirich at gmail.com
Wed Nov 5 02:19:22 EST 2008

On Nov 5, 2008, at 1:35 AM, Ittay Dror wrote:

> in Task#execute, this code:
> @actions.each do |act|
>       case act.arity
>       when 1
>         act.call(self)
>       else
>         act.call(self, args)
>       end
> means that if i define a task:
> task 'foo' {puts 'blah'}
> then the task is called with arguments, when, for consistency it  
> should be called with none.

Lambdas still support assignment semantics when passing arguments.   
This means that if I pass two arguments (t and args) to a lambda with  
only a single formal arg, they will be grouped together in an array.   
This is not the effect I wanted.  I only wanted t to be passed in in  
that case.

In all other cases, it is safe to pass in both arguments.

If you think it is necessary to pass no args, can you write a unit  
test demonstrating that need?

-- Jim Weirich
-- jim.weirich at gmail.com

More information about the Rake-devel mailing list