docs
This commit is contained in:
@@ -94,6 +94,8 @@
|
||||
|
||||
<li class="file"><a href="../README_md.html">README</a>
|
||||
|
||||
<li class="file"><a href="../cache/browser/cookie-jar.html">cookie-jar</a>
|
||||
|
||||
<li class="file"><a href="../conf/browser_conf_json.html">browser.conf.json</a>
|
||||
|
||||
<li class="file"><a href="../generate_doc_sh.html">generate_doc.sh</a>
|
||||
@@ -170,6 +172,8 @@
|
||||
|
||||
<li><a href="../UpdaterFactory.html">UpdaterFactory</a>
|
||||
|
||||
<li><a href="../VersionCompare.html">VersionCompare</a>
|
||||
|
||||
<li><a href="../Vulnerabilities.html">Vulnerabilities</a>
|
||||
|
||||
<li><a href="../Vulnerabilities/Output.html">Vulnerabilities::Output</a>
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
|
||||
<li class="file"><a href="../README_md.html">README</a>
|
||||
|
||||
<li class="file"><a href="../cache/browser/cookie-jar.html">cookie-jar</a>
|
||||
|
||||
<li class="file"><a href="../conf/browser_conf_json.html">browser.conf.json</a>
|
||||
|
||||
<li class="file"><a href="../generate_doc_sh.html">generate_doc.sh</a>
|
||||
@@ -158,6 +160,8 @@
|
||||
|
||||
<li><a href="../UpdaterFactory.html">UpdaterFactory</a>
|
||||
|
||||
<li><a href="../VersionCompare.html">VersionCompare</a>
|
||||
|
||||
<li><a href="../Vulnerabilities.html">Vulnerabilities</a>
|
||||
|
||||
<li><a href="../Vulnerabilities/Output.html">Vulnerabilities::Output</a>
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
|
||||
<li class="file"><a href="../README_md.html">README</a>
|
||||
|
||||
<li class="file"><a href="../cache/browser/cookie-jar.html">cookie-jar</a>
|
||||
|
||||
<li class="file"><a href="../conf/browser_conf_json.html">browser.conf.json</a>
|
||||
|
||||
<li class="file"><a href="../generate_doc_sh.html">generate_doc.sh</a>
|
||||
@@ -182,6 +184,8 @@
|
||||
|
||||
<li><a href="../UpdaterFactory.html">UpdaterFactory</a>
|
||||
|
||||
<li><a href="../VersionCompare.html">VersionCompare</a>
|
||||
|
||||
<li><a href="../Vulnerabilities.html">Vulnerabilities</a>
|
||||
|
||||
<li><a href="../Vulnerabilities/Output.html">Vulnerabilities::Output</a>
|
||||
|
||||
@@ -92,6 +92,8 @@
|
||||
|
||||
<li class="file"><a href="../README_md.html">README</a>
|
||||
|
||||
<li class="file"><a href="../cache/browser/cookie-jar.html">cookie-jar</a>
|
||||
|
||||
<li class="file"><a href="../conf/browser_conf_json.html">browser.conf.json</a>
|
||||
|
||||
<li class="file"><a href="../generate_doc_sh.html">generate_doc.sh</a>
|
||||
@@ -168,6 +170,8 @@
|
||||
|
||||
<li><a href="../UpdaterFactory.html">UpdaterFactory</a>
|
||||
|
||||
<li><a href="../VersionCompare.html">VersionCompare</a>
|
||||
|
||||
<li><a href="../Vulnerabilities.html">Vulnerabilities</a>
|
||||
|
||||
<li><a href="../Vulnerabilities/Output.html">Vulnerabilities::Output</a>
|
||||
|
||||
@@ -94,6 +94,8 @@
|
||||
|
||||
<li class="file"><a href="../README_md.html">README</a>
|
||||
|
||||
<li class="file"><a href="../cache/browser/cookie-jar.html">cookie-jar</a>
|
||||
|
||||
<li class="file"><a href="../conf/browser_conf_json.html">browser.conf.json</a>
|
||||
|
||||
<li class="file"><a href="../generate_doc_sh.html">generate_doc.sh</a>
|
||||
@@ -170,6 +172,8 @@
|
||||
|
||||
<li><a href="../UpdaterFactory.html">UpdaterFactory</a>
|
||||
|
||||
<li><a href="../VersionCompare.html">VersionCompare</a>
|
||||
|
||||
<li><a href="../Vulnerabilities.html">Vulnerabilities</a>
|
||||
|
||||
<li><a href="../Vulnerabilities/Output.html">Vulnerabilities::Output</a>
|
||||
@@ -322,7 +326,7 @@
|
||||
|
||||
|
||||
<div class="method-source-code" id="to_s-source">
|
||||
<pre><span class="ruby-comment"># File lib/common/models/wp_item/versionable.rb, line 19</span>
|
||||
<pre><span class="ruby-comment"># File lib/common/models/wp_item/versionable.rb, line 22</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
||||
<span class="ruby-identifier">item_version</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">version</span>
|
||||
<span class="ruby-node">"#@name#{' v' + item_version.strip if item_version}"</span>
|
||||
@@ -361,8 +365,11 @@
|
||||
<pre><span class="ruby-comment"># File lib/common/models/wp_item/versionable.rb, line 10</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier">version</span>
|
||||
<span class="ruby-keyword">unless</span> <span class="ruby-ivar">@version</span>
|
||||
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Browser</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">readme_url</span>)
|
||||
<span class="ruby-ivar">@version</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>[<span class="ruby-node">%r{stable tag: #{WpVersion.version_pattern}}</span>, <span class="ruby-value">1</span>]
|
||||
<span class="ruby-comment"># This check is needed because readme_url can return nil
|
||||
</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">has_readme?</span>
|
||||
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Browser</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">readme_url</span>)
|
||||
<span class="ruby-ivar">@version</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>[<span class="ruby-node">%r{stable tag: #{WpVersion.version_pattern}}</span>, <span class="ruby-value">1</span>]
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-ivar">@version</span>
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
|
||||
<li ><a href="#method-i-vulnerabilities">#vulnerabilities</a>
|
||||
|
||||
<li ><a href="#method-i-vulnerable_to-3F">#vulnerable_to?</a>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -92,6 +94,8 @@
|
||||
|
||||
<li class="file"><a href="../README_md.html">README</a>
|
||||
|
||||
<li class="file"><a href="../cache/browser/cookie-jar.html">cookie-jar</a>
|
||||
|
||||
<li class="file"><a href="../conf/browser_conf_json.html">browser.conf.json</a>
|
||||
|
||||
<li class="file"><a href="../generate_doc_sh.html">generate_doc.sh</a>
|
||||
@@ -168,6 +172,8 @@
|
||||
|
||||
<li><a href="../UpdaterFactory.html">UpdaterFactory</a>
|
||||
|
||||
<li><a href="../VersionCompare.html">VersionCompare</a>
|
||||
|
||||
<li><a href="../Vulnerabilities.html">Vulnerabilities</a>
|
||||
|
||||
<li><a href="../Vulnerabilities/Output.html">Vulnerabilities::Output</a>
|
||||
@@ -348,7 +354,7 @@
|
||||
<div class="method-description">
|
||||
|
||||
<p>Get the vulnerabilities associated to the <a
|
||||
href="../WpItem.html">WpItem</a></p>
|
||||
href="../WpItem.html">WpItem</a> Filters out already fixed vulnerabilities</p>
|
||||
|
||||
<p>@return [ <a href="../Vulnerabilities.html">Vulnerabilities</a> ]</p>
|
||||
|
||||
@@ -356,13 +362,16 @@ href="../WpItem.html">WpItem</a></p>
|
||||
|
||||
|
||||
<div class="method-source-code" id="vulnerabilities-source">
|
||||
<pre><span class="ruby-comment"># File lib/common/models/wp_item/vulnerable.rb, line 9</span>
|
||||
<pre><span class="ruby-comment"># File lib/common/models/wp_item/vulnerable.rb, line 10</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier">vulnerabilities</span>
|
||||
<span class="ruby-identifier">xml</span> = <span class="ruby-identifier">xml</span>(<span class="ruby-identifier">vulns_file</span>)
|
||||
<span class="ruby-identifier">vulnerabilities</span> = <span class="ruby-constant">Vulnerabilities</span>.<span class="ruby-identifier">new</span>
|
||||
|
||||
<span class="ruby-identifier">xml</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-identifier">vulns_xpath</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">node</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">vulnerabilities</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Vulnerability</span>.<span class="ruby-identifier">load_from_xml_node</span>(<span class="ruby-identifier">node</span>)
|
||||
<span class="ruby-identifier">vuln</span> = <span class="ruby-constant">Vulnerability</span>.<span class="ruby-identifier">load_from_xml_node</span>(<span class="ruby-identifier">node</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">vulnerable_to?</span>(<span class="ruby-identifier">vuln</span>)
|
||||
<span class="ruby-identifier">vulnerabilities</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">vuln</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-identifier">vulnerabilities</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
@@ -376,6 +385,51 @@ href="../WpItem.html">WpItem</a></p>
|
||||
</div><!-- vulnerabilities-method -->
|
||||
|
||||
|
||||
<div id="method-i-vulnerable_to-3F" class="method-detail ">
|
||||
|
||||
<div class="method-heading">
|
||||
<span class="method-name">vulnerable_to?</span><span
|
||||
class="method-args">(vuln)</span>
|
||||
|
||||
<span class="method-click-advice">click to toggle source</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="method-description">
|
||||
|
||||
<p>Checks if a item is vulnerable to a specific vulnerability</p>
|
||||
|
||||
<p>@param [ <a href="../Vulnerability.html">Vulnerability</a> ] vuln <a
|
||||
href="../Vulnerability.html">Vulnerability</a> to check the item against</p>
|
||||
|
||||
<p>@return [ Boolean ]</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="method-source-code" id="vulnerable_to-3F-source">
|
||||
<pre><span class="ruby-comment"># File lib/common/models/wp_item/vulnerable.rb, line 28</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-identifier">vulnerable_to?</span>(<span class="ruby-identifier">vuln</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">vuln</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">vuln</span>.<span class="ruby-identifier">fixed_in</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">vuln</span>.<span class="ruby-identifier">fixed_in</span>.<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-keyword">unless</span> <span class="ruby-constant">VersionCompare</span><span class="ruby-operator">::</span><span class="ruby-identifier">is_newer_or_same?</span>(<span class="ruby-identifier">vuln</span>.<span class="ruby-identifier">fixed_in</span>, <span class="ruby-identifier">version</span>)
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div><!-- vulnerable_to-3F-source -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!-- vulnerable_to-3F-method -->
|
||||
|
||||
|
||||
</section><!-- public-instance-method-details -->
|
||||
|
||||
</section><!-- 5Buntitled-5D -->
|
||||
|
||||
Reference in New Issue
Block a user