public Method

TaskManager.resolve_args(args)

Resolve the arguments for a task/rule. Returns a triplet of [task_name, arg_name_list, prerequisites].

Source Code

# File rake.rb, line 1645
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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.