summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-16 21:29:55 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-16 21:29:55 +0100
commiteb176a46ebb0650f6d5d51ea55d708a39eac4457 (patch)
treeff9a224c5bb039b69960f0bb6359b8f159aa9912
parent8d358b40bdbdc6fed6870e82a28d6043d59ca74c (diff)
downloadzorglub-eb176a46ebb0650f6d5d51ea55d708a39eac4457.zip
zorglub-eb176a46ebb0650f6d5d51ea55d708a39eac4457.tar.gz
replace @options[:static] with @static
-rw-r--r--lib/zorglub/node.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index 9572503..7887428 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -88,11 +88,11 @@ module Zorglub
end
#
def static! val
- @options[:static] = ((val==true or val==false) ? val : false )
+ @static = ( (val==true or val==false) ? val : false )
end
#
def static
- return nil if not @options[:static] or @options[:view].nil?
+ return nil if not @static or @options[:view].nil?
File.join(app.static_base_path, @options[:view])+ext
end
#
@@ -231,13 +231,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,:static=>static}
+ node = self.new env, {:engine=>engine,: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,:static=>static}
+ node = self.new nil, {:engine=>engine,: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
@@ -262,6 +262,7 @@ module Zorglub
@request = Rack::Request.new env
@response = Rack::Response.new
@cli_vals ={}
+ @static = self.class.static
self.class.cli_vals.each do |s,v| cli_val s, *v end
end
#