From c5bfb744162ae0f90c66f1af629655a4d37455be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= <jeremy@asynk.ch>
Date: Wed, 16 Jan 2013 21:36:51 +0100
Subject: replace @options[:engine] with @engine

---
 lib/zorglub/node.rb | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index 7887428..c52649b 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -58,11 +58,7 @@ module Zorglub
         # instance level engine, layout, view, static configuration
         #
         def engine! engine
-            @options[:engine] = engine
-        end
-        #
-        def engine
-            @options[:engine]
+            @engine = engine
         end
         #
         def no_layout!
@@ -231,13 +227,13 @@ module Zorglub
                 meth, *args =  env['PATH_INFO'].sub(/^\//,'').split(/\//)
                 meth||= 'index'
                 puts "=> #{meth}(#{args.join ','})" if app.opt :debug
-                node = self.new env, {:engine=>engine,:layout=>layout,:view=>r(meth),:method=>meth,:args=>args}
+                node = self.new env, {:layout=>layout,:view=>r(meth),:method=>meth,:args=>args}
                 return error_404 node if not node.respond_to? meth
                 node.realize!
             end
             #
             def partial meth, *args
-                node = self.new nil, {:engine=>engine,:layout=>nil,:view=>r(meth),:method=>meth.to_s,:args=>args}
+                node = self.new nil, {:layout=>nil,:view=>r(meth),:method=>meth.to_s,:args=>args}
                 return error_404 node if not node.respond_to? meth
                 node.feed!
                 node.content
@@ -254,7 +250,7 @@ module Zorglub
             #
         end
         #
-        attr_reader :request, :response, :content, :mime, :state
+        attr_reader :request, :response, :content, :mime, :state, :engine
         #
         def initialize env, options
             @env = env
@@ -262,6 +258,7 @@ module Zorglub
             @request = Rack::Request.new env
             @response = Rack::Response.new
             @cli_vals ={}
+            @engine = self.class.engine
             @static = self.class.static
             self.class.cli_vals.each do |s,v| cli_val s, *v end
         end
@@ -309,7 +306,7 @@ module Zorglub
         end
         #
         def compile_page!
-            e, @options[:ext] = app.engine_proc_ext @options[:engine], @options[:ext]
+            e, @options[:ext] = app.engine_proc_ext @engine, @options[:ext]
             v, l, debug = view, layout, app.opt(:debug)
             puts " * "+(File.exists?(l) ? 'use layout' : 'not found layout')+" : "+l if debug
             puts " * "+(File.exists?(v) ? 'use view  ' : 'not found view  ')+" : "+v if debug
-- 
cgit v1.1-2-g2b99