Class: MTBuild::MTFileTask
- Inherits:
-
Rake::Task
- Object
- Rake::Task
- MTBuild::MTFileTask
- Defined in:
- lib/mtbuild/mtfile_task.rb
Overview
######################################################################### A FileTask is a task that includes time based dependencies. If any of a FileTask’s prerequisites have a timestamp that is later than the file represented by this task, then the file must be rebuilt (using the supplied actions).
Class Method Summary collapse
-
.scope_name(scope, task_name) ⇒ Object
Apply the scope to the task name according to the rules for this kind of task.
Instance Method Summary collapse
- #force_needed ⇒ Object
-
#needed? ⇒ Boolean
Is this file task needed? Yes if it doesn’t exist, or if its time stamp is out of date.
-
#timestamp ⇒ Object
Time stamp for file task.
Class Method Details
.scope_name(scope, task_name) ⇒ Object
Apply the scope to the task name according to the rules for this kind of task. File based tasks ignore the scope when creating the name.
45 46 47 |
# File 'lib/mtbuild/mtfile_task.rb', line 45 def scope_name(scope, task_name) task_name end |
Instance Method Details
#force_needed ⇒ Object
19 20 21 |
# File 'lib/mtbuild/mtfile_task.rb', line 19 def force_needed() @force_needed = true end |
#needed? ⇒ Boolean
Is this file task needed? Yes if it doesn’t exist, or if its time stamp is out of date.
15 16 17 |
# File 'lib/mtbuild/mtfile_task.rb', line 15 def needed? ! File.exist?(name) || out_of_date?() || @force_needed end |
#timestamp ⇒ Object
Time stamp for file task.
24 25 26 27 28 29 30 |
# File 'lib/mtbuild/mtfile_task.rb', line 24 def if File.exist?(name) File.mtime(name.to_s) else Rake::EARLY end end |