From 187aaabed45262c49799c311b5da918613014afb Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Fri, 18 Nov 2016 23:47:23 +0100 Subject: [PATCH] Don't require rb-fsevent until actually needed rb-fsevent is used only on macOS. If you somehow exclude it from dependencies on other platforms, for example to avoid unnecessary complications with building native extensions, then "listen" fails to start just because it's required before checked that it's not usable on the current platform. This patch fixes this error. See also #416 --- lib/listen/adapter/darwin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/listen/adapter/darwin.rb b/lib/listen/adapter/darwin.rb index d65779f4..4a1e98b7 100644 --- a/lib/listen/adapter/darwin.rb +++ b/lib/listen/adapter/darwin.rb @@ -22,11 +22,11 @@ class Darwin < Base EOS def self.usable? - require 'rb-fsevent' version = RbConfig::CONFIG['target_os'][OS_REGEXP, :major_version] return false unless version return true if version.to_i >= 13 # darwin13 is OS X 10.9 + 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