Class: Rake::FileCreationTask

Inherits:
FileTask show all
Defined in:
lib/rake/file_creation_task.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

#actions, #application, #comment, #full_comment, #locations, #prerequisites, #scope, #sources

Instance Method Summary collapse

Methods inherited from FileTask

scope_name

Methods inherited from Task

[], #add_description, #arg_description, #arg_names, #clear, clear, #clear_actions, #clear_prerequisites, create_rule, define_task, #enhance, #execute, #initialize, #inspect, #investigation, #invoke, #invoke_prerequisites, #name, #name_with_args, #prerequisite_tasks, #reenable, scope_name, #set_arg_names, #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)


13
14
15
# File 'lib/rake/file_creation_task.rb', line 13

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

#timestampObject

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



19
20
21
# File 'lib/rake/file_creation_task.rb', line 19

def timestamp
  Rake::EARLY
end