File: example.rb

package info (click to toggle)
ruby-fssm 0.2.10-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 364 kB
  • ctags: 214
  • sloc: ruby: 1,082; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 282 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
begin
  require 'rb-inotify'
rescue LoadError
  puts "Cannot load rb-inotify"
end

require 'fssm'

FSSM.monitor('.', '**/*') do
  update { |b, r| puts "Update in #{b} to #{r}" }
  delete { |b, r| puts "Delete in #{b} to #{r}" }
  create { |b, r| puts "Create in #{b} to #{r}" }
end