From 0eb6d198d3aaddb62b5241a707f6b1fcedfbedb8 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 11 Nov 2015 06:07:55 +0100 Subject: simplifies directories_to_watch --- .../lib/active_support/file_evented_update_checker.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/file_evented_update_checker.rb b/activesupport/lib/active_support/file_evented_update_checker.rb index ca3788a187..8cb422ad36 100644 --- a/activesupport/lib/active_support/file_evented_update_checker.rb +++ b/activesupport/lib/active_support/file_evented_update_checker.rb @@ -72,14 +72,11 @@ module ActiveSupport end def directories_to_watch - bd = [] + dtw = (@files + @dirs.keys).map {|f| @ph.existing_parent(f)} + dtw.compact! + dtw.uniq! - bd.concat @files.map {|f| @ph.existing_parent(f.dirname)} - bd.concat @dirs.keys.map {|dir| @ph.existing_parent(dir)} - bd.compact! - bd.uniq! - - @ph.filter_out_descendants(bd) + @ph.filter_out_descendants(dtw) end class PathHelper -- cgit v1.2.3