Class: Rake::DataTask::DataTask
- Inherits:
-
Task
- Object
- Task
- Rake::DataTask::DataTask
- Defined in:
- lib/data_task.rb
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
-
#initialize(data, app) ⇒ DataTask
constructor
Instantiate a new DataTask.
-
#needed? ⇒ Boolean
Is this table task needed? Yes if it doesn’t exist, or if its time stamp is out of date.
-
#timestamp ⇒ Object
Time stamp for data task.
Constructor Details
#initialize(data, app) ⇒ DataTask
Instantiate a new DataTask.
21 22 23 24 |
# File 'lib/data_task.rb', line 21 def initialize(data, app) super @data = data end |
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. Table based tasks ignore the scope when creating the name.
61 62 63 |
# File 'lib/data_task.rb', line 61 def scope_name(scope, task_name) task_name end |
Instance Method Details
#needed? ⇒ Boolean
Is this table task needed? Yes if it doesn’t exist, or if its time stamp is out of date.
28 29 30 |
# File 'lib/data_task.rb', line 28 def needed? !@data.exist? || out_of_date?() end |
#timestamp ⇒ Object
Time stamp for data task.
33 34 35 36 37 38 39 40 41 |
# File 'lib/data_task.rb', line 33 def if @data.exist? mtime = @data.mtime.to_time raise "Table #{name} exists but modified time is unavailable." if mtime.nil? mtime else Rake::EARLY end end |