diff options
| -rw-r--r-- | lib/zorglub/node.rb | 19 | 
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index be035c6..9572503 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -254,7 +254,7 @@ module Zorglub              #          end          # -        attr_reader :request, :response, :content, :mime +        attr_reader :request, :response, :content, :mime, :state          #          def initialize env, options              @env = env @@ -265,11 +265,6 @@ module Zorglub              self.class.cli_vals.each do |s,v| cli_val s, *v end          end          # -        def state state=nil -            @options[:state] = state unless state.nil? -            @options[:state] -        end -        #          def realize!              catch(:stop_realize) {                  feed! @@ -281,9 +276,9 @@ module Zorglub          end          #          def feed! -            state :pre_cb +            @state = :pre_cb              self.class.call_before_hooks self -            state :meth +            @state = :meth              @content = self.send @options[:method], *@options[:args]              static_path = static              if static_path.nil? @@ -291,9 +286,9 @@ module Zorglub              else                  static_page! static_path              end -            state :post_cb +            @state = :post_cb              self.class.call_after_hooks self -            state :finished +            @state = :finished              return @content, @mime          end          # @@ -317,10 +312,10 @@ module Zorglub              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 -            state (@options[:layout].nil? ? :partial : :view) +            @state = (@options[:layout].nil? ? :partial : :view)              @content, mime = e.call v, self if e and File.exists? v              @mime = mime unless mime.nil? -            state :layout +            @state = :layout              @content, mime = e.call l, self if e and File.exists? l              @mime = mime unless mime.nil?          end  | 
