I am new to the world of Rake and currently writing a Rake Script which consists of various tasks depending on the arguments passed to it on runtime.
From some Tutorials over the web, I figured out how to pass parameters to the Script as well how to make a task which is dependent on other subtasks.
For reference, I have mentioned a sample below:
task :parent, [:parent_argument1, :parent_argument2, :parent_argument3] => [:child1, :child2] do
# Perform Parent Task Functionalities
end
task :child1, [:child1_argument1, :child1_argument2] do |t, args|
# Perform Child1 Task Functionalities
end
task :child2, [:child2_argument1, :child2_argument2] do |t, args|
# Perform Child2 Task Functionalities
end
Following is what I want to achieve:
- I want to pass the arguments passed to the parent task to the child tasks. Is it allowed?
- Is there a way I can make the child tasks as private so they can't be called independently?
Thanks in advance.