diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-09 14:45:43 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-09 14:46:46 -0700 |
commit | 03e016f22aaebf09dc11a44f46598b4357b30de3 (patch) | |
tree | 68d9adf26d88f48cef183d9016f750095c9417eb /actionpack/lib/action_view/template/resolver.rb | |
parent | bbec7d72bed585d24f3d0d827b4911e30a887708 (diff) | |
download | rails-03e016f22aaebf09dc11a44f46598b4357b30de3.tar.gz rails-03e016f22aaebf09dc11a44f46598b4357b30de3.tar.bz2 rails-03e016f22aaebf09dc11a44f46598b4357b30de3.zip |
use fnmatch to test for case insensitive file systems
this is due to:
https://bugs.ruby-lang.org/issues/5994
Diffstat (limited to 'actionpack/lib/action_view/template/resolver.rb')
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index f855ea257c..51dd07a02f 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -120,12 +120,10 @@ module ActionView def query(path, details, formats) query = build_query(path, details) - # deals with case-insensitive file systems. - sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] } - template_paths = Dir[query].reject { |filename| File.directory?(filename) || - !sanitizer[File.dirname(filename)].include?(filename) + # deals with case-insensitive file systems. + !File.fnmatch(query, filename, File::FNM_EXTGLOB) } template_paths.map { |template| |