Method: Rake::TaskManager#enhance_with_matching_rule
- Defined in:
- lib/rake/task_manager.rb
#enhance_with_matching_rule(task_name, level = 0) ⇒ Object
If a rule can be found that matches the task name, enhance the task with the prerequisites and actions from the rule. Set the source attribute of the task appropriately for the rule. Return the enhanced task or nil of no rule was found.
125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/rake/task_manager.rb', line 125 def enhance_with_matching_rule(task_name, level=0) fail Rake::RuleRecursionOverflowError, "Rule Recursion Too Deep" if level >= 16 @rules.each do |pattern, args, extensions, block| if pattern.match(task_name) task = attempt_rule(task_name, args, extensions, block, level) return task if task end end nil rescue Rake::RuleRecursionOverflowError => ex ex.add_target(task_name) fail ex end |