Permalink
Browse files

Merge branch 'master' of https://github.com/riffraff/almost-sinatra

  • Loading branch information...
2 parents d64830c + be9b44b commit e00e9df699df5319dc00a74755422855af23e212 @rkh committed Mar 9, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 almost_sinatra.rb
View
14 almost_sinatra.rb
@@ -1,8 +1,8 @@
-['rack', 'tilt', 'backports', :INT, :TERM].map{|l|(l==l.to_s)?(require(l)):(trap(l){$r.stop})}
-$n=Sinatra=Module.new{$a,$o,$d,$h,$s,$f,$p=Rack::Builder.new,Object,:define_method,Hash,/@@ *([^\n]+)\n(((?!@@)[^\n]*\n)*)/m,File,4567;Application=$a}
-%w[get post put delete].map{|m|$o.send($d,m){|u,&b|$a.map(u){run->(e){[200,{"Content-Type"=>"text/html"},[$a.instance_eval(&b)]]}}}}
-Tilt.mappings.map{|k,v|$o.send($d,k){|n,*o|$t||=$f.read(caller.first[/^[^:]+/]).scan($s).inject({}){|h,(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)||{})}}
-%w[set enable disable configure helpers use register].map{|m|$o.send($d,m){|*_,&b|b.try(:[])}};at_exit{Rack::Handler.get("webrick").run($a,:Port=>$p){|s|$r=s}}
-['params', 'session', Rack::Session::Cookie, Rack::Lock].map{|m|(m==m.to_s)?($o.send($d,m){$q.send(m)}):($a.use(m))}
-$o.send($d,:before){|&b|$a.use(Rack::Config,&b)};before{|e|$q=Rack::Request.new(e);$q.params.dup.map{|k,v|params[k.to_sym]=v}}
+%w.rack tilt backports INT TERM..map{|l|trap(l){$r.stop}rescue require(l)}
+R=Rack;$n=Sinatra=Module.new{A,O,D,H,S,F,$p=R::Builder.new,Object,:define_method,Hash,/@@ *([^\n]+)\n(((?!@@)[^\n]*\n)*)/m,File,4567;Application=A}
+%w[get post put delete].map{|m|O.send(D,m){|u,&b|A.map(u){run->(e){[200,{"Content-Type"=>"text/html"},[A.instance_eval(&b)]]}}}}
+Tilt.mappings.map{|k,v|O.send(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)||{})}}
+%w[set enable disable configure helpers use register].map{|m|O.send(D,m){|*_,&b|b.try(:[])}};at_exit{R::Handler.get("webrick").run(A,Port:$p){|s|$r=s}}
+%w[params session].map{|m|O.send(D,m){$q.send(m)}};A.use(R::Session::Cookie);A.use(R::Lock)
+O.send(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}}
puts "== Almost #$n/No Version has taken the stage on #$p for development with backup from Webrick"

0 comments on commit e00e9df

Please sign in to comment.