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.

Instance Attribute Summary

Attributes inherited from Task

#application, #comment, #prerequisites, #scope, #sources

Instance Method Summary collapse

Methods inherited from FileTask

scope_name

Methods inherited from Task

[], #add_comment, clear, create_rule, define_task, #enhance, #execute, #initialize, #investigation, #invoke, #invoke_prerequisites, #name, scope_name, #source, task_defined?, tasks, #to_s

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)


540
541
542
# File 'lib/rake.rb', line 540

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

#timestampObject

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



546
547
548
# File 'lib/rake.rb', line 546

def timestamp
  Rake::EARLY
end