Skip to content

Commit

Permalink
* lib/camping.rb: reversing zimbatm's last two changes, i hate to do…
Browse files Browse the repository at this point in the history
… it, but it's not the same. just keep this like it is for now. again, i'm so sorry i keep doing this to people!!

 * lib/camping-unabridged.rb: applying the fix from last checkin.
  • Loading branch information
_why committed Oct 13, 2006
1 parent b9c0d05 commit d25cfa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ 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}: #{x}"}}*Z+Z*2+@body}"
a=[]
@headers.map{|k,v|[*v].map{|x|a<<"#{k}: #{x}"}}
"Status: #{@status}#{Z+a*Z+Z*2+@body}"
end
end
Expand Down Expand Up @@ -661,7 +663,7 @@ def run(r=$stdin,e=ENV)
X.M
k,a=X.D un("/#{e['PATH_INFO']}".gsub(/\/+/,'/'))
k.new(r,e,(m=e['REQUEST_METHOD']||"GET")).Y.service *a
rescue=>x
rescue Object=>x
X::ServerError.new(r,e,'get').service(k,m,x)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def initialize r,e,m;e=H[e.to_hash];@status,@method,@env,@headers,@root=200,m.
split('=',2);h.u k.split(/[\]\[]+/).reverse.inject(y||v){|x,i|H[i,x]},&m}end;def
kp s;c=qsp(s,';,')end;def run r=$stdin,e=ENV;X.M;k,a=X.D un("/#{e[
'PATH_INFO']}".gsub(/\/+/,'/'));k.new(r,e,(m=e['REQUEST_METHOD']||"GET")).Y.
service *a;rescue=>x;X::ServerError.new(r,e,'get').service(k,m,x)end
service *a;rescue Object=>x;X::ServerError.new(r,e,'get').service(k,m,x)end
def method_missing m,c,*a;X.M;k=X.const_get(c).new(StringIO.new,H['HTTP_HOST',
'','SCRIPT_NAME','','HTTP_COOKIE',''],m.to_s);H.new(a.pop).each{|e,f|k.send(
"#{e}=",f)}if Hash===a[-1];k.service *a;end;end;module Views;include X,Helpers
Expand Down

0 comments on commit d25cfa0

Please sign in to comment.