PHP 8.2.31
Preview: file_task.rb Size: 1.50 KB
//proc/thread-self/root/opt/alt/ruby27/share/gems/gems/rake-13.0.1/lib/rake/file_task.rb

# frozen_string_literal: true
require "rake/task"
require "rake/early_time"

module Rake

  # A FileTask is a task that includes time based dependencies.  If any of a
  # FileTask's prerequisites have a timestamp that is later than the file
  # represented by this task, then the file must be rebuilt (using the
  # supplied actions).
  #
  class FileTask < Task

    # Is this file task needed?  Yes if it doesn't exist, or if its time stamp
    # is out of date.
    def needed?
      !File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all
    end

    # Time stamp for file task.
    def timestamp
      if File.exist?(name)
        File.mtime(name.to_s)
      else
        Rake::LATE
      end
    end

    private

    # Are there any prerequisites with a later time than the given time stamp?
    def out_of_date?(stamp)
      all_prerequisite_tasks.any? { |prereq|
        prereq_task = application[prereq, @scope]
        if prereq_task.instance_of?(Rake::FileTask)
          prereq_task.timestamp > stamp || @application.options.build_all
        else
          prereq_task.timestamp > stamp
        end
      }
    end

    # ----------------------------------------------------------------
    # Task class methods.
    #
    class << self
      # Apply the scope to the task name according to the rules for this kind
      # of task.  File based tasks ignore the scope when creating the name.
      def scope_name(scope, task_name)
        Rake.from_pathname(task_name)
      end
    end
  end
end

Directory Contents

Dirs: 2 × Files: 39

Name Size Perms Modified Actions
ext DIR
- drwxr-xr-x 2024-03-03 22:50:49
Edit Download
loaders DIR
- drwxr-xr-x 2024-03-03 22:50:49
Edit Download
24.53 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
896 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
2.03 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
448 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
2.33 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
265 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
5.48 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
370 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
699 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
12.45 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
1.50 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
3.82 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
3.84 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
1.19 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
461 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
295 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
2.77 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
345 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
702 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
6.02 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
381 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
394 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
2.28 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
405 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
1.49 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
505 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
382 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
898 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
12.74 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
165 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
2.41 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
149 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
10.01 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
6.00 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
1.13 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
4.67 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download
575 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
208 B lrw-r--r-- 2023-03-30 12:34:10
Edit Download
1.52 KB lrw-r--r-- 2023-03-30 12:34:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).