From e688838e5dc4d7f5ed6a2835f7c6e4bf8f3c2d6d Mon Sep 17 00:00:00 2001 From: Colin Kelley Date: Fri, 23 Feb 2024 10:44:02 -0800 Subject: [PATCH] issue #572: switch Kernel.warn and warn to adapter_warn --- lib/listen/adapter.rb | 2 +- lib/listen/adapter/bsd.rb | 2 +- lib/listen/adapter/darwin.rb | 2 +- lib/listen/adapter/windows.rb | 2 +- lib/listen/record/symlink_detector.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/listen/adapter.rb b/lib/listen/adapter.rb index f3083810..dce86236 100644 --- a/lib/listen/adapter.rb +++ b/lib/listen/adapter.rb @@ -36,7 +36,7 @@ def _usable_adapter_class def _warn_polling_fallback(options) msg = options.fetch(:polling_fallback_message, POLLING_FALLBACK_MESSAGE) - Kernel.warn "[Listen warning]:\n #{msg}" if msg + Listen.adapter_warn("[Listen warning]:\n #{msg}") if msg end end end diff --git a/lib/listen/adapter/bsd.rb b/lib/listen/adapter/bsd.rb index 04a6958d..aafa2ceb 100644 --- a/lib/listen/adapter/bsd.rb +++ b/lib/listen/adapter/bsd.rb @@ -34,7 +34,7 @@ def self.usable? require 'find' true rescue LoadError - Kernel.warn BUNDLER_DECLARE_GEM + Listen.adapter_warn(BUNDLER_DECLARE_GEM) false end diff --git a/lib/listen/adapter/darwin.rb b/lib/listen/adapter/darwin.rb index 6106a145..3a610c5d 100644 --- a/lib/listen/adapter/darwin.rb +++ b/lib/listen/adapter/darwin.rb @@ -30,7 +30,7 @@ def self.usable? require 'rb-fsevent' fsevent_version = Gem::Version.new(FSEvent::VERSION) return true if fsevent_version <= Gem::Version.new('0.9.4') - Kernel.warn INCOMPATIBLE_GEM_VERSION + Listen.adapter_warn(INCOMPATIBLE_GEM_VERSION) false end diff --git a/lib/listen/adapter/windows.rb b/lib/listen/adapter/windows.rb index 252cb798..26a64005 100644 --- a/lib/listen/adapter/windows.rb +++ b/lib/listen/adapter/windows.rb @@ -20,7 +20,7 @@ def self.usable? Listen.logger.debug format('wdm - load failed: %s:%s', $ERROR_INFO, $ERROR_POSITION * "\n") - Kernel.warn BUNDLER_DECLARE_GEM + Listen.adapter_warn(BUNDLER_DECLARE_GEM) false end diff --git a/lib/listen/record/symlink_detector.rb b/lib/listen/record/symlink_detector.rb index cce87739..25fe85fe 100644 --- a/lib/listen/record/symlink_detector.rb +++ b/lib/listen/record/symlink_detector.rb @@ -33,7 +33,7 @@ def verify_unwatched!(entry) private def _fail(symlinked, real_path) - warn(format(SYMLINK_LOOP_ERROR, symlinked, real_path)) + Listen.adapter_warn(format(SYMLINK_LOOP_ERROR, symlinked, real_path)) raise ::Listen::Error::SymlinkLoop, 'Failed due to looped symlinks' end end