lib/rake/microsecond.rb in rake-builder-0.0.16 vs lib/rake/microsecond.rb in rake-builder-0.0.17
- old
+ new
@@ -33,24 +33,28 @@
class DirectoryTask < Task
include FileUtils
attr_accessor :timestamp
+ attr_accessor :path
def self.define_task( *args, &block )
- task = super( *args, &block )
+ task = super(*args, &block)
+ task.path = args[0]
task.timestamp = nil
task
end
def needed?
- exists = File.directory?( self.name )
- @timestamp = File.stat( self.name ).mtime if exists
+ exists = File.directory?(self.path)
+ if exists && @timestamp.nil?
+ @timestamp = File.stat(self.path).mtime
+ end
! exists
end
def execute(*args)
- mkdir_p self.name, :verbose => false
+ mkdir_p self.path, :verbose => false
@timestamp = Time.now
super(*args)
end
end