doc/rdoc/classes/RFuzz/HttpClient.src/M000027.html in rfuzz-0.8 vs doc/rdoc/classes/RFuzz/HttpClient.src/M000027.html in rfuzz-0.9

- old
+ new

@@ -3,24 +3,36 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>method_missing (RFuzz::HttpClient)</title> + <title>send_request (RFuzz::HttpClient)</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/rfuzz/client.rb, line 405</span> -405: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) -406: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@allowed_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">symbol</span> -407: <span class="ruby-identifier">method</span> = <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span> -408: <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">send_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> {}) -409: <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">redirect</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-identifier">resp</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@redirect</span> -410: -411: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">resp</span> -412: <span class="ruby-keyword kw">else</span> -413: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpClientError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Invalid method: #{symbol}&quot;</span>) -414: <span class="ruby-keyword kw">end</span> -415: <span class="ruby-keyword kw">end</span></pre> + <pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 376</span> +376: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">req</span>) +377: <span class="ruby-keyword kw">begin</span> +378: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:connect</span> <span class="ruby-keyword kw">do</span> +379: <span class="ruby-ivar">@sock</span> = <span class="ruby-constant">PushBackIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">TCPSocket</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@port</span>)) +380: <span class="ruby-keyword kw">end</span> +381: +382: <span class="ruby-identifier">out</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span> +383: <span class="ruby-identifier">body</span> = <span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">req</span>) +384: +385: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:send_request</span> <span class="ruby-keyword kw">do</span> +386: <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">out</span>.<span class="ruby-identifier">string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">body</span>) +387: <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">flush</span> +388: <span class="ruby-keyword kw">end</span> +389: +390: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">read_response</span> +391: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> +392: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">$!</span> +393: <span class="ruby-keyword kw">ensure</span> +394: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sock</span> +395: <span class="ruby-identifier">notify</span>(<span class="ruby-identifier">:close</span>) { <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">close</span> } +396: <span class="ruby-keyword kw">end</span> +397: <span class="ruby-keyword kw">end</span> +398: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file