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

use binread to read the files

This commit is contained in:
Aaron Patterson 2011-08-08 19:51:41 -07:00
parent 681bf1fc48
commit 0155bf4021

View file

@ -1,5 +1,6 @@
require "pathname"
require "active_support/core_ext/class"
require "active_support/core_ext/io"
require "action_view/template"
module ActionView
@ -137,7 +138,7 @@ module ActionView
next if File.directory?(p) || !sanitizer[p].include?(p)
handler, format = extract_handler_and_format(p, formats)
contents = File.open(p, "rb") { |io| io.read }
contents = File.binread p
templates << Template.new(contents, File.expand_path(p), handler,
:virtual_path => path.virtual, :format => format, :updated_at => mtime(p))