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:45:43 -0700 |
commit | 727ae97793906926fe0e87ec2f105fa47fd6d783 (patch) | |
tree | c13f7c2f298e45273272fd752cc29447ee6d4c30 /actionview/lib/action_view/template | |
parent | 20d5ebfb80ab68f0b1d6e0ff25132bf97a2fc546 (diff) | |
download | rails-727ae97793906926fe0e87ec2f105fa47fd6d783.tar.gz rails-727ae97793906926fe0e87ec2f105fa47fd6d783.tar.bz2 rails-727ae97793906926fe0e87ec2f105fa47fd6d783.zip |
use fnmatch to test for case insensitive file systems
this is due to:
https://bugs.ruby-lang.org/issues/5994
Diffstat (limited to 'actionview/lib/action_view/template')
-rw-r--r-- | actionview/lib/action_view/template/resolver.rb | 6 |
1 files 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 @@ 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| |