Class: GHPreview::Watcher
- Inherits:
-
Object
- Object
- GHPreview::Watcher
- Defined in:
- lib/ghpreview/watcher.rb
Class Method Summary collapse
Class Method Details
.watch(filepath) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ghpreview/watcher.rb', line 5 def self.watch(filepath) yield filename = File.basename(filepath) dirname = File.dirname(File.(filepath)) Listen.to(dirname, filter: /#{filename}$/) do |modified| yield end end |