lib/rake/microsecond.rb in rake-builder-0.0.19 vs lib/rake/microsecond.rb in rake-builder-0.7.0
- old
+ new
@@ -16,12 +16,20 @@
task.timestamp = nil
task
end
def needed?
- return true if ! File.exist?( self.name )
- @timestamp = File.stat( self.name ).mtime if @timestamp.nil?
- return self.prerequisites.any? { | n | ! application[n].timestamp.nil? && application[n].timestamp > @timestamp }
+ return true if not File.exist?(self.name)
+ @timestamp = File.stat(self.name).mtime if @timestamp.nil?
+ self.prerequisites.any? do |n|
+ task = application[n]
+ if task.is_a?(Rake::FileTask) or
+ task.is_a?(self.class)
+ task.timestamp > @timestamp
+ else
+ task.needed?
+ end
+ end
end
def execute(*args)
@timestamp = Time.now
super(*args)