提交 727ae977 编写于 作者: A Aaron Patterson

use fnmatch to test for case insensitive file systems

this is due to:

  https://bugs.ruby-lang.org/issues/5994
上级 20d5ebfb
......@@ -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|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册