Sha256: f08ac559979abf082afaba8ba08da82743763c3207e45840b2c3b15989bba2a5

Contents?: true

Size: 458 Bytes

Versions: 3

Compression:

Stored size: 458 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'rb-inotify'

folders = Array.new
notifier = INotify::Notifier.new

notifier.watch(ARGV.first || '.', :modify, :recursive) do |event|
  dir = File.expand_path(File.dirname(event.absolute_name)) + '/'
  if !folders.include?(dir)
    folders << dir
  end
end

while true do
  notifier.process
  
  if !folders.empty?
    $stdout.puts folders.join(' ')
    $stdout.flush
    folders.clear
  end
  
  sleep(0.5)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspactor-0.7.0.beta.6 bin/inotify_watch
rspactor-0.7.0.beta.5 bin/inotify_watch
rspactor-0.7.0.beta.4 bin/inotify_watch