I have a simple FSSM (File System State Monitor) script setup to watch some files and do some things with them when they are changed. It's woking great.
However, I want it to process any files it has an update handler for when I boot my script. As it is now, if I make edits to files before I start the script then my edits arent picked up until I save the file again. And in a project with dozens of files being watched, that is less than ideal.
So how make FSSM process every file it is configured to watch when my script launches?
A snippet of what I have now:
monitor = FSSM::Monitor.new
monitor.path '.' do
glob '**/*.coffee'
update do |base, relative|
coffee base, relative
end
delete do |base, relative|
remove base, relative
end
end
monitor.run
I'd like it to run the update clause on launch so that any files edited while they were not being watched would get immediately processed.