module Thor::Invocation
def _prepare_for_invocation(name, sent_task=nil) #:nodoc:
be invoked and a Thor::Task object.
responsible to normalize them by returning the object where the task should
This method can receive several different types of arguments and it's then
def _prepare_for_invocation(name, sent_task=nil) #:nodoc: if name.is_a?(Thor::Task) task = name elsif task = self.class.all_tasks[name.to_s] object = self else object, task = self.class.prepare_for_invocation(nil, name) task ||= sent_task end # If the object was not set, use self and use the name as task. object, task = self, name unless object return object, _validate_task(object, task) end