class Rake::DataTask::DataTask
Public Class Methods
new(data, app)
click to toggle source
Private Class Methods
scope_name(scope, task_name)
click to toggle source
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.
# File lib/data_task.rb, line 61 def scope_name(scope, task_name) task_name end
Public Instance Methods
needed?()
click to toggle source
Is this table task needed? Yes if it doesn’t exist, or if its time stamp is out of date.
# File lib/data_task.rb, line 28 def needed? !@data.exist? || out_of_date?(timestamp) end
timestamp()
click to toggle source
Time stamp for data task.
# File lib/data_task.rb, line 33 def timestamp 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
Private Instance Methods
out_of_date?(stamp)
click to toggle source
Are there any prerequisites with a later time than the given time stamp?
# File lib/data_task.rb, line 46 def out_of_date?(stamp) @prerequisites.any? do |n| prereq_time = application[n, @scope].timestamp return false if prereq_time == Rake::EARLY prereq_time > stamp end end