Sha256: 9194d542eb7a45bbecafdfe3205a495f836435fdc8301967a22aa07dd66b79b0
Contents?: true
Size: 895 Bytes
Versions: 11
Compression:
Stored size: 895 Bytes
Contents
require 'listen/file' require 'listen/directory' module Listen class Change include Celluloid attr_accessor :listener def initialize(listener) @listener = listener end def change(path, options) return if _silencer.silenced?(path) if change = options[:change] _notify_listener(change, path) else send("_#{options[:type].downcase}_change", path, options) end end private def _file_change(path, options) change = File.new(path).change if change && listener.listen? && !options[:silence] _notify_listener(change, path) end end def _dir_change(path, options) Directory.new(path, options).scan end def _notify_listener(change, path) listener.changes << { change => path } end def _silencer Celluloid::Actor[:listen_silencer] end end end
Version data entries
11 entries across 11 versions & 1 rubygems