Permalink
Browse files

Merge branch 'multitask-args-fix' of https://github.com/michaeljbisho…

…p/rake into maf

* 'multitask-args-fix' of https://github.com/michaeljbishop/rake:
  Made arg passing to prerequisites consistent for Task+MultiTask.
  • Loading branch information...
2 parents 53181b1 + ca28316 commit a5cc8d003c61127d7c2d218ac8f5b0d8f397f76e @jimweirich committed Nov 21, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/rake/task.rb
View
@@ -182,18 +182,19 @@ def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
if application.options.always_multitask
invoke_prerequisites_concurrently(task_args, invocation_chain)
else
- prerequisite_tasks.each { |prereq|
- prereq_args = task_args.new_scope(prereq.arg_names)
- prereq.invoke_with_call_chain(prereq_args, invocation_chain)
+ prerequisite_tasks.each { |p|
+ prereq_args = task_args.new_scope(p.arg_names)
+ p.invoke_with_call_chain(prereq_args, invocation_chain)
}
end
end
# Invoke all the prerequisites of a task in parallel.
- def invoke_prerequisites_concurrently(args, invocation_chain) # :nodoc:
- futures = @prerequisites.collect do |p|
+ def invoke_prerequisites_concurrently(task_args, invocation_chain) # :nodoc:
+ futures = prerequisite_tasks.collect do |p|
+ prereq_args = task_args.new_scope(p.arg_names)
application.thread_pool.future(p) do |r|
- application[r, @scope].invoke_with_call_chain(args, invocation_chain)
+ r.invoke_with_call_chain(prereq_args, invocation_chain)
end
end
futures.each { |f| f.value }

0 comments on commit a5cc8d0

Please sign in to comment.