From 727ae97793906926fe0e87ec2f105fa47fd6d783 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 9 May 2014 14:45:43 -0700 Subject: [PATCH] use fnmatch to test for case insensitive file systems this is due to: https://bugs.ruby-lang.org/issues/5994 --- actionview/lib/action_view/template/resolver.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/actionview/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb index 05f0c301e7..dbfabef15d 100644 --- a/actionview/lib/action_view/template/resolver.rb +++ b/actionview/lib/action_view/template/resolver.rb @@ -181,12 +181,10 @@ def find_templates(name, prefix, partial, details) 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| -- GitLab