Changeset 211 for trunk/lib/camping.rb
- Timestamp:
- 09/23/2007 17:09:10 (14 months ago)
- Files:
-
- 1 modified
-
trunk/lib/camping.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/camping.rb
r209 r211 7 7 c=self/c;c="//"+@env.HTTP_HOST+c if c[/^\//];URI(c)end;def/p;p[/^\//]?@root+p : 8 8 p end;def errors_for o;ul.errors{o.errors.each_full{|x|li x}}if o.errors.any?end 9 end;module Base; include Helpers;attr_accessor:input,:cookies,:env,:headers,:body,9 end;module Base;attr_accessor:input,:cookies,:env,:headers,:body, 10 10 :status,:root;def method_missing*a,&b;a.shift if a[0]==:render;m=Mab.new({},self) 11 11 s=m.capture{send(*a,&b)};s=m.capture{send(:layout){s}} if /^_/!~a[0].to_s and m. … … 30 30 end;end;X=module Controllers;@r=[];class<<self;def r;@r;end;def R*u 31 31 r=@r;Class.new{meta_def(:urls){u};meta_def(:inherited){|x|r<<x}}end;def M;def M 32 end;constants.map{|c|k=const_get(c);k.send:include,C,Base, Models;r[0,0]=k if32 end;constants.map{|c|k=const_get(c);k.send:include,C,Base,Helpers,Models;r[0,0]=k if 33 33 !r.include?k;k.meta_def(:urls){["/#{c.downcase}"]}if !k.respond_to?:urls}end;def 34 34 D p;r.map{|k|k.urls.map{|x|return k,$~[1..-1]if p=~/^#{x}\/?$/}};[NotFound,[p]]end
