Skip to content
Browse files

why do we need the third param anyway?

  • Loading branch information...
1 parent 454de0d commit a3aa0719e5e5334e7e2672ef49c36bc805b942f4 @riffraff committed Mar 9, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 almost_sinatra.rb
View
2 almost_sinatra.rb
@@ -1,7 +1,7 @@
%w.rack tilt backports INT TERM..map{|l|trap(l){$r.stop}rescue require(l)}
R=Rack;$n=Sinatra=Module.new{A,D,H,S,F,$p=R::Builder.new,Object.method(:define_method),Hash,/@@ *([^\n]+)\n(((?!@@)[^\n]*\n)*)/m,File,4567;Application=A}
%w[get post put delete].map{|m|D.(m){|u,&b|A.map(u){run->(e){[200,{"Content-Type"=>"text/html"},[A.instance_eval(&b)]]}}}}
-Tilt.mappings.map{|k,v|D.(k){|n,*o|$t||=(h={};F.read(caller.first[/^[^:]+/]).scan(S){|a,b,c|h[a]=b};h);v.new(*o){(n.to_s==n)?(n):($t[n.to_s])}.render(A,o[0].try(:[],:locals)||{})}}
+Tilt.mappings.map{|k,v|D.(k){|n,*o|$t||=(h={};F.read(caller.first[/^[^:]+/]).scan(S){|a,b|h[a]=b};h);v.new(*o){(n.to_s==n)?(n):($t[n.to_s])}.render(A,o[0].try(:[],:locals)||{})}}
%w[set enable disable configure helpers use register].map{|m|D.(m){|*_,&b|b.try(:[])}};at_exit{R::Handler.get("webrick").run(A,Port:$p){|s|$r=s}}
%w[params session].map{|m|D.(m){$q.send(m)}};A.use(R::Session::Cookie);A.use(R::Lock)
D.(:before){|&b|A.use(R::Config,&b)};before{|e|$q=R::Request.new(e);$q.params.dup.map{|k,v|params[k.to_sym]=v}}

0 comments on commit a3aa071

Please sign in to comment.
Something went wrong with that request. Please try again.