Permalink
Browse files

Rakefile: Force templates to ASCII-8BIT for ERB

  • Loading branch information...
1 parent dd5ff22 commit 49ac20aa8f7039e2206705dd9a765e2975b1c060 @runpaint runpaint committed May 6, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 Rakefile
View
@@ -19,8 +19,8 @@ TEMPLATE_WRAPPER = 'page.html'
TEMPLATE_NO_WRAP = [TEMPLATE_WRAPPER, 'atom.atom', 'comment.html']
def template(filename,hash)
- content = ERB.new(File.open(File.join(TEMPLATES_DIR,filename)).read).
- result(OpenStruct.new(hash).bind)
+ source = File.open(File.join(TEMPLATES_DIR,filename)).read.force_encoding('binary')
+ content = ERB.new(source).result(OpenStruct.new(hash).bind)
return content if TEMPLATE_NO_WRAP.include? filename
template(TEMPLATE_WRAPPER, {:content => content}.merge(hash))
end

0 comments on commit 49ac20a

Please sign in to comment.