#! /usr/bin/env ruby # $LOAD_PATH << File.join(File.dirname( File.absolute_path(__FILE__)), '..', 'lib') # require 'zorglub' # require 'haml' HAML_PROC = Proc.new { |path,obj| Haml::Engine.new( File.open(path,'r').read ).render(obj) } Zorglub::Config.register_engine 'haml', 'haml', HAML_PROC Zorglub::Config.register_engine 'tmp-engine', 'haml', HAML_PROC # Zorglub::Config.engine = 'haml' Zorglub::Config.session_on = true Zorglub::Config.root = File.dirname( File.absolute_path(__FILE__) ) # class Node1 < Zorglub::Node # def index a1, *a2 @title='Index' @links = LINKS # there's a view so the below will be lost ! "should never be seeen" end # def meth0 *args @title='meth0' @links = LINKS # method level engine engine 'tmp-engine' # there's a view so the below will be lost ! "should never be seeen" end # def meth1 *args @title='meth1' @links = LINKS # method level engine (layout/other.haml) layout 'other' # specific method view (view/url1/meth0.haml) view File.join( 'url1','meth0') # there's a view so the below will be lost ! "should never be seeen" end # end # APP = Zorglub::App.new do map '/url1', Node1 end # class Node2 < Zorglub::Node # include Zorglub::Helpers::Css # map APP, '/url2' layout 'css' # class level engine engine 'tmp-engine' # class level css css 'class_level.css' # def index *args "