Class: FunWith::Files::Watchers::MissingWatcher
- Inherits:
-
NodeWatcher
- Object
- NodeWatcher
- FunWith::Files::Watchers::MissingWatcher
- Defined in:
- lib/fun_with/files/watchers/missing_watcher.rb
Overview
Watches a path where nothing currently exists, and reports a change if something appears there.
Instance Attribute Summary
Attributes inherited from NodeWatcher
Instance Method Summary collapse
- #all_paths ⇒ Object
-
#initialize(path) ⇒ MissingWatcher
constructor
A new instance of MissingWatcher.
-
#update ⇒ Object
The fact that the watcher now needs to be replaced with a File/DirectoryWatcher must be handled elsewhere.
Methods inherited from NodeWatcher
#create_watchers, #new_changeset, #set_path
Constructor Details
#initialize(path) ⇒ MissingWatcher
Returns a new instance of MissingWatcher.
7 8 9 |
# File 'lib/fun_with/files/watchers/missing_watcher.rb', line 7 def initialize( path ) set_path( path ) end |
Instance Method Details
#all_paths ⇒ Object
17 18 19 |
# File 'lib/fun_with/files/watchers/missing_watcher.rb', line 17 def all_paths [] end |
#update ⇒ Object
The fact that the watcher now needs to be replaced with a File/DirectoryWatcher must be handled elsewhere.
13 14 15 |
# File 'lib/fun_with/files/watchers/missing_watcher.rb', line 13 def update self.path.exist? ? {self.path => :created } : {} end |