Class: Rake::FileCreationTask

Inherits:
FileTask show all
Defined in:
lib/rake.rb

Overview

A FileCreationTask is a file task that when used as a dependency will be needed if and only if the file has not been created. Once created, it is not re-triggered if any of its dependencies are newer, nor does trigger any rebuilds of tasks that depend on it whenever it is updated.

Constant Summary

Constants inherited from Task

Task::RULES, Task::TASKS

Instance Attribute Summary

Attributes inherited from Task

#comment, #prerequisites, #sources

Instance Method Summary collapse

Methods inherited from Task

[], #add_comment, clear, create_rule, define_task, #enhance, enhance_with_matching_rule, #execute, #initialize, #investigation, #invoke, lookup, #name, #source, task_defined?, tasks

Constructor Details

This class inherits a constructor from Rake::Task

Instance Method Details

#needed?Boolean

Is this file task needed? Yes if it doesn’t exist.

Returns:

  • (Boolean)


430
431
432
# File 'lib/rake.rb', line 430

def needed?
  ! File.exist?(name)
end

#timestampObject

Time stamp for file creation task. This time stamp is earlier than any other time stamp.



436
437
438
# File 'lib/rake.rb', line 436

def timestamp
  Rake::EARLY
end