From 03e016f22aaebf09dc11a44f46598b4357b30de3 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 9 May 2014 14:45:43 -0700 Subject: use fnmatch to test for case insensitive file systems this is due to: https://bugs.ruby-lang.org/issues/5994 --- actionpack/lib/action_view/template/resolver.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_view/template/resolver.rb') 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| -- cgit v1.2.3