423 lines
16 KiB
HTML
423 lines
16 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
|||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|||
|
<head>
|
|||
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|||
|
|
|||
|
<title>Class: CtrlCheckLinks</title>
|
|||
|
|
|||
|
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
|||
|
|
|||
|
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
|
|||
|
</head>
|
|||
|
<body id="top" class="class">
|
|||
|
|
|||
|
<div id="metadata">
|
|||
|
<div id="home-metadata">
|
|||
|
<div id="home-section" class="section">
|
|||
|
<h3 class="section-header">
|
|||
|
<a href="./index.html">Home</a>
|
|||
|
<a href="./index.html#classes">Classes</a>
|
|||
|
<a href="./index.html#methods">Methods</a>
|
|||
|
</h3>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div id="file-metadata">
|
|||
|
<div id="file-list-section" class="section">
|
|||
|
<h3 class="section-header">In Files</h3>
|
|||
|
<div class="section-body">
|
|||
|
<ul>
|
|||
|
|
|||
|
<li><a href="./c/CtrlCheckLinks_rb.html?TB_iframe=true&height=550&width=785"
|
|||
|
class="thickbox" title="c/CtrlCheckLinks.rb">c/CtrlCheckLinks.rb</a></li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<div id="class-metadata">
|
|||
|
|
|||
|
<!-- Parent Class -->
|
|||
|
<div id="parent-class-section" class="section">
|
|||
|
<h3 class="section-header">Parent</h3>
|
|||
|
|
|||
|
<p class="link">Object</p>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<!-- Method Quickref -->
|
|||
|
<div id="method-list-section" class="section">
|
|||
|
<h3 class="section-header">Methods</h3>
|
|||
|
<ul class="link-list">
|
|||
|
|
|||
|
<li><a href="#method-i-destructionFen">#destructionFen</a></li>
|
|||
|
|
|||
|
<li><a href="#method-i-recupUrls">#recupUrls</a></li>
|
|||
|
|
|||
|
<li><a href="#method-i-recupUrlsDoss">#recupUrlsDoss</a></li>
|
|||
|
|
|||
|
<li><a href="#method-i-saisie">#saisie</a></li>
|
|||
|
|
|||
|
<li><a href="#method-i-verifLiens">#verifLiens</a></li>
|
|||
|
|
|||
|
<li><a href="#method-i-vueResult">#vueResult</a></li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<div id="project-metadata">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div id="classindex-section" class="section project-section">
|
|||
|
<h3 class="section-header">Class/Module Index
|
|||
|
<span class="search-toggle"><img src="./images/find.png"
|
|||
|
height="16" width="16" alt="[+]"
|
|||
|
title="show/hide quicksearch" /></span></h3>
|
|||
|
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
|||
|
<fieldset>
|
|||
|
<legend>Quicksearch</legend>
|
|||
|
<input type="text" name="quicksearch" value=""
|
|||
|
class="quicksearch-field" />
|
|||
|
</fieldset>
|
|||
|
</form>
|
|||
|
|
|||
|
<ul class="link-list">
|
|||
|
|
|||
|
<li><a href="./CtrlCheckLinks.html">CtrlCheckLinks</a></li>
|
|||
|
|
|||
|
<li><a href="./CtrlHistoLink.html">CtrlHistoLink</a></li>
|
|||
|
|
|||
|
<li><a href="./Menu.html">Menu</a></li>
|
|||
|
|
|||
|
<li><a href="./ReadFile.html">ReadFile</a></li>
|
|||
|
|
|||
|
<li><a href="./Vue1.html">Vue1</a></li>
|
|||
|
|
|||
|
<li><a href="./VueHisto.html">VueHisto</a></li>
|
|||
|
|
|||
|
<li><a href="./VueMenu.html">VueMenu</a></li>
|
|||
|
|
|||
|
<li><a href="./VueResult.html">VueResult</a></li>
|
|||
|
|
|||
|
</ul>
|
|||
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div id="documentation">
|
|||
|
<h1 class="class">CtrlCheckLinks</h1>
|
|||
|
|
|||
|
<div id="description" class="description">
|
|||
|
|
|||
|
<p>Controleur de la vérification de la validité des liens ainsi que la vue <a
|
|||
|
href="Vue1.html">Vue1</a> et <a href="VueResult.html">VueResult</a></p>
|
|||
|
|
|||
|
</div><!-- description -->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div id="5Buntitled-5D" class="documentation-section">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<!-- Methods -->
|
|||
|
|
|||
|
<div id="public-instance-method-details" class="method-section section">
|
|||
|
<h3 class="section-header">Public Instance Methods</h3>
|
|||
|
|
|||
|
|
|||
|
<div id="destructionFen-method" class="method-detail ">
|
|||
|
<a name="method-i-destructionFen"></a>
|
|||
|
|
|||
|
|
|||
|
<div class="method-heading">
|
|||
|
<span class="method-name">destructionFen</span><span
|
|||
|
class="method-args">()</span>
|
|||
|
<span class="method-click-advice">click to toggle source</span>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="method-description">
|
|||
|
|
|||
|
<p><b>Controleur permettant de detruire la vue <a
|
|||
|
href="Vue1.html">Vue1</a></b></p>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="method-source-code" id="destructionFen-source">
|
|||
|
<pre>
|
|||
|
<span class="ruby-comment"># File c/CtrlCheckLinks.rb, line 34</span>
|
|||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">destructionFen</span>
|
|||
|
<span class="ruby-ivar">@v1</span>.<span class="ruby-identifier">getWindow</span>.<span class="ruby-identifier">destroy</span>
|
|||
|
<span class="ruby-constant">Gtk</span>.<span class="ruby-identifier">main_quit</span>
|
|||
|
<span class="ruby-keyword">end</span></pre>
|
|||
|
</div><!-- destructionFen-source -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div><!-- destructionFen-method -->
|
|||
|
|
|||
|
|
|||
|
<div id="recupUrls-method" class="method-detail ">
|
|||
|
<a name="method-i-recupUrls"></a>
|
|||
|
|
|||
|
|
|||
|
<div class="method-heading">
|
|||
|
<span class="method-name">recupUrls</span><span
|
|||
|
class="method-args">(str)</span>
|
|||
|
<span class="method-click-advice">click to toggle source</span>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="method-description">
|
|||
|
|
|||
|
<p><b>Controleur de recuperation et verification de liens dans 1 fichiers</b></p>
|
|||
|
<ul><li>
|
|||
|
<p>string str : chemin d’accès au fichier à traiter</p>
|
|||
|
</li></ul>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="method-source-code" id="recupUrls-source">
|
|||
|
<pre>
|
|||
|
<span class="ruby-comment"># File c/CtrlCheckLinks.rb, line 14</span>
|
|||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">recupUrls</span>(<span class="ruby-identifier">str</span>)
|
|||
|
<span class="ruby-identifier">f</span> = <span class="ruby-constant">ReadFile</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
|
|||
|
<span class="ruby-ivar">@urls</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">getUrls</span>
|
|||
|
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">vueResult</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">verifLiens</span>(<span class="ruby-ivar">@urls</span>), <span class="ruby-identifier">str</span>)
|
|||
|
<span class="ruby-identifier">s</span> = <span class="ruby-constant">CtrlHistoLink</span>.<span class="ruby-identifier">new</span> <span class="ruby-comment">#on enregistre dans l'histo le verif du lien</span>
|
|||
|
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">sauv</span>(<span class="ruby-identifier">str</span>, <span class="ruby-ivar">@urls</span>)
|
|||
|
<span class="ruby-keyword">end</span></pre>
|
|||
|
</div><!-- recupUrls-source -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div><!-- recupUrls-method -->
|
|||
|
|
|||
|
|
|||
|
<div id="recupUrlsDoss-method" class="method-detail ">
|
|||
|
<a name="method-i-recupUrlsDoss"></a>
|
|||
|
|
|||
|
|
|||
|
<div class="method-heading">
|
|||
|
<span class="method-name">recupUrlsDoss</span><span
|
|||
|
class="method-args">(str)</span>
|
|||
|
<span class="method-click-advice">click to toggle source</span>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="method-description">
|
|||
|
|
|||
|
<p><b>Controleur de recuperation et verification de liens dans 1 dossier</b></p>
|
|||
|
<ul><li>
|
|||
|
<p>string str : chemin d’accès au fichier à traiter</p>
|
|||
|
</li></ul>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="method-source-code" id="recupUrlsDoss-source">
|
|||
|
<pre>
|
|||
|
<span class="ruby-comment"># File c/CtrlCheckLinks.rb, line 23</span>
|
|||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">recupUrlsDoss</span>(<span class="ruby-identifier">str</span>)
|
|||
|
<span class="ruby-identifier">d</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">str</span>)
|
|||
|
<span class="ruby-identifier">liste_exclus</span> = [<span class="ruby-string">"."</span>, <span class="ruby-string">".."</span>]
|
|||
|
<span class="ruby-identifier">liste_dir</span> = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">sort</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">liste_exclus</span>
|
|||
|
<span class="ruby-identifier">liste_dir</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">fichier</span><span class="ruby-operator">|</span> <span class="ruby-comment">#pour chaque fichier touvé</span>
|
|||
|
<span class="ruby-keyword">if</span> (<span class="ruby-constant">File</span>.<span class="ruby-identifier">ftype</span>(<span class="ruby-identifier">str</span> <span class="ruby-operator">+</span> <span class="ruby-string">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">fichier</span>) <span class="ruby-operator">==</span> <span class="ruby-string">"file"</span>)
|
|||
|
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">recupUrls</span>(<span class="ruby-identifier">str</span> <span class="ruby-operator">+</span> <span class="ruby-string">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">fichier</span>)
|
|||
|
<span class="ruby-keyword">end</span>
|
|||
|
}
|
|||
|
<span class="ruby-keyword">end</span></pre>
|
|||
|
</div><!-- recupUrlsDoss-source -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div><!-- recupUrlsDoss-method -->
|
|||
|
|
|||
|
|
|||
|
<div id="saisie-method" class="method-detail ">
|
|||
|
<a name="method-i-saisie"></a>
|
|||
|
|
|||
|
|
|||
|
<div class="method-heading">
|
|||
|
<span class="method-name">saisie</span><span
|
|||
|
class="method-args">(type, title)</span>
|
|||
|
<span class="method-click-advice">click to toggle source</span>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="method-description">
|
|||
|
|
|||
|
<p><b>Controleur de la saisie pour vérification de lien, controleur <a
|
|||
|
href="Vue1.html">Vue1</a></b></p>
|
|||
|
<ul><li>
|
|||
|
<p>int type : permet de modifier la vue si 1 -> fichier sinon dossier</p>
|
|||
|
</li><li>
|
|||
|
<p>string title : titre fenetre de la vue qui va etre genere</p>
|
|||
|
</li><li>
|
|||
|
<p>return : String des urls trouvés</p>
|
|||
|
</li></ul>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="method-source-code" id="saisie-source">
|
|||
|
<pre>
|
|||
|
<span class="ruby-comment"># File c/CtrlCheckLinks.rb, line 7</span>
|
|||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">saisie</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">title</span>)
|
|||
|
<span class="ruby-ivar">@v1</span> = <span class="ruby-constant">Vue1</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">type</span>) <span class="ruby-comment">#creation vue principal</span>
|
|||
|
<span class="ruby-ivar">@v1</span>.<span class="ruby-identifier">getWindow</span>.<span class="ruby-identifier">show_all</span> <span class="ruby-comment"># affichage</span>
|
|||
|
<span class="ruby-constant">Gtk</span>.<span class="ruby-identifier">main</span>
|
|||
|
<span class="ruby-keyword">end</span></pre>
|
|||
|
</div><!-- saisie-source -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div><!-- saisie-method -->
|
|||
|
|
|||
|
|
|||
|
<div id="verifLiens-method" class="method-detail ">
|
|||
|
<a name="method-i-verifLiens"></a>
|
|||
|
|
|||
|
|
|||
|
<div class="method-heading">
|
|||
|
<span class="method-name">verifLiens</span><span
|
|||
|
class="method-args">(urls)</span>
|
|||
|
<span class="method-click-advice">click to toggle source</span>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="method-description">
|
|||
|
|
|||
|
<p><b>Controleur de verification de liens</b></p>
|
|||
|
<ul><li>
|
|||
|
<p>string[] : tableau des urls à vérifier</p>
|
|||
|
</li><li>
|
|||
|
<p>return : string contenant le resultat des pings</p>
|
|||
|
</li></ul>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="method-source-code" id="verifLiens-source">
|
|||
|
<pre>
|
|||
|
<span class="ruby-comment"># File c/CtrlCheckLinks.rb, line 41</span>
|
|||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">verifLiens</span>(<span class="ruby-identifier">urls</span>)
|
|||
|
<span class="ruby-identifier">resultats</span> = <span class="ruby-string">""</span>
|
|||
|
<span class="ruby-identifier">urls</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-comment"># pour chaque urls on realise un ping -> mise des resultats en chaine de caractere</span>
|
|||
|
<span class="ruby-identifier">p</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">Ping</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">n</span> , <span class="ruby-value">80</span>, <span class="ruby-value">5</span>
|
|||
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">ping?</span>
|
|||
|
<span class="ruby-identifier">resultats</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"#{n} est vivant\n"</span>
|
|||
|
<span class="ruby-keyword">else</span>
|
|||
|
<span class="ruby-identifier">resultats</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"#{n} est mort\n"</span>
|
|||
|
<span class="ruby-keyword">end</span>
|
|||
|
}
|
|||
|
<span class="ruby-keyword">return</span> <span class="ruby-identifier">resultats</span>
|
|||
|
<span class="ruby-keyword">end</span></pre>
|
|||
|
</div><!-- verifLiens-source -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div><!-- verifLiens-method -->
|
|||
|
|
|||
|
|
|||
|
<div id="vueResult-method" class="method-detail ">
|
|||
|
<a name="method-i-vueResult"></a>
|
|||
|
|
|||
|
|
|||
|
<div class="method-heading">
|
|||
|
<span class="method-name">vueResult</span><span
|
|||
|
class="method-args">(resultats, nom)</span>
|
|||
|
<span class="method-click-advice">click to toggle source</span>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="method-description">
|
|||
|
|
|||
|
<p><b>Controleur permettant d'afficher la vue secondaire d'affichage de
|
|||
|
resultats, controleur <a href="VueResult.html">VueResult</a></b></p>
|
|||
|
<ul><li>
|
|||
|
<p>string resultats : contient les resultats à affiché</p>
|
|||
|
</li><li>
|
|||
|
<p>string nom : nom du fichier qui contient les urls traités</p>
|
|||
|
</li></ul>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="method-source-code" id="vueResult-source">
|
|||
|
<pre>
|
|||
|
<span class="ruby-comment"># File c/CtrlCheckLinks.rb, line 56</span>
|
|||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">vueResult</span>(<span class="ruby-identifier">resultats</span>, <span class="ruby-identifier">nom</span>)
|
|||
|
<span class="ruby-identifier">v</span> = <span class="ruby-constant">VueResult</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">resultats</span>, <span class="ruby-identifier">nom</span>)
|
|||
|
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">getWindow</span>.<span class="ruby-identifier">show_all</span>
|
|||
|
<span class="ruby-constant">Gtk</span>.<span class="ruby-identifier">main</span>
|
|||
|
<span class="ruby-keyword">end</span></pre>
|
|||
|
</div><!-- vueResult-source -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div><!-- vueResult-method -->
|
|||
|
|
|||
|
|
|||
|
</div><!-- public-instance-method-details -->
|
|||
|
|
|||
|
</div><!-- 5Buntitled-5D -->
|
|||
|
|
|||
|
|
|||
|
</div><!-- documentation -->
|
|||
|
|
|||
|
<div id="validator-badges">
|
|||
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|||
|
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
|||
|
Rdoc Generator</a> 2</small>.</p>
|
|||
|
</div>
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|
|||
|
|