Skip to content

Commit

Permalink
Pass the directory of the modified inotify file.
Browse files Browse the repository at this point in the history
This is a temporary workaround for a bug in the directory handler
that expects all #refresh calls to path in directory paths.
  • Loading branch information
nex3 committed Feb 6, 2010
1 parent dcd5c55 commit 9528c5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fssm/backends/inotify.rb
Expand Up @@ -7,7 +7,9 @@ def initialize
def add_handler(handler, preload=true)
@notifier.watch(handler.path.to_s, :attrib, :modify, :create,
:delete, :delete_self, :moved_from, :moved_to, :move_self) do |event|
handler.refresh(FSSM::Pathname.for(event.absolute_name))
path = FSSM::Pathname.for(event.absolute_name)
path = path.dirname unless event.name == "" # Event on root directory
handler.refresh(path)
end

handler.refresh(nil, true) if preload
Expand Down

0 comments on commit 9528c5c

Please sign in to comment.