1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

remove dead file_watcher code

This commit is contained in:
Gregory Ostermayr 2014-08-07 16:19:20 -04:00
parent 69adfc9de6
commit 6c9669e8f0

View file

@ -1,36 +0,0 @@
module ActiveSupport
class FileWatcher
class Backend
def initialize(path, watcher)
@watcher = watcher
@path = path
end
def trigger(files)
@watcher.trigger(files)
end
end
def initialize
@regex_matchers = {}
end
def watch(pattern, &block)
@regex_matchers[pattern] = block
end
def trigger(files)
trigger_files = Hash.new { |h,k| h[k] = Hash.new { |h2,k2| h2[k2] = [] } }
files.each do |file, state|
@regex_matchers.each do |pattern, block|
trigger_files[block][state] << file if pattern === file
end
end
trigger_files.each do |block, payload|
block.call payload
end
end
end
end