From 04a36dd4a8164935b8b66fd040e1aa6aa1aaf2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 4 Sep 2013 16:56:08 +0200 Subject: implement Node#mimelib --- lib/zorglub/node.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index 82388cc..ebccedf 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -104,6 +104,10 @@ module Zorglub @ext || '' end # + def mime! mime + @mime = mime + end + # # class level basic node functions # class << self @@ -315,10 +319,10 @@ module Zorglub end @state = ( @partial ? :partial : :view ) @content, mime = e.call v, self if e and v and File.exists? v - @mime = mime unless mime.nil? + @mime ||= mime @state = :layout @content, mime = e.call l, self if e and l and File.exists? l - @mime = mime unless mime.nil? + @mime = mime if @mime.nil? and not mime.nil? end # end -- cgit v1.1-2-g2b99