How do I execute Rake tasks with arguments multiple times?
问题 It's not possible to invoke the same rake task from within a loop more than once. But, I want to be able to call rake first and loop through an array and invoke second on each iteration with different arguments. Since invoke only gets executed the first time around, I tried to use execute , but Rake::Task#execute doesn't use the splat (*) operator and only takes a single argument. desc "first task" task :first do other_arg = "bar" [1,2,3,4].each_with_index do |n,i| if i == 0 Rake::Task["foo