mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove version conditional for find_template_paths
Now that we only support Ruby 2.2+ we don't need this conditional anymore
This commit is contained in:
parent
36effd916c
commit
dc7ed96adc
1 changed files with 6 additions and 18 deletions
|
@ -196,24 +196,12 @@ module ActionView
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_VERSION >= '2.2.0'
|
def find_template_paths(query)
|
||||||
def find_template_paths(query)
|
Dir[query].reject { |filename|
|
||||||
Dir[query].reject { |filename|
|
File.directory?(filename) ||
|
||||||
File.directory?(filename) ||
|
# deals with case-insensitive file systems.
|
||||||
# deals with case-insensitive file systems.
|
!File.fnmatch(query, filename, File::FNM_EXTGLOB)
|
||||||
!File.fnmatch(query, filename, File::FNM_EXTGLOB)
|
}
|
||||||
}
|
|
||||||
end
|
|
||||||
else
|
|
||||||
def find_template_paths(query)
|
|
||||||
# deals with case-insensitive file systems.
|
|
||||||
sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
|
|
||||||
|
|
||||||
Dir[query].reject { |filename|
|
|
||||||
File.directory?(filename) ||
|
|
||||||
!sanitizer[File.dirname(filename)].include?(filename)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Helper for building query glob string based on resolver's pattern.
|
# Helper for building query glob string based on resolver's pattern.
|
||||||
|
|
Loading…
Reference in a new issue