Permalink
Browse files

use binread to read the files

  • Loading branch information...
1 parent 681bf1f commit 0155bf4021e34c70b3b88eaf75ce41e1140fe474 @tenderlove tenderlove committed Aug 9, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 actionpack/lib/action_view/template/resolver.rb
@@ -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 @@ def query(path, details, formats)
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))

0 comments on commit 0155bf4

Please sign in to comment.