aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-04 15:02:47 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-04 15:54:21 -0300
commitdc7ed96adc4e0b4c8a2cc524bbfc7172c007ca74 (patch)
tree41c489d98cc6c913e771a9ca16084134c1d4d221 /actionview/lib
parent36effd916c1f372ae94bcff54e947050538aa12d (diff)
downloadrails-dc7ed96adc4e0b4c8a2cc524bbfc7172c007ca74.tar.gz
rails-dc7ed96adc4e0b4c8a2cc524bbfc7172c007ca74.tar.bz2
rails-dc7ed96adc4e0b4c8a2cc524bbfc7172c007ca74.zip
Remove version conditional for find_template_paths
Now that we only support Ruby 2.2+ we don't need this conditional anymore
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/template/resolver.rb24
1 files changed, 6 insertions, 18 deletions
diff --git a/actionview/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb
index 7fc14b89ee..bc0db330ea 100644
--- a/actionview/lib/action_view/template/resolver.rb
+++ b/actionview/lib/action_view/template/resolver.rb
@@ -196,24 +196,12 @@ module ActionView
}
end
- if RUBY_VERSION >= '2.2.0'
- def find_template_paths(query)
- Dir[query].reject { |filename|
- File.directory?(filename) ||
- # deals with case-insensitive file systems.
- !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
+ def find_template_paths(query)
+ Dir[query].reject { |filename|
+ File.directory?(filename) ||
+ # deals with case-insensitive file systems.
+ !File.fnmatch(query, filename, File::FNM_EXTGLOB)
+ }
end
# Helper for building query glob string based on resolver's pattern.