Permalink
Browse files

use fnmatch to test for case insensitive file systems

  • Loading branch information...
1 parent 20d5ebf commit 727ae97793906926fe0e87ec2f105fa47fd6d783 @tenderlove tenderlove committed May 9, 2014
Showing with 2 additions and 4 deletions.
  1. +2 −4 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|

1 comment on commit 727ae97

Member

arthurnn commented on 727ae97 May 10, 2014

File::FNM_EXTGLOB wont work on 1.9.3 =(

Please sign in to comment.