Skip to content

Commit

Permalink
Rakefile: Force templates to ASCII-8BIT for ERB
Browse files Browse the repository at this point in the history
  • Loading branch information
runpaint committed May 6, 2010
1 parent dd5ff22 commit 49ac20a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Expand Up @@ -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
Expand Down

0 comments on commit 49ac20a

Please sign in to comment.