Class: Octodown::Support::Services::Riposter
- Inherits:
-
Object
- Object
- Octodown::Support::Services::Riposter
- Defined in:
- lib/octodown/support/services/riposter.rb
Class Method Summary collapse
Class Method Details
.call(file, &listener_callback) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/octodown/support/services/riposter.rb', line 5 def self.call(file, &listener_callback) require 'listen' path = File.dirname(File.(file.path)) regex = Regexp.new(file.path) @listener ||= Listen.to(path, only: regex) do listener_callback.call end @listener.start end |