Class: Rake::HDFSFileTask
- Inherits:
-
Task
- Object
- Task
- Rake::HDFSFileTask
- Defined in:
- lib/rake_hdfs/hdfs_file_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
-
#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.
41 42 43 |
# File 'lib/rake_hdfs/hdfs_file_task.rb', line 41 def scope_name(scope, task_name) Rake.from_pathname(task_name) end |
Instance Method Details
#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/rake_hdfs/hdfs_file_task.rb', line 15 def needed? ! WebHDFS::FileUtils.exist?(name) || out_of_date?() || @application..build_all end |
#timestamp ⇒ Object
Time stamp for file task.
20 21 22 23 24 25 26 |
# File 'lib/rake_hdfs/hdfs_file_task.rb', line 20 def if WebHDFS::FileUtils.exist?(name) WebHDFS::FileUtils.mtime(name.to_s) else Rake::LATE end end |