GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: the 4k pocket full-of-gags web microframework
Homepage: http://code.whytheluckystiff.net/camping/
Clone URL: git://github.com/why/camping.git
Syncing camping.rb with the latest changes
judofyr (author)
Mon Jul 07 12:33:49 -0700 2008
commit  4fc925a82eb28bbfc719b37ec6837bfe27769ac0
tree    e304a7a47d2477af8c94b5210c1b97e646f613c0
parent  ddea5760289a4de3c27047c17475fd1165256664
...
33
34
35
36
 
37
38
39
...
43
44
45
46
 
47
48
49
50
 
51
52
53
...
33
34
35
 
36
37
38
39
...
43
44
45
 
46
47
48
 
 
49
50
51
52
0
@@ -33,7 +33,7 @@ H[@request.cookies],@response.headers,@response.status
0
 @input.delete(k)elsif k=~/(.*)\[([^\]]+)\]$/
0
 (@input[$1]||=H[])[$2]=@input.delete(k)end};end;def service *a
0
 r=catch(:halt){send(@request.request_method.downcase,*a)};@body||=r
0
-self;end;end;X=module Controllers;@r=[];class<<self;def r;@r end;def R *u;r=@r
0
+self;end;end;module Controllers;@r=[];class<<self;def r;@r end;def R *u;r=@r
0
 Class.new{meta_def(:urls){u};meta_def(:inherited){|x|r<<x}}end
0
 def D p,m;p='/'if !p||!p[0]
0
 r.map{|k|k.urls.map{|x|return(k.instance_method(m)rescue nil)?
0
@@ -43,11 +43,10 @@ def M;def M;end;constants.map{|c|k=const_get(c)
0
 k.send:include,C,Base,Helpers,Models;@r=[k]+r if r-[k]==r
0
 k.meta_def(:urls){["/#{c.scan(/.[^A-Z]*/).map(&N.method(:[]))*'/'}"]
0
 }if !k.respond_to?:urls}end end;class I<R()
0
-end;self end;class<<self;def goes m
0
+end; end;X=Controllers;class<<self;def goes m
0
 eval S.gsub(/Camping/,m.to_s),TOPLEVEL_BINDING end;def call e
0
 X.M;e=H[e.to_hash];k,m,*a=X.D e.PATH_INFO,(e.REQUEST_METHOD||'get').downcase
0
-e.REQUEST_METHOD=m;k.new(e).service(*a).to_a;rescue => x
0
-e.REQUEST_METHOD='r500';X::I.new(e).service(k,m,x).to_a;end
0
+e.REQUEST_METHOD=m;k.new(e).service(*a).to_a;end
0
 def method_missing m,c,*a;X.M;h=Hash===a[-1]?H[a.pop]:{};e=
0
 H[h[:env]||{}].merge!({'rack.input'=>StringIO.new,'REQUEST_METHOD'=>m.to_s})
0
 k=X.const_get(c).new(H[e]);k.send("input=",h[:input])if h[:input]

Comments

    No one has commented yet.