Permalink
Browse files

use fnmatch to test for case insensitive file systems

  • Loading branch information...
1 parent 5c09373 commit 6901012675163b4844a605a24a7359b2615b3aa9 @tenderlove tenderlove committed May 9, 2014
Showing with 2 additions and 4 deletions.
  1. +2 −4 actionpack/lib/action_view/template/resolver.rb
@@ -180,12 +180,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|

0 comments on commit 6901012

Please sign in to comment.