관리-도구
편집 파일: M000058.html
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>new (Rack::Multipart::Parser)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File lib/rack/multipart/parser.rb, line 28</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">boundary</span>, <span class="ruby-identifier">io</span>, <span class="ruby-identifier">content_length</span>, <span class="ruby-identifier">env</span>, <span class="ruby-identifier">tempfile</span>, <span class="ruby-identifier">bufsize</span>) <span class="ruby-ivar">@buf</span> = <span class="ruby-value str">""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@buf</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:force_encoding</span> <span class="ruby-ivar">@buf</span>.<span class="ruby-identifier">force_encoding</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">ASCII_8BIT</span> <span class="ruby-keyword kw">end</span> <span class="ruby-ivar">@params</span> = <span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">KeySpaceConstrainedParams</span>.<span class="ruby-identifier">new</span> <span class="ruby-ivar">@boundary</span> = <span class="ruby-node">"--#{boundary}"</span> <span class="ruby-ivar">@io</span> = <span class="ruby-identifier">io</span> <span class="ruby-ivar">@content_length</span> = <span class="ruby-identifier">content_length</span> <span class="ruby-ivar">@boundary_size</span> = <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">bytesize</span>(<span class="ruby-ivar">@boundary</span>) <span class="ruby-operator">+</span> <span class="ruby-constant">EOL</span>.<span class="ruby-identifier">size</span> <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">env</span> <span class="ruby-ivar">@tempfile</span> = <span class="ruby-identifier">tempfile</span> <span class="ruby-ivar">@bufsize</span> = <span class="ruby-identifier">bufsize</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@content_length</span> <span class="ruby-ivar">@content_length</span> <span class="ruby-operator">-=</span> <span class="ruby-ivar">@boundary_size</span> <span class="ruby-keyword kw">end</span> <span class="ruby-ivar">@rx</span> = <span class="ruby-node">/(?:#{EOL})?#{Regexp.quote(@boundary)}(#{EOL}|--)/n</span> <span class="ruby-ivar">@full_boundary</span> = <span class="ruby-ivar">@boundary</span> <span class="ruby-operator">+</span> <span class="ruby-constant">EOL</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>