summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-16 21:36:51 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-16 21:36:51 +0100
commitc5bfb744162ae0f90c66f1af629655a4d37455be (patch)
treebf248baa8a9db3f67d7fee23b274a5010aec05ea
parenteb176a46ebb0650f6d5d51ea55d708a39eac4457 (diff)
downloadzorglub-c5bfb744162ae0f90c66f1af629655a4d37455be.zip
zorglub-c5bfb744162ae0f90c66f1af629655a4d37455be.tar.gz
replace @options[:engine] with @engine
-rw-r--r--lib/zorglub/node.rb15
1 files 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