module Observr::EventHandler::Base
Base
functionality mixin, meant to be included in specific event handlers.
@abstract
Public Instance Methods
listen(monitored_paths)
click to toggle source
Begin watching given paths and enter listening loop. Called by the controller.
@param [Array<Pathname>] monitored_paths
list of paths the application is currently monitoring.
@return [undefined]
@abstract
# File lib/observr/event_handlers/base.rb, line 39 def listen(monitored_paths) raise AbstractMethod end
notify(path, event_type = nil)
click to toggle source
Notify that a file was modified.
@param [Pathname, String] path
full path or path relative to current working directory
@param [Symbol] event
event type.
@return [undefined]
# File lib/observr/event_handlers/base.rb, line 25 def notify(path, event_type = nil) changed(true) notify_observers(path, event_type) end
refresh(monitored_paths)
click to toggle source
Called by the controller when the list of paths monitored by wantchr has changed. It should refresh the list of paths being watched.
@param [Array<Pathname>] monitored_paths
list of paths the application is currently monitoring.
@return [undefined]
@abstract
# File lib/observr/event_handlers/base.rb, line 52 def refresh(monitored_paths) raise AbstractMethod end