From c763be7c97973fa0dd296fd895d4704dcd4734b1 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Mon, 3 Jun 2019 17:53:18 -0700 Subject: Don't call listen with empty directory list Listen interprets an empty list of directories as "watch the current directory". Since EventedFileUpdateChecker doesn't share these semantics, we should not initialize listen if we end up with an empty directory list. --- activesupport/lib/active_support/evented_file_update_checker.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/evented_file_update_checker.rb b/activesupport/lib/active_support/evented_file_update_checker.rb index 84caa00b58..5a79822c49 100644 --- a/activesupport/lib/active_support/evented_file_update_checker.rb +++ b/activesupport/lib/active_support/evented_file_update_checker.rb @@ -108,7 +108,10 @@ module ActiveSupport private def boot! normalize_dirs! - Listen.to(*@dtw, &method(:changed)).start + + unless @dtw.empty? + Listen.to(*@dtw, &method(:changed)).start + end end def shutdown! -- cgit v1.2.3