aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/file_evented_update_checker.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2015-11-11 06:07:55 +0100
committerXavier Noria <fxn@hashref.com>2015-11-11 06:24:34 +0100
commit0eb6d198d3aaddb62b5241a707f6b1fcedfbedb8 (patch)
treefbb4258761a3e7edfa1b045d46a056fbd31f61d3 /activesupport/lib/active_support/file_evented_update_checker.rb
parent59be32b572cdff24da64ca6fd82db53a075c8bb6 (diff)
downloadrails-0eb6d198d3aaddb62b5241a707f6b1fcedfbedb8.tar.gz
rails-0eb6d198d3aaddb62b5241a707f6b1fcedfbedb8.tar.bz2
rails-0eb6d198d3aaddb62b5241a707f6b1fcedfbedb8.zip
simplifies directories_to_watch
Diffstat (limited to 'activesupport/lib/active_support/file_evented_update_checker.rb')
-rw-r--r--activesupport/lib/active_support/file_evented_update_checker.rb11
1 files changed, 4 insertions, 7 deletions
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