Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mesa/demo/imggen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions mesa/demo/test/lib/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion mesa/demo/test/lib/frameio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions mesa/demo/test/utils/lazy-ef-install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mesa/demo/test/utils/pcap_analyze.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mesa/demo/test/utils/repeat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mesa/demo/test/utils/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion mesa/scripts/ag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)}

Expand Down
2 changes: 1 addition & 1 deletion mesa/scripts/ag2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)}

Expand Down