diff --git a/mesa/demo/imggen.rb b/mesa/demo/imggen.rb index 8fb82a18..78a85056 100755 --- a/mesa/demo/imggen.rb +++ b/mesa/demo/imggen.rb @@ -270,7 +270,7 @@ def sys cmd, input = nil exception = nil - raise "IMGGEN: #{$o[:name]}> Input file: #{input} does not exists!!!" if input and (not File.exists? input) + raise "IMGGEN: #{$o[:name]}> Input file: #{input} does not exists!!!" if input and (not File.exist? input) begin stdout, stderr, status = Open3.capture3(cmd) @@ -308,7 +308,7 @@ def sys cmd, input = nil s += "#{stderr}\n" end if input - if File.exists? input + if File.exist? input s += "INPUT-FILE-EXISTS: #{input}\n" else s += "INPUT-FILE-NO-EXISTS: #{input}\n" diff --git a/mesa/demo/test/lib/cli.rb b/mesa/demo/test/lib/cli.rb index 58172dba..c68aa1d5 100644 --- a/mesa/demo/test/lib/cli.rb +++ b/mesa/demo/test/lib/cli.rb @@ -234,10 +234,10 @@ def initialize(target, options={}) @id = options.fetch(:id, "CliTransport") raise "Invalid rs232 specification: #{target}" unless target =~ /^rs232:([^:]+),(230400|115200|57600|38400|19200|9600|4800|2400|1200|300),([noeNOE]),([5678]),([12])(,transient)?$/ @dev, baudrate, parity, databits, stopbits, @transient = $1, $2.to_i, $3.upcase, $4.to_i, $5.to_i, $6 - raise "No such character device on host: #{@dev}" unless @transient || (File.exists?(@dev) && File.chardev?(@dev)) + raise "No such character device on host: #{@dev}" unless @transient || (File.exist?(@dev) && File.chardev?(@dev)) lock_name = "/var/lock/LCK..#{File.basename(@dev)}" - raise "CLI: Serial port lock file exists, maybe from minicom? #{lock_name}" if File.exists?(lock_name) + raise "CLI: Serial port lock file exists, maybe from minicom? #{lock_name}" if File.exist?(lock_name) @setup = { "baud" => baudrate, diff --git a/mesa/demo/test/lib/frameio.rb b/mesa/demo/test/lib/frameio.rb index 61e2a8e4..6eadce85 100644 --- a/mesa/demo/test/lib/frameio.rb +++ b/mesa/demo/test/lib/frameio.rb @@ -982,7 +982,7 @@ class LinuxBridgeIfFactory @@created = [] def LinuxBridgeIfFactory.capable? - File.exists?(BRCTL) && File.executable?(BRCTL) + File.exist?(BRCTL) && File.executable?(BRCTL) end def LinuxBridgeIfFactory.exists?(ifname) diff --git a/mesa/demo/test/utils/lazy-ef-install.rb b/mesa/demo/test/utils/lazy-ef-install.rb index c75aa728..fd19a601 100755 --- a/mesa/demo/test/utils/lazy-ef-install.rb +++ b/mesa/demo/test/utils/lazy-ef-install.rb @@ -14,7 +14,7 @@ def sys cmd $v = ARGV[0] $dest_dir = path = File.expand_path(File.dirname(__FILE__)) -if File.exists? "/easytest/local/install/ef/#{$v}/usr/local/bin/ef" +if File.exist? "/easytest/local/install/ef/#{$v}/usr/local/bin/ef" sys "ln -fs /easytest/local/install/ef/#{$v}/usr/local/bin/ef #{$dest_dir}/ef" sys "ln -fs /easytest/local/install/ef/#{$v}/usr/local/bin/ef /usr/local/bin/ef" exit 0 @@ -29,13 +29,13 @@ def sys cmd sys "mkdir -p /easytest/local/git/" def ef_clone_ - if File.exists?($git_cache) + if File.exist?($git_cache) sys "cd #{$git_cache} && git fetch" else sys "cd /easytest/local/git-cache/ && git clone --quiet --bare --mirror https://github.com/microchip-ung/easyframes.git ef" end - sys "git clone --quiet #{$git_cache} #{$src_dir}" if not File.exists?($src_dir) + sys "git clone --quiet #{$git_cache} #{$src_dir}" if not File.exist?($src_dir) sys "cd #{$src_dir} && git reset --hard #{$v}" sys "cd #{$src_dir} && git clean -ffdx" end diff --git a/mesa/demo/test/utils/pcap_analyze.rb b/mesa/demo/test/utils/pcap_analyze.rb index e7957cf3..2865bee3 100755 --- a/mesa/demo/test/utils/pcap_analyze.rb +++ b/mesa/demo/test/utils/pcap_analyze.rb @@ -72,7 +72,7 @@ exit 4 end -if !File.exists? ARGV[0] +if !File.exist? ARGV[0] $stderr.puts "pcap file: #{ARGV[0]} does not exist" exit 5 end diff --git a/mesa/demo/test/utils/repeat.rb b/mesa/demo/test/utils/repeat.rb index 2d26983b..a44fe6d2 100755 --- a/mesa/demo/test/utils/repeat.rb +++ b/mesa/demo/test/utils/repeat.rb @@ -37,7 +37,7 @@ exit -1 end -if File.exists? $options[:out_folder] +if File.exist? $options[:out_folder] $stderr.puts "Output folder exists already" exit -1 end diff --git a/mesa/demo/test/utils/run.rb b/mesa/demo/test/utils/run.rb index e12fd58a..2adae289 100755 --- a/mesa/demo/test/utils/run.rb +++ b/mesa/demo/test/utils/run.rb @@ -38,7 +38,7 @@ exit -1 end -if File.exists? $options[:out_folder] +if File.exist? $options[:out_folder] system("rm -fr #{$options[:out_folder]}") end diff --git a/mesa/scripts/ag.rb b/mesa/scripts/ag.rb index a9367d76..06278093 100755 --- a/mesa/scripts/ag.rb +++ b/mesa/scripts/ag.rb @@ -900,7 +900,7 @@ def handle_root ast ast = nil cache_file = "#{$options[:output_dir]}/#{x}.cache" - if File.exists?(cache_file) and File.mtime(cache_file) > File.mtime(x) + if File.exist?(cache_file) and File.mtime(cache_file) > File.mtime(x) trace "Loading cache #{cache_file}" File.open(cache_file, "r"){|f| ast = Marshal.load(f)} diff --git a/mesa/scripts/ag2.rb b/mesa/scripts/ag2.rb index cbdaa646..caf517e8 100755 --- a/mesa/scripts/ag2.rb +++ b/mesa/scripts/ag2.rb @@ -944,7 +944,7 @@ def handle_root ast ast = nil cache_file = "#{$options[:output_dir]}/#{x}.cache" - if File.exists?(cache_file) and File.mtime(cache_file) > File.mtime(x) + if File.exist?(cache_file) and File.mtime(cache_file) > File.mtime(x) trace "Loading cache #{cache_file}" File.open(cache_file, "r"){|f| ast = Marshal.load(f)}