diff options
-rw-r--r-- | lib/zorglub/node.rb | 7 | ||||
-rw-r--r-- | spec/spec_helper.rb | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index ad4408c..7f81c2e 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -213,8 +213,11 @@ module Zorglub File.join(Config.static_base_path, @options[:view])+ext end # - def view view=nil - @options[:view] = view unless view.nil? or view.empty? + def view! view + @options[:view] = view + end + # + def view return '' if @options[:view].nil? File.join(Config.view_base_path, @options[:view])+ext end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 76a8638..90bfc10 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -65,7 +65,7 @@ class Node0 < Zorglub::Node end def other_view engine! 'real' - view r('do_partial') + view! r('do_partial') end def do_redirect redirect r(:do_partial,1,2,3) @@ -153,13 +153,13 @@ class Node6 < Zorglub::Node def no_static static false engine! 'static' - view Node0.r('do_render') + view! Node0.r('do_render') Node6.static_cpt+=1 @value = Node6.static_cpt end def do_static engine! 'static' - view Node0.r('do_render') + view! Node0.r('do_render') Node6.static_cpt+=1 @value = Node6.static_cpt end |