lib/action_view/template/resolver.rb in actionpack-3.0.0.beta3 vs lib/action_view/template/resolver.rb in actionpack-3.0.0.beta4
- old
+ new
@@ -68,10 +68,13 @@
query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << ',}'
end
Dir[query].reject { |p| File.directory?(p) }.map do |p|
handler, format = extract_handler_and_format(p, formats)
- Template.new(File.read(p), File.expand_path(p), handler,
+
+ contents = File.open(p, "rb") {|io| io.read }
+
+ Template.new(contents, File.expand_path(p), handler,
:virtual_path => path, :format => format)
end
end
# Extract handler and formats from path. If a format cannot be a found neither