From 761e1e53cb92725e7e5e08c2615dedb91e0e54d1 Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 20 Dec 2013 10:27:54 +0100 Subject: [PATCH] new file: README.md~ new file: c/ff~ modified: c/main.rb renamed: c/ff -> fichier/ff new file: fichier/index.html modified: m/ReadFile.rb new file: m/ReadFolder.rb --- README.md~ | 11 +++++++++++ c/ff~ | 1 + c/main.rb | 6 ++++-- {c => fichier}/ff | 0 fichier/index.html | 4 ++++ m/ReadFile.rb | 6 ++++-- m/ReadFolder.rb | 21 +++++++++++++++++++++ 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 README.md~ create mode 100644 c/ff~ rename {c => fichier}/ff (100%) create mode 100644 fichier/index.html create mode 100644 m/ReadFolder.rb diff --git a/README.md~ b/README.md~ new file mode 100644 index 0000000..b68e3de --- /dev/null +++ b/README.md~ @@ -0,0 +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 +* regex : gem install regex diff --git a/c/ff~ b/c/ff~ new file mode 100644 index 0000000..be9a019 --- /dev/null +++ b/c/ff~ @@ -0,0 +1 @@ +fdfsdjkfdjskljfldks http://www.google.fr/jbhddzd/zddz"> fodfkljskljsd diff --git a/c/main.rb b/c/main.rb index a90eace..0090d7f 100755 --- a/c/main.rb +++ b/c/main.rb @@ -6,10 +6,11 @@ require 'net/ping' #lib netwotk #include require '../m/ReadFile' +require '../m/ReadFolder' require '../v/Vue1' require '../v/VueError' - +"../fichier/".liste_rep Gtk.init v1 = Vue1.new @@ -20,6 +21,7 @@ v1.listenerDestroy v1.getWindow.show_all Gtk.main str = v1.getEntry +str = "../fichier/" + str if(File.exist?(str)) f = ReadFile.new(str) @@ -33,7 +35,7 @@ end url.each { |n| p = Net::Ping::HTTP.new n , 80 if p.ping? - puts n + "is alive and kicking" + puts n + "est vivant" else puts n + "est mort" end diff --git a/c/ff b/fichier/ff similarity index 100% rename from c/ff rename to fichier/ff diff --git a/fichier/index.html b/fichier/index.html new file mode 100644 index 0000000..1c70d95 --- /dev/null +++ b/fichier/index.html @@ -0,0 +1,4 @@ +

It works!

+

This is the default web page for this server.

+

The web server software is running but no content has been added, yet.

+ diff --git a/m/ReadFile.rb b/m/ReadFile.rb index d1cf6c8..22206a8 100644 --- a/m/ReadFile.rb +++ b/m/ReadFile.rb @@ -2,6 +2,8 @@ class ReadFile def initialize(pFic) @fic = File.open(pFic, "r") end + + def getALL all = @fic.read @@ -15,6 +17,6 @@ class ReadFile end end -class TestLink -end \ No newline at end of file + + diff --git a/m/ReadFolder.rb b/m/ReadFolder.rb new file mode 100644 index 0000000..e5a9132 --- /dev/null +++ b/m/ReadFolder.rb @@ -0,0 +1,21 @@ +class String + def liste_rep(espacement = "") + + liste_exclus = [".", ".."] + d = Dir.open(self) + + liste_dir = d.sort - liste_exclus + + liste_dir.each { |fichier| + case File.ftype(self+fichier) + when "directory" + puts "#{espacement} + #{fichier}/" + espacement += " " + (self + fichier + "/").liste_rep(espacement) + espacement = espacement[0, espacement.length-4] + when "file" + puts "#{espacement} - #{fichier}" + end + } + end +end \ No newline at end of file