MOD cleanage
[euphorik.git] / tools / tools.rb
index 5472a3c..3fa7497 100644 (file)
@@ -14,7 +14,7 @@ Euphorik is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
-
++
 You should have received a copy of the GNU General Public License
 along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
 =end
@@ -33,7 +33,7 @@ along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
 #  ./tools.rb --dopreprod gburri@euphorik.ch:/var/www/euphorik_preprod --prod gburri@euphorik.ch:/var/www/euphorik
 
 # voir : http://net-ssh.rubyforge.org/ssh/v2/api/index.html
-require 'net/ssh'
+require 'net/ssh'
 
 # Classe permettant la vérification du code JS pas jslint.
 # Passe en revu chaque fichier js de manière récursive à partir d'un dossier de départ.s
@@ -44,19 +44,19 @@ class VerifJS
    end
    
    def verifier
-      verifierRecu(@dossier)
+      verifierRecur(@dossier)
    end
    
-   def verifierRecu(dossier)
+   def verifierRecur(dossier)
       Dir.foreach(dossier){|fichier|
          if fichier != '.' and fichier != '..' and File.directory?(fichier) and fichier != 'dirs'
-            if not verifierRecu(dossier + '/' + fichier)
+            if not verifierRecur(dossier + '/' + fichier)
                return false
             end
          elsif fichier[-3, 3] == '.js'
             puts "== Vérification de #{dossier}/#{fichier} =="
             system("java org.mozilla.javascript.tools.shell.Main jslint.js #{dossier}/#{fichier}")
-            puts $?.exitstatus
+            puts $?.exitstatus
             if $?.exitstatus > 0
                return false
             end
@@ -183,7 +183,7 @@ end
 class Commande
    def traiter
       #ARGV
-
+=begin
       Net::SSH.start('euphorik.ch', 'gburri') {|ssh|
          output = ssh.exec!("hostname")
          stdout = ""
@@ -191,14 +191,15 @@ class Commande
             stdout << data if stream == :stdout
          }
          puts stdout
-      }
+      }\r
+=end
       
       
       #miseEnProd = MiseEnProd.new("gburri@euphorik.ch:/var/www/euphorik", "gburri@euphorik.ch:/var/www/euphorik_preprod")
       #miseEnProd.miseEnPreProd()
 
-      #verifJS = VerifJS.new("../js")
-      #verifJS.verifier()
+      verifJS = VerifJS.new("../js")
+      verifJS.verifier()
 
       #version = Version.new("..")
       #version.maj()