From 285fa24544bf5feffb08b56deb03ec224f1726b4 Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Tue, 13 Sep 2011 10:12:55 +0200 Subject: add before_all and after_all hooks --- examples/layout/default.haml | 1 + examples/sample.ru | 10 ++++++++++ 2 files changed, 11 insertions(+) (limited to 'examples') diff --git a/examples/layout/default.haml b/examples/layout/default.haml index 6af5e38..8df684f 100644 --- a/examples/layout/default.haml +++ b/examples/layout/default.haml @@ -1,4 +1,5 @@ %h1=@title %p="xx default layout xx" +%p="count #{Zorglub::Node.count}" %p=@content %p="xx -- xx" diff --git a/examples/sample.ru b/examples/sample.ru index 67937ac..6784d3d 100644 --- a/examples/sample.ru +++ b/examples/sample.ru @@ -13,6 +13,16 @@ Zorglub::Config.engine = 'haml' Zorglub::Config.session_on = true Zorglub::Config.root = File.dirname( File.absolute_path(__FILE__) ) # +class Zorglub::Node + @count=0 + class << self + attr_accessor :count + end + before_all do |node| + Zorglub::Node.count +=1 + end +end +# class Node1 < Zorglub::Node # def index a1, *a2 -- cgit v1.2.3