Sha256: ad9c3bc0c575975ebf3f3283eb5c8e6564347f4488e6f538d06960a25ba13427

Contents?: true

Size: 458 Bytes

Versions: 4

Compression:

Stored size: 458 Bytes

Contents

module Bluepill
  module ProcessConditions
    class FileTime < ProcessCondition
      def initialize(options = {})
        @below = options[:below]
        @filename = options[:filename]
      end

      def run(_pid, _include_children)
        Time.now - File.mtime(@filename) if File.exist?(@filename)
      rescue
        $ERROR_INFO
      end

      def check(value)
        return false if value.nil?
        value < @below
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bluepill-0.1.3 lib/bluepill/process_conditions/file_time.rb
bluepill-0.1.2 lib/bluepill/process_conditions/file_time.rb
bluepill-0.1.1 lib/bluepill/process_conditions/file_time.rb
bluepill-0.0.70 lib/bluepill/process_conditions/file_time.rb