Skip to content

Instantly share code, notes, and snippets.

@nappa32
Created November 12, 2015 02:02
Show Gist options
  • Save nappa32/8793a7722e3b73380c5b to your computer and use it in GitHub Desktop.
Save nappa32/8793a7722e3b73380c5b to your computer and use it in GitHub Desktop.
rake multitask example
task :task1 => [:big_db_task] do
sleep 1
puts "Task 1"
end
task :big_db_task do
puts "Big db task"
end
task :task3 => [:big_db_task] do
puts "Task 3"
end
task :task4 => [:big_db_task] do
puts "Task 4"
end
task :rollups do
puts "running rollups"
end
task :run_reports => [:rollups] do
puts "Run Reports"
end
task :basecamp_upload => [:run_reports] do
puts "Basecamp upload"
end
task :new_task do
Rake::Task[:mytask].enhance([:task4]).invoke
end
multitask :mytask => [:task1, :task3, :rollups, :run_reports, :basecamp_upload] do
puts "Completed parallel execution of tasks 1 through 3."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment