Parent

Class/Module Index [+]

Quicksearch

PhusionPassenger::Utils::FileSystemWatcher

Attributes

poll_interval[RW]

Public Class Methods

new(filenames, termination_pipe = nil) click to toggle source
# File lib/phusion_passenger/utils/file_system_watcher.rb, line 81
def initialize(filenames, termination_pipe = nil)
        @poll_interval = 3
        @termination_pipe = termination_pipe
        @dirs  = []
        @files = []

        begin
                filenames.each do |filename|
                        stat = File.stat(filename)
                        if stat.directory?
                                @dirs << DirInfo.new(filename, stat)
                        else
                                @files << FileInfo.new(filename, stat)
                        end
                end
        rescue Errno::EACCES, Errno::ENOENT
                @dirs = @files = nil
        end
end
opens_files?() click to toggle source
# File lib/phusion_passenger/utils/file_system_watcher.rb, line 77
def self.opens_files?
        return false
end

Public Instance Methods

close() click to toggle source
# File lib/phusion_passenger/utils/file_system_watcher.rb, line 115
def close
end
wait_for_change() click to toggle source
# File lib/phusion_passenger/utils/file_system_watcher.rb, line 101
def wait_for_change
        if !@dirs
                return false
        end
        
        while true
                if changed?
                        return true
                elsif select([@termination_pipe], nil, nil, @poll_interval)
                        return nil
                end
        end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.