1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use already defined Encoding constant rather than freezing a String

This commit is contained in:
Akira Matsuda 2017-01-11 16:24:04 +09:00
parent f5ec52d4af
commit efb935a5da

View file

@ -33,7 +33,7 @@ module ActionDispatch
paths = [path, "#{path}#{ext}", "#{path}/#{@index}#{ext}"]
if match = paths.detect { |p|
path = File.join(@root, p.force_encoding("UTF-8".freeze))
path = File.join(@root, p.force_encoding(Encoding::UTF_8))
begin
File.file?(path) && File.readable?(path)
rescue SystemCallError