Class: FSSM::Backends::Inotify

### Home Classes Methods

### In Files

- lib/fssm/backends/inotify.rb

### Parent

Object

### Methods

- ::new
- #add_handler
- #run

### Class/Module Index

Quicksearch

- FSSM
- FSSM::Backends
- FSSM::Backends::Inotify
- FSSM::Backends::Polling
- FSSM::Backends::RBFSEvent
- FSSM::Monitor
- FSSM::Path
- FSSM::Pathname
- FSSM::State
- FSSM::State::Directory
- FSSM::State::File
- FSSM::Support
- FSSM::Tree
- FSSM::Tree::Cache
- FSSM::Tree::CacheDebug
- FSSM::Tree::Node
- FSSM::Tree::NodeBase
- FSSM::Tree::NodeEnumerable
- FSSM::Tree::NodeInsertion

No matching classes.

# FSSM::Backends::Inotify

### Public Class Methods

new() click to toggle source

    # File lib/fssm/backends/inotify.rb, line 3
    def initialize
      @notifier = INotify::Notifier.new
    end

### Public Instance Methods

add_handler(handler, preload=true) click to toggle source

    # File lib/fssm/backends/inotify.rb, line 7
    def add_handler(handler, preload=true)
      @notifier.watch(handler.path.to_s, :recursive, :attrib, :close_write, :create,
                      :delete, :delete_self, :moved_from, :moved_to, :move_self) do |event|
        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
    end

run() click to toggle source

    # File lib/fssm/backends/inotify.rb, line 18
    def run
      begin
        @notifier.run
      rescue Interrupt
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.