Changeset 217
- Timestamp:
- 09/23/2007 18:45:57 (14 months ago)
- Files:
-
- 1 modified
-
trunk/lib/camping.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/camping.rb
r216 r217 9 9 end;module Base;attr_accessor:input,:cookies,:env,:headers,:body, 10 10 :status,:root;def method_missing*a,&b;a.shift if a[0]==:render;m=Mab.new({},self) 11 s=m.capture{send(*a,&b)};s=m.capture{send(:layout){s}} if /^_/!~a[0].to_s and m.11 s=m.capture{send(*a,&b)};s=m.capture{send(:layout){s}}if /^_/!~a[0].to_s and m. 12 12 respond_to?:layout;s end;def r s,b,h={};@status=s;@headers.merge!h;@body=b end 13 13 def redirect*a;r 302,'','Location'=>URL(*a)end;Z="\r\n";def to_a;[@status,@body, … … 22 22 '';l=@in.read(s*2);while l;if(k<<l)=~b;o<<$`.chomp;@in.seek(-$'.size, 23 23 IO::SEEK_CUR);break;end;o<<k.slice!(0...s);l=@in.read(s) 24 end;C.qsp(fn,'&;',fh,q) if fn;fh[:tempfile].rewind if fh.is_a?H;end;elsif@method==24 end;C.qsp(fn,'&;',fh,q)if fn;fh[:tempfile].rewind if fh.is_a?H;end;elsif@method== 25 25 "post" and e.CONTENT_TYPE == "application/x-www-form-urlencoded" 26 26 q.u C.qsp(@in.read)end;@cookies,@input=@k.dup,q.dup end;def service*a
