Changeset 209

Show
Ignore:
Timestamp:
09/23/2007 16:44:10 (14 months ago)
Author:
zimbatm
Message:

Gained 10 chars by applying the same technique as on changeset [116].
Only, Array#* apparently also flatten the array!

Location:
trunk/lib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/camping-unabridged.rb

    r204 r209  
    446446    # alter the way Camping builds HTTP headers, consider overriding this method. 
    447447    def to_s 
    448       a=[] 
    449       @headers.map{|k,v|[*v].map{|x|a<<"#{k}: #{x}"}} 
    450       "Status: #{@status}#{Z+a*Z+Z*2+@body}" 
     448      "Status: #{@status}#{Z+@headers.map{|k,v|[*v].map{|x|[k,v]*": "}}*Z+Z*2}#{@body}" 
    451449    end 
    452450 
  • trunk/lib/camping.rb

    r204 r209  
    2727@body=send(@method,*a)if respond_to?@method;@headers["Set-Cookie"]=@cookies.map{ 
    2828|k,v|"#{k}=#{C.escape(v)}; path=#{self/'/'}"if v!=@k[k]}-[nil];self end;def to_s 
    29 a=[];@headers.map{|k,v|[*v].map{|x|a<<"#{k}: #{x}"}};"Status: #{@status}#{Z+a*Z+ 
    30 Z*2+@body}"end;end;X=module Controllers;@r=[];class<<self;def r;@r;end;def R*u 
     29"Status: #{@status}#{Z+@headers.map{|k,v|[*v].map{|x|[k,v]*": "}}*Z+Z*2}#{@body}" 
     30end;end;X=module Controllers;@r=[];class<<self;def r;@r;end;def R*u 
    3131r=@r;Class.new{meta_def(:urls){u};meta_def(:inherited){|x|r<<x}}end;def M;def M 
    3232end;constants.map{|c|k=const_get(c);k.send:include,C,Base,Models;r[0,0]=k if