modified: README.md

modified:   c/ff
	modified:   c/main.rb
	modified:   m/ReadFile.rb
This commit is contained in:
Quentin 2013-12-18 10:41:37 +01:00
parent 26e8968796
commit 119cb1a977
4 changed files with 48 additions and 20 deletions

View File

@ -1,5 +1,11 @@
curling-g32
===========
==========================================================================
Projet Acsi Curling 2013-2014
Albert Jeremy, Aviles Adrien, Geoffrey Sentost, Quentin Rouland
==========================================================================
Requiert :
* Gtk2 : gem install gtk2
* net/ping : gem install net-ping

4
c/ff
View File

@ -1,3 +1 @@
www.google.fr
www.japanimes.tk
www.fakeadresse.com
fdfsdjkfdjskljfldks http://www.google.fr fodfkljskljsd

View File

@ -2,13 +2,14 @@
#lib
require 'gtk2' # lib graphique
#require 'net-ping' #lib netwotk
require 'net/http' #lib netwotk
require 'uri'
#include
require '../m/ReadFile'
require '../v/Vue1'
require '../v/VueError'
Gtk.init
v1 = Vue1.new
@ -18,15 +19,12 @@ v1.listenerDestroy
v1.getWindow.show_all
Gtk.main
str = v1.getEntry
#print str
if(File.exist?(str))
f = ReadFile.new(str)
tabL = f.getLines
for i in tabL
puts i
end
url = f.getUrls
puts url
else
vd = VueError.new("Fichier inexistant")
vd.getDialog.run
@ -37,4 +35,29 @@ end
# def ping(host)
# begin
# url=URI.parse(host)
# start_time = Time.now
# response=Net::HTTP.get(url)
# end_time = Time.now - start_time
# if response==""
# return false
# else
# puts "response time : #{end_time}"
# return true
# end
# rescue Errno::ECONNREFUSED
# return false
# end
# end
#
# if(ping "")
# puts('vrai')
# else
# puts('faux')
# end
print "Termine\n"

View File

@ -3,14 +3,15 @@ class ReadFile
@fic = File.open(pFic, "r")
end
def getLines
i=0
tabLines = []
@fic.each_line { |ligne|
tabLines[i] = ligne
i = i + 1
}
return tabLines
def getALL
all = @fic.read
return all
end
def getUrls
txt = self.getALL
url = txt.match /http[^\s]*/
return url
end
end