diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-05 12:41:09 +0100 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-05 12:41:09 +0100 | 
| commit | 033e518099e4c58c516eaf27ddbd6c10af35b499 (patch) | |
| tree | 66e75438ef5ddd99b63a6501e010504b0967712b | |
| parent | 9b3214d3828570bd1f7357b0550eafdb5390a16d (diff) | |
| download | zorglub-033e518099e4c58c516eaf27ddbd6c10af35b499.zip zorglub-033e518099e4c58c516eaf27ddbd6c10af35b499.tar.gz  | |
haml: use proc on file read
| -rw-r--r-- | lib/zorglub/engines/haml.rb | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/zorglub/engines/haml.rb b/lib/zorglub/engines/haml.rb index 8cfb847..a0353f7 100644 --- a/lib/zorglub/engines/haml.rb +++ b/lib/zorglub/engines/haml.rb @@ -9,9 +9,9 @@ module Zorglub              def self.proc path,obj                  if Zorglub::Config.engines_cache_enabled                      key = path.sub Zorglub::Config.root,'' -                    haml = obj.app.engines_cache[key] ||= ::Haml::Engine.new( File.open(path,'r').read, Zorglub::Config.haml_options ) +                    haml = obj.app.engines_cache[key] ||= ::Haml::Engine.new( File.open(path,'r'){|f| f.read }, Zorglub::Config.haml_options )                  else -                    haml = ::Haml::Engine.new( File.open(path,'r').read, Zorglub::Config.haml_options ) +                    haml = ::Haml::Engine.new( File.open(path,'r'){|f| f.read }, Zorglub::Config.haml_options )                  end                  html = haml.render(obj)                  return html, 'text/html'  | 
