doc/rdoc/classes/RFuzz/Browser.src/M000084.html in rfuzz-0.8 vs doc/rdoc/classes/RFuzz/Browser.src/M000084.html in rfuzz-0.9
- old
+ new
@@ -3,21 +3,23 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>start (RFuzz::Browser)</title>
+ <title>new (RFuzz::Browser)</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/browser.rb, line 30</span>
-30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">ops</span>={})
-31: <span class="ruby-ivar">@response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">ops</span>)
-32: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">http_status</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">"200"</span>
-33: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Invalid status: #{@response.http_status}"</span>
-34: <span class="ruby-keyword kw">end</span>
-35:
-36: <span class="ruby-ivar">@doc</span> = <span class="ruby-constant">Hpricot</span>(<span class="ruby-ivar">@response</span>.<span class="ruby-identifier">http_body</span>)
-37: <span class="ruby-keyword kw">end</span></pre>
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/browser.rb, line 17</span>
+17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>=<span class="ruby-value">80</span>, <span class="ruby-identifier">ops</span>={}, <span class="ruby-identifier">agent</span>=<span class="ruby-constant">DEFAULT_AGENT</span>)
+18: <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">agent</span>
+19: <span class="ruby-ivar">@client</span> = <span class="ruby-constant">HttpClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">ops</span>)
+20:
+21: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:head</span>] <span class="ruby-operator">||=</span> {}
+22: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:head</span>][<span class="ruby-value str">"User-Agent"</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@agent</span>
+23:
+24: <span class="ruby-ivar">@doc</span> = <span class="ruby-keyword kw">nil</span>
+25: <span class="ruby-ivar">@response</span> = <span class="ruby-keyword kw">nil</span>
+26: <span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file