private Method

TaskManager.attempt_rule(task_name, extensions, block, level)

Attempt to create a rule given the list of prerequisites.

Source Code

# File rake.rb, line 1754
def attempt_rule(task_name, extensions, block, level)
  sources = make_sources(task_name, extensions)
  prereqs = sources.collect { |source|
    if File.exist?(source) || Rake::Task.task_defined?(source)
      source
    elsif parent = enhance_with_matching_rule(sources.first, level+1)
      parent.name
    else
      return nil
    end
  }
  task = FileTask.define_task({task_name => prereqs}, &block)
  task.sources = prereqs
  task
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.