Class: Crabfarm::Live::Watcher
- Inherits:
-
Object
- Object
- Crabfarm::Live::Watcher
- Defined in:
- lib/crabfarm/live/watcher.rb
Constant Summary collapse
- PATH_RGX =
/^\/[^\/]+\/(.*?)\.rb$/i
Instance Method Summary collapse
-
#initialize(_controller) ⇒ Watcher
constructor
A new instance of Watcher.
- #watch(_sleep) ⇒ Object
Constructor Details
#initialize(_controller) ⇒ Watcher
Returns a new instance of Watcher.
9 10 11 12 |
# File 'lib/crabfarm/live/watcher.rb', line 9 def initialize(_controller) @controller = _controller @candidates = nil end |
Instance Method Details
#watch(_sleep) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/crabfarm/live/watcher.rb', line 14 def watch(_sleep) begin start_listener loop do execute_pending sleep _sleep end ensure stop_listener end end |