Class: Cruise::Watcher
- Inherits:
-
Object
- Object
- Cruise::Watcher
- Defined in:
- lib/cruise/watcher.rb,
ext/cruise/cruise.c
Instance Method Summary collapse
-
#close ⇒ Object
watcher.close.
-
#initialize(*paths, glob: nil, debounce: DEFAULT_DEBOUNCE, only: nil) ⇒ Watcher
constructor
A new instance of Watcher.
-
#io ⇒ Object
watcher.io.
-
#poll ⇒ Object
watcher.poll.
Constructor Details
#initialize(*paths, glob: nil, debounce: DEFAULT_DEBOUNCE, only: nil) ⇒ Watcher
Returns a new instance of Watcher.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cruise/watcher.rb', line 5 def initialize(*paths, glob: nil, debounce: DEFAULT_DEBOUNCE, only: nil) paths = paths.flatten.grep(String) raise ArgumentError, "Cruise::Watcher requires at least one path" if paths.empty? glob_patterns = glob ? Array(glob) : [] only_kinds = only ? Array(only).map(&:to_s) : [] initialize_native(paths, debounce.to_f, glob_patterns, only_kinds) end |
Instance Method Details
#close ⇒ Object
watcher.close
130 131 132 |
# File 'ext/cruise/cruise.c', line 130 def close raise NotImplementedError, "Cruise::Watcher#close is provided by the native extension" end |
#io ⇒ Object
watcher.io
106 107 108 |
# File 'ext/cruise/cruise.c', line 106 def io raise NotImplementedError, "Cruise::Watcher#io is provided by the native extension" end |
#poll ⇒ Object
watcher.poll
111 112 113 |
# File 'ext/cruise/cruise.c', line 111 def poll raise NotImplementedError, "Cruise::Watcher#poll is provided by the native extension" end |