diff --git a/getdistorted/getdistorted.rb b/getdistorted/getdistorted.rb index 5012c9c..b794528 100755 --- a/getdistorted/getdistorted.rb +++ b/getdistorted/getdistorted.rb @@ -194,7 +194,7 @@ def getenclosure(podcast, item) end end @filelist[filename] = true - if ! File.exists?("#{@podcasts[podcast]["savedir"]}/#{filename}") + if ! File.exist?("#{@podcasts[podcast]["savedir"]}/#{filename}") puts " getting #{@podcasts[podcast]["savedir"]}/#{filename}" begin response = fetch(cast) diff --git a/listversioned/listversioned.rb b/listversioned/listversioned.rb index fa1cd52..d70606a 100755 --- a/listversioned/listversioned.rb +++ b/listversioned/listversioned.rb @@ -314,7 +314,7 @@ def fetch(uri_str, limit = 10) raise ArgumentError, 'HTTP redirect too deep' if limit == 0 if URI.parse(uri_str).scheme.to_s == "file" response = "" - if FileTest.exists?(URI.parse(uri_str).path) + if FileTest.exist?(URI.parse(uri_str).path) File.open(URI.parse(uri_str).path).each_line{|line| response += line } @@ -667,7 +667,7 @@ if options["-H"] # even controleren of er al een .svn dir staat op deze locatie # entries en andere bestanden zijn read-only, dus de rest loopt er op # stuk. Bovendien wil je het zeer waarschijnlijk niet. Echt niet. - if FileTest.exists?(".svn") + if FileTest.exist?(".svn") STDERR.puts ".svn dir found at current location" STDERR.puts "please use a different location" exit diff --git a/ndsstrip/ndsstrip.rb b/ndsstrip/ndsstrip.rb index c23bdd7..692a453 100644 --- a/ndsstrip/ndsstrip.rb +++ b/ndsstrip/ndsstrip.rb @@ -64,7 +64,7 @@ end options = cmdline -if FileTest.exists?(options["-t"]) +if FileTest.exist?(options["-t"]) puts "Target #{options["-t"]} already exists, not overwriting" exit 1 end diff --git a/nessus-group/nessus-group.rb b/nessus-group/nessus-group.rb index 5911a6d..24d1575 100755 --- a/nessus-group/nessus-group.rb +++ b/nessus-group/nessus-group.rb @@ -304,7 +304,7 @@ end parse_options -if ARGV[0].nil? or ARGV[0].empty? or ! FileTest.exists?(ARGV[0]) +if ARGV[0].nil? or ARGV[0].empty? or ! FileTest.exist?(ARGV[0]) usage end diff --git a/pbatch/pb.rb b/pbatch/pb.rb index e88eb33..206ab02 100755 --- a/pbatch/pb.rb +++ b/pbatch/pb.rb @@ -44,7 +44,7 @@ ENDTXT end def readconfig - if FileTest.exists?("#{@basedir}/#{CONFIG}") + if FileTest.exist?("#{@basedir}/#{CONFIG}") File.open("#{@basedir}/#{CONFIG}").each_line {|line| line.sub!(/#.*/, "") line.sub!(/^\s*/, "") @@ -87,7 +87,7 @@ end def increasejobscounter jobscounter = 0 - if FileTest.exists?(COUNTERFILE) + if FileTest.exist?(COUNTERFILE) File.new(COUNTERFILE).flock(File::LOCK_EX) File.open(COUNTERFILE, "r+"){|file| jobscounter = file.read @@ -117,7 +117,7 @@ end def addjob jobnumber=sprintf("%06d", increasejobscounter) puts "New job: #{jobnumber}" - if FileTest.exists?("#{@basedir}/#{JOBSDIR}/#{jobnumber}") + if FileTest.exist?("#{@basedir}/#{JOBSDIR}/#{jobnumber}") puts "Job #{jobnumber} already scheduled. This should not happen." exit end @@ -133,7 +133,7 @@ def addjobfromfile puts "Missing filename" usage else - if ! FileTest.exists?(filename) + if ! FileTest.exist?(filename) puts "File #{filename} doesn't exist" usage end @@ -145,7 +145,7 @@ def addjobfromfile end def createconfig - if ! FileTest.exists?("#{@basedir}/#{CONFIG}") + if ! FileTest.exist?("#{@basedir}/#{CONFIG}") File.open("#{@basedir}/#{CONFIG}", "w"){|file| file.puts <