aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-03-15 13:19:23 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-03-15 13:29:14 -0700
commitdbfe5c6ac4431c50293183f4561150e6c2ce43ad (patch)
tree92aeeef627dddae7b17a7f2f8e9df97c9f3d9465 /activesupport/lib/active_support
parent1cdc6c6576afe9a9fa67a6b313080a7dc62188d9 (diff)
downloadrails-dbfe5c6ac4431c50293183f4561150e6c2ce43ad.tar.gz
rails-dbfe5c6ac4431c50293183f4561150e6c2ce43ad.tar.bz2
rails-dbfe5c6ac4431c50293183f4561150e6c2ce43ad.zip
Match evented checker behavior on dir with no exts
When FileUpdateChecker is passed a directory and given an empty array of extensions to match on, it will match any extension. Previously, EventedFileUpdateChecker would never match any files when given an empty array. This commit makes it EventedFileUpdateChecker match FileUpdateChecker, and watch all extensions when given an empty array.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/evented_file_update_checker.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/evented_file_update_checker.rb b/activesupport/lib/active_support/evented_file_update_checker.rb
index 54bc5c0ae5..3893b0de0e 100644
--- a/activesupport/lib/active_support/evented_file_update_checker.rb
+++ b/activesupport/lib/active_support/evented_file_update_checker.rb
@@ -131,7 +131,9 @@ module ActiveSupport
ext = @ph.normalize_extension(file.extname)
file.dirname.ascend do |dir|
- if @dirs.fetch(dir, []).include?(ext)
+ matching = @dirs[dir]
+
+ if matching && (matching.empty? || matching.include?(ext))
break true
elsif dir == @lcsp || dir.root?
break false