Method: Rake::FileTask#needed?

Defined in:
lib/rake/file_task.rb

#needed?Boolean

Is this file task needed? Yes if it doesn’t exist, or if its time stamp is out of date.

Returns:

  • (Boolean)


16
17
18
19
20
21
22
# File 'lib/rake/file_task.rb', line 16

def needed?
  begin
    out_of_date?(File.mtime(name)) || @application.options.build_all
  rescue Errno::ENOENT
    true
  end
end