This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
DUT2Curling/c/CtrlCheckLinks.rb
Quentin 03c8e5c2ca modified: README.md
new file:   c/CtrlCheckLinks.rb
	new file:   c/Main.rb
	deleted:    c/main.rb
	new file:   fichier/dir/aa
	modified:   m/ReadFile.rb
	modified:   m/ReadFolder.rb
	modified:   v/Vue1.rb
	deleted:    v/VueError.rb
	new file:   v/VueResult.rb
2014-01-04 11:06:05 +01:00

50 lines
837 B
Ruby

class CtrlCheckLinks
def saisie
liste_dir = "../fichier/".liste_rep
#Va checher les fichiers et arborecenses dans le dossier fichier (Méthode dans ReadFolder)
Gtk.init
@v1 = Vue1.new(liste_dir, self)
@v1.getWindow.show_all
Gtk.main
return @urls
end
def recupUrls(str)
f = ReadFile.new(str)
@urls = f.getUrls
self.destructionFen
end
def destructionFen
@v1.getWindow.destroy
Gtk.main_quit
end
def verifLiens(urls)
resultats = ""
urls.each { |n|
p = Net::Ping::HTTP.new n , 80
if p.ping?
resultats += "#{n} est vivant\n"
else
resultats += "#{n} est mort\n"
end
}
return resultats
end
def vueResult(resultats)
v = VueResult.new(resultats)
v.getWindow.show_all
Gtk.main
end
end