module Rake::TaskManager
def resolve_args(args)
Resolve the arguments for a task/rule. Returns a triplet of
def resolve_args(args) task_name = args.shift arg_names = args #.map { |a| a.to_sym } needs = [] if task_name.is_a?(Hash) hash = task_name task_name = hash.keys[0] needs = hash[task_name] end if arg_names.last.is_a?(Hash) hash = arg_names.pop needs = hash[:needs] fail "Unrecognized keys in task hash: #{hash.keys.inspect}" if hash.size > 1 end needs = [needs] unless needs.respond_to?(:to_ary) [task_name, arg_names, needs] end