Skip to content

Commit

Permalink
I'm back, trying to fix #147.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Pfenniger committed Dec 26, 2007
1 parent cdcf65b commit fcb29f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def service(*a)
# Used by the web server to convert the current request to a string. If you need to
# alter the way Camping builds HTTP headers, consider overriding this method.
def to_s
"Status: #@status#{Z+(headers.map{|k,v|[*v].map{|x|[k,v]*": "}}*Z).gsub(Z*2,Z)+Z+Z}#@body"
"Status: #@status#{Z+(headers.inject([]){|a,o|[*o[1]].map{|x|a<<[o[0],v]*": "if v&&v.to_s.any?}}*Z)+Z+Z}#@body"
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def method_missing *a,&b;a.shift if a[0]==:render;m=Mab.new({},self)
"application/x-www-form-urlencoded": q.u(C.qsp(@in.read))end
@cookies,@[email protected],q.dup end;def service *a;@body=send @method,*a
headers['Set-Cookie']=cookies.map{|k,v|"#{k}=#{C.escape(v)}; path=#{self/
"/"}"if v!=@k[k]}-[nil];self end;def to_s;"Status: #@status#{Z+(headers.map{
|k,v|[*v].map{|x|[k,v]*": "}}*Z).gsub(Z*2,Z)+Z+Z}#@body"end
"/"}"if v!=@k[k]}-[nil];self end;def to_s;"Status: #@status#{Z+(headers.inject([
]){|a,o|[*o[1]].map{|x|a<<[o[0],v]*": "if v&&v.to_s.any?}}*Z)+Z+Z}#@body"end
end;X=module Controllers;@r=[];class<<self;def r;@r end;def R *u;r=@r
Class.new{meta_def(:urls){u};meta_def(:inherited){|x|r<<x}}end
def D p,m;r.map{|k|k.urls.map{|x|return(k.instance_method(m)rescue nil)?
Expand Down

0 comments on commit fcb29f2

Please sign in to comment.