summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-09-04 16:56:08 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2013-09-04 16:56:08 +0200
commit04a36dd4a8164935b8b66fd040e1aa6aa1aaf2f9 (patch)
tree949d746399732b0f27eddb967b72f30659664e24
parent9904ef63e083bfe3c1df3e59b60aa6960eede2ea (diff)
downloadzorglub-04a36dd4a8164935b8b66fd040e1aa6aa1aaf2f9.zip
zorglub-04a36dd4a8164935b8b66fd040e1aa6aa1aaf2f9.tar.gz
implement Node#mimelib
-rw-r--r--lib/zorglub/node.rb8
1 files 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