From c1facc5a48d3b7ba1477bed276dd6a83af56999d Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 22 Nov 2023 11:07:56 +0100 Subject: [PATCH] Bring back `Spring::Watcher::Abstract#synchronize` Fix: https://github.com/rails/spring-watcher-listen/issues/36 --- CHANGELOG.md | 2 ++ lib/spring/watcher/abstract.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 460d737f..f2e35a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Next Release +* Bring back `Spring::Watcher::Abstract#synchronize` method to fix compatibility with `spring-watcher-listen`. + ## 4.1.2 * Drop dependency on `mutex_m`. Avoid issues with loading the wrong version before bundler kicks in. diff --git a/lib/spring/watcher/abstract.rb b/lib/spring/watcher/abstract.rb index 0f7b4406..42fb3382 100644 --- a/lib/spring/watcher/abstract.rb +++ b/lib/spring/watcher/abstract.rb @@ -22,6 +22,11 @@ def initialize(root, latency) @on_debug = nil end + def synchronize(&block) + # Used by some gems. + @mutex.synchronize(&block) + end + def on_debug(&block) @on_debug = block end