class Autorespawn::TrackedFile

Attributes

mtime[R]
path[R]
size[R]
slaves[R]

Public Class Methods

new(path, mtime: nil, size: nil) click to toggle source
# File lib/autorespawn/tracked_file.rb, line 5
def initialize(path, mtime: nil, size: nil)
    @path  = path
    @mtime = mtime
    @size  = size
    @slaves = Array.new
end

Public Instance Methods

update() click to toggle source
# File lib/autorespawn/tracked_file.rb, line 12
def update
    return true if !path.exist?
    return true if !mtime

    stat = path.stat
    if stat.mtime != mtime || stat.size != size
        @mtime = stat.mtime
        @size  = stat.size
        true
    end
end