[Rake-devel] Why do MultiTask and Task send different args to their prerequisites?

Michael Bishop mbishop at me.com
Wed Nov 21 03:36:09 UTC 2012


Hello everyone,

I've been looking at something that has been confusing me for a while. It appears that MultiTask and Task send different arguments to their prerequisites and I can't figure out the reason why. I'm hoping someone on the list will know right away.

I've looked and the code for each case and expanded it and they are basically identical except for this last remaining functional difference between the two:

TASK

@prerequisites.collect { |p|
  prereq = lookup_prerequisite(p) # returns a task
  prereq_args = args.new_scope(prereq.arg_names)
  prereq.invoke_with_call_chain(prereq_args, invocation_chain)
}

MULTITASK

@prerequisites.collect do |p|
  prereq = lookup_prerequisite(p) # returns a task
  prereq.invoke_with_call_chain(args, invocation_chain)
end


Why the extra 

  prereq_args = args.new_scope(prereq.arg_names)

in the TASK case? How does its absence affect MultiTask argument processing? Shouldn't they be the same?

Any ideas?

Thank you,

_ michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20121120/39520ba8/attachment.html>


More information about the Rake-devel mailing list