diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-05 15:35:10 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-05 15:35:10 +0100 |
commit | b3cdcc68ca8a7831855d0c87f82006f73041c86f (patch) | |
tree | 7f42e4ab583e923de36484434c322d8ab164fd23 /lib | |
parent | 1aea99de0ec1d14a7637d66789714422908720f6 (diff) | |
download | zorglub-b3cdcc68ca8a7831855d0c87f82006f73041c86f.zip zorglub-b3cdcc68ca8a7831855d0c87f82006f73041c86f.tar.gz |
add file engine
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zorglub/engines/file.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/zorglub/engines/file.rb b/lib/zorglub/engines/file.rb new file mode 100644 index 0000000..fd9fe1e --- /dev/null +++ b/lib/zorglub/engines/file.rb @@ -0,0 +1,20 @@ +# -*- coding: UTF-8 -*- +# +require 'haml/util' +require 'haml/engine' +# +module Zorglub + module Engines + module File + def self.proc path,obj + content = ::File.open(path,'r'){|f| f.read } + ext = path.sub /.*\.(.+)$/,'\1' + return content, "text/#{ext}" + end + end + end +end +# +Zorglub::Config.register_engine :file, nil, Zorglub::Engines::File.method(:proc) +# +# EOF |