method
new
v8.1.1 -
Show latest stable
- Class:
ActiveSupport::EventedFileUpdateChecker::Core
new(files, dirs)public
No documentation available.
# File activesupport/lib/active_support/evented_file_update_checker.rb, line 75
def initialize(files, dirs)
gem_paths = Gem.path
files = files.map { |f| Pathname(f).expand_path }
files.reject! { |f| f.to_s.start_with?(*gem_paths) }
@files = files.to_set
@dirs = dirs.each_with_object({}) do |(dir, exts), hash|
next if dir.start_with?(*gem_paths)
hash[Pathname(dir).expand_path] = Array(exts).map { |ext| ext.to_s.sub(/\A\.?/, ".") }.to_set
end
@common_path = common_path(@dirs.keys)
@dtw = directories_to_watch
@missing = []
@updated = Concurrent::AtomicBoolean.new(false)
@mutex = Mutex.new
start
# inotify / FSEvents file descriptors are inherited on fork, so
# we need to reopen them otherwise only the parent or the child
# will be notified.
# FIXME: this callback is keeping a reference on the instance
@after_fork = ActiveSupport::ForkTracker.after_fork { start }
end