/usr/share/doc/ruby-fssm/README.markdown is in ruby-fssm 0.2.10-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | # FSSM - currently unmaintained #
Monitor API
===========
There are three ways you can run the monitor.
1. call monitor with a path parameter, and define callbacks in a block
2. call monitor with a block to configure multiple paths and callbacks
3. create a monitor object and run each step manually
Monitor with path
-----------------
This form watches one path, and enters the run loop automatically. The first parameter is the path to watch, and the second parameter is an optional glob pattern or array of glob patterns that a file must match in order to trigger a callback. The default glob, if ommitted, is `'**/*'`.
FSSM.monitor('/some/directory/', '**/*') do
update {|base, relative|}
delete {|base, relative|}
create {|base, relative|}
end
Monitor with block
------------------
This form watches one or more paths, and enters the run loop automatically. The glob configuration call can be ommitted, and defaults to `'**/*'`.
FSSM.monitor do
path '/some/directory/' do
glob '**/*.yml'
update {|base, relative|}
delete {|base, relative|}
create {|base, relative|}
end
path '/some/other/directory/' do
update {|base, relative|}
delete {|base, relative|}
create {|base, relative|}
end
end
Monitor object
--------------
This form doesn't enter the run loop automatically.
monitor = FSSM::Monitor.new
monitor.path '/some/directory/' do
update {|base, relative|}
delete {|base, relative|}
create {|base, relative|}
end
monitor.run
Monitoring directories
----------------------
By default, FSSM monitors changes in files only. To enable monitoring of files and directories, pass option `directories => true` in a hash to the monitor. Please note that this may not work as expected in all backends. For example:
FSSM::Monitor.new(:directories => true)
FSSM.monitor(dir, file_glob, :directories => true)
When directories are monitored, there's an additional third argument to the callbacks. Instead of
FSSM.monitor('/some/directory/', '**/*') do
update {|base, relative|}
delete {|base, relative|}
create {|base, relative|}
end
you get this:
FSSM.monitor('/some/directory/', '**/*', :directories => true) do
update {|base, relative, type|}
delete {|base, relative, type|}
create {|base, relative, type|}
end
The value of `type` argument is either `:file` or `:directory`.
|