Debian Codegraph @

rake.d/vendor/drake-0.9.2.0.3.1/lib/rake/file_creation_task.rb

raw
1 require 'rake/file_task'
2 require 'rake/early_time'
3
4 module Rake
5
6 # A FileCreationTask is a file task that when used as a dependency will be
7 # needed if and only if the file has not been created. Once created, it is
8 # not re-triggered if any of its dependencies are newer, nor does trigger
9 # any rebuilds of tasks that depend on it whenever it is updated.
10 #
11 class FileCreationTask < FileTask
12 # Is this file task needed? Yes if it doesn't exist.
13 def needed?
14 ! File.exist?(name)
15 end
16
17 # Time stamp for file creation task. This time stamp is earlier
18 # than any other time stamp.
19 def timestamp
20 Rake::EARLY
21 end
22 end
23
24 end