Sha256: 7ee3202397eca912b22679879f45e8cf5cdb1c6a7ca82fabe9b62b03b169cdac

Contents?: true

Size: 508 Bytes

Versions: 11

Compression:

Stored size: 508 Bytes

Contents

require 'eventmachine-tail'

module RemoteSyslog
  class GlobWatch < EventMachine::FileGlobWatch
    def initialize(path, interval, exclude_files, callback)
      @exclude_files = exclude_files
      @callback = callback

      super(path, interval)
    end

    def file_found(path)
      # Check if we should exclude this file
      if @exclude_files && @exclude_files =~ path
        return
      end

      @callback.call(path)
    end

    def file_deleted(path)
      # Nothing to do
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
remote_syslog-1.6.15 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.14 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.13 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.12 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.11 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.10 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.9 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.8 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.7.2 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.7.1 lib/remote_syslog/glob_watch.rb
remote_syslog-1.6.7.pre1 lib/remote_syslog/glob_watch.rb