tags:

views:

77

answers:

1

I have rake tasks which i want to run in proper sequence.

I want to run one rake task which run other rake tasks in proper sequence.

How may i do that?

+3  A: 

you should consider defining dependencies between your tasks like this

  task :primary => [:secondary]

  task :secondary do
    puts "Doing Secondary Task" 
  end

But if you really, really need to call the tasks directly you can use invoke to call another task

  task :primary do
    Rake::Task[:secondary].invoke
  end

  task :secondary do
    puts "Doing Secondary Task" 
  end

see also here

Nikolaus Gradwohl
@nikolaus if my all tasks in different files than how may i run those tasks from one task.
krunal shah
try to require the file where the tasks are defined from the file where you want to call the tasks
Nikolaus Gradwohl
@nikolaus can you give me idea how may i pass parameters with invoke statement.
krunal shah
by adding them as parameter to invoke - invoke(param1, param2,...)
Nikolaus Gradwohl
@nikolaus thank you...
krunal shah