mirror of
https://github.com/github/rails.git
synced 2026-01-09 14:48:01 -05:00
use fnmatch to test for case insensitive file systems
this is due to: https://bugs.ruby-lang.org/issues/5994
This commit is contained in:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user