Skip to content

Commit dc7ed96

Browse files
committed
Remove version conditional for find_template_paths
Now that we only support Ruby 2.2+ we don't need this conditional anymore
1 parent 36effd9 commit dc7ed96

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

actionview/lib/action_view/template/resolver.rb

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,24 +196,12 @@ def query(path, details, formats)
196196
}
197197
end
198198

199-
if RUBY_VERSION >= '2.2.0'
200-
def find_template_paths(query)
201-
Dir[query].reject { |filename|
202-
File.directory?(filename) ||
203-
# deals with case-insensitive file systems.
204-
!File.fnmatch(query, filename, File::FNM_EXTGLOB)
205-
}
206-
end
207-
else
208-
def find_template_paths(query)
209-
# deals with case-insensitive file systems.
210-
sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
211-
212-
Dir[query].reject { |filename|
213-
File.directory?(filename) ||
214-
!sanitizer[File.dirname(filename)].include?(filename)
215-
}
216-
end
199+
def find_template_paths(query)
200+
Dir[query].reject { |filename|
201+
File.directory?(filename) ||
202+
# deals with case-insensitive file systems.
203+
!File.fnmatch(query, filename, File::FNM_EXTGLOB)
204+
}
217205
end
218206

219207
# Helper for building query glob string based on resolver's pattern.

0 commit comments

Comments
 (0)