summaryrefslogtreecommitdiffstats
path: root/lib/zorglub/engines/file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zorglub/engines/file.rb')
-rw-r--r--lib/zorglub/engines/file.rb20
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