modified: c/CtrlCheckLinks.rb
modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
This commit is contained in:
@ -1,22 +1,25 @@
|
||||
# Controleur de la vérification de la validité des liens ainsi que les vues correspondantes
|
||||
# Controleur de la vérification de la validité des liens ainsi que la vue Vue1 et VueResult
|
||||
class CtrlCheckLinks
|
||||
#Controleur de la saisie pour vérification de lien
|
||||
def saisie(type)
|
||||
@v1 = Vue1.new(self, 'Saisie nom fichier', type) #creation vue principal
|
||||
# <b>Controleur de la saisie pour vérification de lien, controleur Vue1</b>
|
||||
# * int type : permet de modifier la vue si 1 -> fichier sinon dossier
|
||||
# * string title : titre fenetre de la vue qui va etre genere
|
||||
# * return : String des urls trouvés
|
||||
def saisie(type, title)
|
||||
@v1 = Vue1.new(self, title, type) #creation vue principal
|
||||
@v1.getWindow.show_all # affichage
|
||||
Gtk.main
|
||||
return @urls
|
||||
end
|
||||
#Controleur recuperation et verification de liens dans 1 fichiers
|
||||
# <b>Controleur de recuperation et verification de liens dans 1 fichiers</b>
|
||||
# * string str : chemin d'accès au fichier à traiter
|
||||
def recupUrls(str)
|
||||
f = ReadFile.new(str)
|
||||
@urls = f.getUrls
|
||||
self.vueResult(self.verifLiens(@urls), str)
|
||||
s = CtrlHistoLink.new #on enregistre dans l'histo le verif du lien
|
||||
s.sauv(str, @urls)
|
||||
return @urls
|
||||
end
|
||||
#Controleur recuperation et verification de liens dans 1 dossier
|
||||
# <b>Controleur de recuperation et verification de liens dans 1 dossier</b>
|
||||
# * string str : chemin d'accès au fichier à traiter
|
||||
def recupUrlsDoss(str)
|
||||
d = Dir.open(str)
|
||||
liste_exclus = [".", ".."]
|
||||
@ -27,12 +30,14 @@ class CtrlCheckLinks
|
||||
end
|
||||
}
|
||||
end
|
||||
#Controleur permettant de detruire la vue principal
|
||||
# <b>Controleur permettant de detruire la vue Vue1</b>
|
||||
def destructionFen
|
||||
@v1.getWindow.destroy
|
||||
Gtk.main_quit
|
||||
end
|
||||
#Controleur de verification de liens
|
||||
# <b>Controleur de verification de liens</b>
|
||||
# * string[] : tableau des urls à vérifier
|
||||
# * return : string contenant le resultat des pings
|
||||
def verifLiens(urls)
|
||||
resultats = ""
|
||||
urls.each { |n| # pour chaque urls on realise un ping -> mise des resultats en chaine de caractere
|
||||
@ -44,13 +49,13 @@ class CtrlCheckLinks
|
||||
end
|
||||
}
|
||||
return resultats
|
||||
|
||||
end
|
||||
#Controleur permettant d'afficher la vue secondaire d'affichage de resultat
|
||||
# <b>Controleur permettant d'afficher la vue secondaire d'affichage de resultats, controleur VueResult</b>
|
||||
# * string resultats : contient les resultats à affiché
|
||||
# * string nom : nom du fichier qui contient les urls traités
|
||||
def vueResult(resultats, nom)
|
||||
v = VueResult.new(resultats, nom)
|
||||
v.getWindow.show_all
|
||||
Gtk.main
|
||||
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user